scamper-cvs-20171204/000755 001751 000000 00000000000 13211200553 014103 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/.cvsignore000644 001751 000000 00000000323 13146643601 016115 0ustar00mjlwheel000000 000000 *.core *.warts .deps .dirstamp .libs Makefile Makefile.in config* aclocal.m4 autom4te.cache compile depcomp install-sh libtool logfile ltmain.sh m4 man missing mjl_patricia.lo mjl_splaytree.lo stamp-h1 utils.lo scamper-cvs-20171204/COPYING000644 001751 000000 00000043254 11761202614 015156 0ustar00mjlwheel000000 000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 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. 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 Lesser 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 Street, 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 Lesser General Public License instead of this License. scamper-cvs-20171204/Makefile.am000644 001751 000000 00000000111 11745420436 016146 0ustar00mjlwheel000000 000000 SUBDIRS = scamper utils ACLOCAL_AMFLAGS = -I m4 CLEANFILES = *~ *.core scamper-cvs-20171204/TODO000644 001751 000000 00000001445 11761203426 014611 0ustar00mjlwheel000000 000000 $Id: TODO,v 1.17 2012/05/29 17:27:50 mjl Exp $ * investigate if gettimeofday has to be called so much * check that the TOS bits are being set properly on tx. * remove the use of FILE handles in scamper_file_traceroute.c * ensure that all clients that have observed sources unobserves. * ensure that all outfiles are closed when scamper shuts down. * in the scamper.1 man page: document control socket quoting rules. how to feed adhoc sources how to set socket as output for traces how does priority value translate into the way lists are mixed what is the syntax of responses on control socket what is the maximum supported length of source and outfile names and aliases how does the cycles value of a source change as cycles are finished when does source update take effect scamper-cvs-20171204/bootstrap.pl000755 001751 000000 00000006176 13114410671 016500 0ustar00mjlwheel000000 000000 #!/usr/bin/env perl # # $Id: bootstrap.pl,v 1.14 2017/06/03 01:32:41 mjl Exp $ # # script to ship scamper with generated configure script ready to build. use strict; use warnings; my @aclocal = ("aclocal", "aclocal-1.11", "aclocal-1.9"); my @libtoolize = ("libtoolize", "glibtoolize"); my @autoheader = ("autoheader", "autoheader-2.68", "autoheader259"); my @automake = ("automake", "automake-1.11"); my @autoconf = ("autoconf", "autoconf-2.68"); # where to get the AX_* m4 files my $ax_url = "http://git.savannah.gnu.org/gitweb/" . "?p=autoconf-archive.git;a=blob_plain;f=m4"; # the AX m4 files to get, and their SHA-2 256 checksums my %ax; $ax{"ax_check_openssl.m4"} = "0b1b45f2041cfb4f8a3d5ed05a17dd08adebb6544e297451f66849235a6827e4"; $ax{"ax_gcc_builtin.m4"} = "97d45c8aae9fd6a9def8b8a02d76258f5a428c0f490715dba32fad13222013cc"; $ax{"ax_pthread.m4"} = "3c84ad5b7c2cacb880686b0a1bf9975f2381daf3a133c79efe5139c4b5694bde"; sub which($) { my ($bin) = @_; my $rc = undef; open(WHICH, "which $bin 2>/dev/null |") or die "could not which"; while() { chomp; $rc = $_; last; } close WHICH; return $rc; } sub tryexec { my $args = shift; my $rc = -1; foreach my $util (@_) { $util = which($util); if(defined($util)) { print "===> $util $args\n"; $rc = system("$util $args"); last; } } return $rc; } if(!-d "m4") { exit -1 if(!(mkdir "m4")); } foreach my $ax (sort keys %ax) { if(!-r "m4/$ax") { my $cmd; foreach my $util ("fetch", "wget", "ftp") { my $fetch = which($util); next if(!defined($fetch)); if($util eq "wget") { $cmd = "wget -O m4/$ax \"$ax_url/$ax\""; last; } elsif($util eq "fetch") { $cmd = "fetch -o m4/$ax \"$ax_url/$ax\""; last; } elsif($util eq "ftp") { $cmd = "ftp -o m4/$ax \"$ax_url/$ax\""; last; } } if(!defined($cmd)) { print "could not download $ax: no download utility\n"; exit -1; } print "===> $cmd\n"; system("$cmd"); } my $sum; foreach my $util ("sha256", "sha256sum", "shasum") { my $sha256 = which($util); next if(!defined($sha256)); $sha256 .= " -a 256" if($util eq "shasum"); open(SUM, "$sha256 m4/$ax |") or die "could not $sha256 m4/$ax"; while() { chomp; if(/^SHA256 \(m4\/.+?\) \= (.+)/) { $sum = $1; last; } elsif(/^(.+?)\s+m4\//) { $sum = $1; last; } } close SUM; last if(defined($sum)); } if(!defined($sum) || $sum ne $ax{$ax}) { print STDERR "$ax has unexpected sha256 sum\n"; exit -1; } else { print STDERR "$ax has valid sha256 sum\n"; } } if(tryexec("", @aclocal) != 0) { print STDERR "could not exec aclocal\n"; exit -1; } if(tryexec("--force --copy", @libtoolize) != 0) { print STDERR "could not libtoolize\n"; exit -1; } if(tryexec("", @autoheader) != 0) { print STDERR "could not autoheader\n"; exit -1; } if(tryexec("--add-missing --copy --foreign", @automake) != 0) { print STDERR "could not automake\n"; exit -1; } if(tryexec("", @autoconf) != 0) { print STDERR "could not autoconf\n"; exit -1; } exit 0; scamper-cvs-20171204/build-man-pdfs.pl000755 001751 000000 00000002312 13146655145 017265 0ustar00mjlwheel000000 000000 #!/usr/bin/env perl # # $Id: build-man-pdfs.pl,v 1.12 2017/08/21 22:10:45 mjl Exp $ use strict; use warnings; sub cmd($) { my ($cmd) = @_; print "$cmd\n"; system("$cmd"); } my @mans = ("scamper/scamper.1", "utils/sc_ally/sc_ally.1", "utils/sc_analysis_dump/sc_analysis_dump.1", "utils/sc_attach/sc_attach.1", "utils/sc_bdrmap/sc_bdrmap.1", "utils/sc_filterpolicy/sc_filterpolicy.1", "utils/sc_ipiddump/sc_ipiddump.1", "utils/sc_prefixscan/sc_prefixscan.1", "utils/sc_remoted/sc_remoted.1", "utils/sc_radargun/sc_radargun.1", "utils/sc_speedtrap/sc_speedtrap.1", "utils/sc_tbitblind/sc_tbitblind.1", "utils/sc_tracediff/sc_tracediff.1", "utils/sc_uptime/sc_uptime.1", "utils/sc_warts2json/sc_warts2json.1", "utils/sc_warts2pcap/sc_warts2pcap.1", "utils/sc_warts2text/sc_warts2text.1", "utils/sc_wartscat/sc_wartscat.1", "utils/sc_wartsdump/sc_wartsdump.1", "scamper/libscamperfile.3", "scamper/warts.5", ); cmd("mkdir -p man"); foreach my $man (@mans) { if($man =~ /^.+\/(.+)$/) { my $name = $1; cmd("groff -T ps -man $man | ps2pdf - >man/$name.pdf"); cmd("touch -r $man man/$name.pdf"); } } scamper-cvs-20171204/configure.ac000644 001751 000000 00000021567 13211177635 016422 0ustar00mjlwheel000000 000000 # Process this file with autoconf to produce a configure script. AC_INIT([scamper], [20171204], [mjl@luckie.org.nz]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([scamper/scamper.c]) AM_INIT_AUTOMAKE AC_CONFIG_HEADER([config.h]) AC_PROG_LIBTOOL AC_PROG_CC AC_PROG_GCC_TRADITIONAL AC_PROG_INSTALL AC_PROG_MKDIR_P AC_LANG(C) # Whether all the debugging output should be spewed out AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [build with debugging symbols])]) if test "x$enable_debug" != "xyes"; then AC_DEFINE([NDEBUG],[1],[Define to 1 if we don't want to do any debugging]) fi # No privilege separation AC_ARG_ENABLE([privsep], [AS_HELP_STRING([--disable-privsep], [disable privilege separation])]) if test "x$enable_privsep" = xno; then AC_DEFINE([WITHOUT_PRIVSEP], [1], [Define to 1 if we don't want privilege separation]) fi # privsep parameters AC_ARG_WITH([privsep_user], [AC_HELP_STRING([--with-privsep-user=USER], [sets user name for privsep process])], [privsep_user=$withval], [privsep_user=nobody]) AC_ARG_WITH([privsep_dir], [AC_HELP_STRING([--with-privsep-dir=DIR], [sets chroot directory for privsep process])], [privsep_dir=$withval], [privsep_dir=/var/empty]) AC_ARG_WITH([privsep_dir_owner], [AC_HELP_STRING([--with-privsep-dir-user=USER], [sets chroot directory owner])], [privsep_dir_user=$withval], [privsep_dir_user=root]) AC_ARG_WITH([privsep_dir_group], [AC_HELP_STRING([--with-privsep-dir-group=GROUP], [sets chroot directory group id])], [privsep_dir_group=$withval], [privsep_dir_group=wheel]) AC_SUBST(privsep_user) AC_SUBST(privsep_dir) AC_SUBST(privsep_dir_user) AC_SUBST(privsep_dir_group) AC_DEFINE_UNQUOTED(PRIVSEP_USER, ["$privsep_user"], [user name for privsep process]) AC_DEFINE_UNQUOTED(PRIVSEP_DIR, ["$privsep_dir"], [chroot directory for privsep process]) AC_DEFINE_UNQUOTED(PRIVSEP_DIR_USER, ["$privsep_dir_user"], [chroot directory owner]) AC_DEFINE_UNQUOTED(PRIVSEP_DIR_GROUP, ["$privsep_dir_group"], [chroot directory group id]) # Debug file support AC_ARG_ENABLE([debug-file], [AS_HELP_STRING([--disable-debug-file], [remove support for generating a debug file])]) if test "x$enable_debug_file" = xno; then AC_DEFINE([WITHOUT_DEBUGFILE], [1], [Defined to 1 if we don't want to be able generate a debugfile]) fi # dmalloc support AC_ARG_WITH([dmalloc], [AS_HELP_STRING([--with-dmalloc], [enable support for dmalloc])]) if test "x$with_dmalloc" = xyes; then AC_CHECK_LIB([dmalloc], [dmalloc_malloc], [ CFLAGS="$CFLAGS -DDMALLOC" LDFLAGS="$LDFLAGS -ldmalloc" ], [AC_MSG_FAILURE([dmalloc test failed (remove --with-dmalloc)])]) fi # sc_uptime prober support AC_ARG_WITH([sc_uptime], [AS_HELP_STRING([--with-sc_uptime], [enable support for sc_uptime])], [with_sc_uptime=$withval], [with_sc_uptime=no] ) AM_CONDITIONAL([WITH_SC_UPTIME], [test x$with_sc_uptime = xyes]) # Checks for libraries. AC_CHECK_LIB([iphlpapi], [GetIpNetTable]) AC_CHECK_LIB([ws2_32], [WSAStartup]) # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_TIME AC_CHECK_HEADERS(arpa/inet.h) AC_CHECK_HEADERS(fcntl.h) AC_CHECK_HEADERS(limits.h) AC_CHECK_HEADERS(netdb.h) AC_CHECK_HEADERS(net/if_dl.h) AC_CHECK_HEADERS(net/if_types.h) AC_CHECK_HEADERS(netinet/in.h) AC_CHECK_HEADERS(poll.h) AC_CHECK_HEADERS(stdint.h) AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(string.h) AC_CHECK_HEADERS(sys/epoll.h) AC_CHECK_HEADERS(sys/event.h) AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/param.h) AC_CHECK_HEADERS(sys/socket.h) AC_CHECK_HEADERS(sys/time.h) AC_CHECK_HEADERS(unistd.h) AC_CHECK_HEADERS(ifaddrs.h) # sys/sysctl.h requires other headers on at least OpenBSD AC_CHECK_HEADERS([sys/sysctl.h], [], [], [[ #if HAVE_SYS_PARAM_H # include #endif ]]) AC_CHECK_HEADERS([netinet/ip_fw.h netinet6/ip6_fw.h], [], [], [[ #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif #if HAVE_NETINET_IN_H # include #endif #if HAVE_ARPA_INET_H # include #endif #include #include ]]) AC_CHECK_HEADERS([netinet/tcp_var.h], [], [], [[ #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif #if HAVE_NETINET_IN_H # include #endif #include #include ]]) AC_CHECK_HEADERS(net/pfvar.h, [], [], [[ #include #include #include #include ]]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_UID_T AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_STRUCT_TM AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T # Checks for library functions. AC_FUNC_CHOWN AC_FUNC_FORK AC_CHECK_FUNCS(arc4random) AC_CHECK_FUNCS(arc4random_uniform) AC_CHECK_FUNCS(atexit) AC_CHECK_FUNCS(calloc) AC_CHECK_FUNCS(daemon) AC_CHECK_FUNCS(endpwent) AC_CHECK_FUNCS(epoll_wait) AC_CHECK_FUNCS(ftruncate) AC_CHECK_FUNCS(getdtablesize) AC_CHECK_FUNCS(gethostname) AC_CHECK_FUNCS(getifaddrs) AC_CHECK_FUNCS(getpagesize) AC_CHECK_FUNCS(gettimeofday) AC_CHECK_FUNCS(kqueue) AC_CHECK_FUNCS(memmove) AC_CHECK_FUNCS(memset) AC_CHECK_FUNCS(mkdir) AC_CHECK_FUNCS(poll) AC_CHECK_FUNCS(rmdir) AC_CHECK_FUNCS(select) AC_CHECK_FUNCS(socket) AC_CHECK_FUNCS(snprintf) AC_CHECK_FUNCS(setproctitle) AC_CHECK_FUNCS(strcasecmp) AC_CHECK_FUNCS(strcasestr) AC_CHECK_FUNCS(strdup) AC_CHECK_FUNCS(strerror) AC_CHECK_FUNCS(strncasecmp) AC_CHECK_FUNCS(strtol) AC_CHECK_FUNCS(uname) AC_CHECK_SIZEOF(long) AC_CHECK_MEMBER([struct sockaddr.sa_len], [AC_DEFINE([HAVE_STRUCT_SOCKADDR_SA_LEN],[1], [Define if struct sockaddr has an sa_len member])],[:], [#include #include ]) if test "x$ac_cv_header_net_pfvar_h" == xyes; then AC_CHECK_MEMBER([struct pfioc_trans_e.type], [AC_DEFINE([HAVE_STRUCT_PFIOC_TRANS_E_TYPE],[1], [Define if struct pfioc_trans_e has a type member])],[:], [#include #include #include #include #include ]) AC_CHECK_MEMBER([struct pfioc_trans_e.rs_num], [AC_DEFINE([HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM],[1], [Define if struct pfioc_trans_e has a rs_num member])],[:], [#include #include #include #include #include ]) AC_CHECK_MEMBER([struct pf_rule.nat], [AC_DEFINE([HAVE_STRUCT_PF_RULE_NAT],[1], [Define if struct pf_rule has a nat member])],[:], [#include #include #include #include #include ]) AC_CHECK_MEMBER([struct pf_rule.rdr], [AC_DEFINE([HAVE_STRUCT_PF_RULE_RDR],[1], [Define if struct pf_rule has a rdr member])],[:], [#include #include #include #include #include ]) fi # Check for structs AC_MSG_CHECKING([for struct ip6_ext]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[#include ]], [[#include ]], [[void foo(void) { struct ip6_ext ext; }]])], [ AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([HAVE_STRUCT_IP6_EXT], 1, [Define to 1 if you have the `ip6_ext' struct.]) ], [ AC_MSG_RESULT([no]) #AC_DEFINE_UNQUOTED([HAVE_STRUCT_IP6_EXT], 0, [Define to 1 if you have the `ip6_ext' struct.]) ] ) # These libraries have to be explicitly linked in OpenSolaris AC_SEARCH_LIBS(getaddrinfo, socket, [], [], -lnsl) AC_SEARCH_LIBS(inet_ntop, nsl, [], [], -lsocket) # Some systems need -lm to use sqrt. AC_SEARCH_LIBS(sqrt, m, [], [], []) AX_CHECK_OPENSSL( [AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have OpenSSL])] [CFLAGS="$CFLAGS $OPENSSL_INCLUDES"]) AX_GCC_BUILTIN(__builtin_clz) # No thread support AC_ARG_ENABLE([threads], [AS_HELP_STRING([--disable-threads], [disable use of threads])]) if test "x$enable_threads" != xno; then AX_PTHREAD( [AC_DEFINE([HAVE_PTHREAD], [1], [Define to 1 if you have pthread])]) fi AC_CONFIG_FILES([ Makefile scamper/Makefile utils/Makefile utils/sc_ally/Makefile utils/sc_analysis_dump/Makefile utils/sc_attach/Makefile utils/sc_bdrmap/Makefile utils/sc_filterpolicy/Makefile utils/sc_ipiddump/Makefile utils/sc_prefixscan/Makefile utils/sc_radargun/Makefile utils/sc_remoted/Makefile utils/sc_speedtrap/Makefile utils/sc_tbitblind/Makefile utils/sc_tracediff/Makefile ]) if test "x$with_sc_uptime" != xno; then AC_CONFIG_FILES([ utils/sc_uptime/Makefile ]) fi AC_CONFIG_FILES([ utils/sc_warts2csv/Makefile utils/sc_warts2json/Makefile utils/sc_warts2pcap/Makefile utils/sc_warts2text/Makefile utils/sc_wartscat/Makefile utils/sc_wartsdump/Makefile utils/sc_wartsfix/Makefile ]) AC_OUTPUT scamper-cvs-20171204/internal.h000644 001751 000000 00000027141 12767117205 016115 0ustar00mjlwheel000000 000000 /* * internal.h * * $Id: internal.h,v 1.42 2016/09/17 01:38:13 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2013-2015 The Regents of the University of California * Copyright (C) 2014-2016 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #if defined(_MSC_VER) typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef int ssize_t; typedef int pid_t; typedef int socklen_t; typedef int mode_t; typedef unsigned short sa_family_t; #define __func__ __FUNCTION__ #endif #include #include #ifdef _WIN32 #include #include #include #include #include #include #include #include "wingetopt.h" #define _CRT_RAND_S #endif #if defined(__APPLE__) #define _BSD_SOCKLEN_T_ #define HAVE_BPF #define HAVE_BSD_ROUTE_SOCKET #endif #if defined(__FreeBSD__) #define HAVE_BPF #define HAVE_BSD_ROUTE_SOCKET #endif #if defined(__NetBSD__) #define HAVE_BPF #define HAVE_BSD_ROUTE_SOCKET #endif #if defined(__OpenBSD__) #define HAVE_BPF #define HAVE_BSD_ROUTE_SOCKET #endif #if defined(__DragonFly__) #define HAVE_BPF #define HAVE_BSD_ROUTE_SOCKET #endif #if defined(__linux__) #define __FAVOR_BSD #endif #if defined(__sun__) #define BSD_COMP #define _XPG4_2 #define __EXTENSIONS__ #define HAVE_BSD_ROUTE_SOCKET #define RTAX_MAX RTA_NUMBITS #define RTAX_GATEWAY 1 #define RTAX_IFP 4 #endif #ifdef HAVE_SYS_EVENT_H #include #endif #ifdef HAVE_SYS_EPOLL_H #include #endif #if defined(HAVE_SYS_EPOLL_H) && defined(HAVE_EPOLL_WAIT) #define HAVE_EPOLL #endif #ifndef _WIN32 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_NETINET_TCP_VAR_H #include #endif #include #include #include #include #include #include #endif #ifdef HAVE_SYS_SYSCTL_H #include #endif #ifdef HAVE_NET_IF_DL_H #include #endif #ifdef HAVE_NET_IF_TYPES_H #include #endif #if defined(HAVE_BPF) #include #endif #ifdef HAVE_IFADDRS_H #include #endif #ifdef HAVE_POLL_H #include #endif #if defined(__linux__) #include #include #include #include #include #include #include #ifndef SOL_PACKET #define SOL_PACKET 263 #endif #define HAVE_IPTABLES #endif #if defined(__sun__) #define HAVE_DLPI #define MAXDLBUF 8192 #include #include #include #endif #ifdef HAVE_NETINET_IP_FW_H #define HAVE_IPFW #endif #ifdef HAVE_NET_PFVAR_H #define HAVE_PF #endif #include #include #include #include #include #include #include #include #include #include #if defined(AF_UNIX) && !defined(_WIN32) #define HAVE_SOCKADDR_UN #endif #if defined(_WIN32) || defined(__sun__) || defined(__linux__) #define IP_HDR_HTONS #endif #if defined(__OpenBSD__) && OpenBSD >= 199706 #define IP_HDR_HTONS #endif #if defined(__FreeBSD__) && __FreeBSD_version >= 1100030 #define IP_HDR_HTONS #endif #if defined(HAVE_STDINT_H) #include #endif #if defined(HAVE_OPENSSL) #include #include #include #include #endif #if defined(DMALLOC) #include #endif #ifdef _WIN32 #define SHUT_RDWR SD_BOTH #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define S_IRUSR _S_IREAD #define S_IWUSR _S_IWRITE #define S_IFIFO _S_IFIFO #define S_IFREG _S_IFREG #define MAXHOSTNAMELEN 256 #define close _close #define fdopen _fdopen #define fileno _fileno #define ftruncate _chsize #define lseek _lseek #define mkdir(dir,mode) _mkdir(dir) #define open _open #define read _read #define snprintf _snprintf #define strdup _strdup #define strcasecmp _stricmp #define strncasecmp _strnicmp #define write _write #endif #include #if defined(__sun__) || defined(_WIN32) struct ip6_ext { uint8_t ip6e_nxt; uint8_t ip6e_len; }; #endif #ifdef _WIN32 struct ip { uint8_t ip_vhl; uint8_t ip_tos; uint16_t ip_len; uint16_t ip_id; uint16_t ip_off; uint8_t ip_ttl; uint8_t ip_p; uint16_t ip_sum; struct in_addr ip_src; struct in_addr ip_dst; }; struct ip6_hdr { union { struct ip6_hdrctl { uint32_t flow; uint16_t plen; uint8_t nxt; uint8_t hlim; } hdr; uint8_t vfc; } ip6un; struct in6_addr ip6_src; struct in6_addr ip6_dst; }; struct ip6_frag { uint8_t ip6f_nxt; uint8_t ip6f_reserved; uint16_t ip6f_offlg; uint32_t ip6f_ident; }; struct icmp { uint8_t icmp_type; uint8_t icmp_code; uint16_t icmp_cksum; union { uint8_t pptr; struct idseq { uint16_t id; uint16_t seq; } idseq; } icmpun; struct ip icmp_ip; }; struct icmp6_hdr { uint8_t icmp6_type; uint8_t icmp6_code; uint16_t icmp6_cksum; union { uint32_t data32[0]; uint16_t data16[1]; } icmp6un; }; struct udphdr { uint16_t uh_sport; uint16_t uh_dport; uint16_t uh_ulen; uint16_t uh_sum; }; struct tcphdr { uint16_t th_sport; uint16_t th_dport; uint32_t th_seq; uint32_t th_ack; uint8_t th_offx2; uint8_t th_flags; uint16_t th_win; uint16_t th_sum; uint16_t th_urp; }; struct iovec { void *iov_base; size_t iov_len; }; #define icmp_id icmpun.idseq.id #define icmp_seq icmpun.idseq.seq #define icmp_nextmtu icmpun.idseq.seq #define icmp_pptr icmpun.pptr #define ip6_vfc ip6un.vfc #define ip6_flow ip6un.hdr.flow #define ip6_plen ip6un.hdr.plen #define ip6_nxt ip6un.hdr.nxt #define ip6_hlim ip6un.hdr.hlim #define icmp6_data32 icmp6un.data32 #define icmp6_mtu icmp6un.data32[0] #define icmp6_id icmp6un.data16[0] #define icmp6_seq icmp6un.data16[1] #endif #if defined(__sun__) # define s6_addr32 _S6_un._S6_u32 #elif !defined(s6_addr32) # define s6_addr32 __u6_addr.__u6_addr32 #endif #ifndef S_ISREG #define S_ISREG(m) (((m) & S_IFREG) && ((m) & (S_IFIFO|S_IFCHR|S_IFDIR)) == 0) #endif #ifndef ETHER_ADDR_LEN #define ETHER_ADDR_LEN 6 #endif #ifndef ETHERTYPE_IP #define ETHERTYPE_IP 0x0800 #endif #ifndef ETHERTYPE_IPV6 #define ETHERTYPE_IPV6 0x86DD #endif #ifndef ETHERTYPE_ARP #define ETHERTYPE_ARP 0x0806 #endif #ifndef ND_ROUTER_ADVERT #define ND_ROUTER_ADVERT 134 #endif #ifndef ND_NEIGHBOR_SOLICIT #define ND_NEIGHBOR_SOLICIT 135 #endif #ifndef ND_NEIGHBOR_ADVERT #define ND_NEIGHBOR_ADVERT 136 #endif #ifndef IPPROTO_ROUTING #define IPPROTO_ROUTING 43 #endif #ifndef IPPROTO_FRAGMENT #define IPPROTO_FRAGMENT 44 #endif #ifndef IPPROTO_HOPOPTS #define IPPROTO_HOPOPTS 0 #endif #ifndef IP_DF #define IP_DF 0x4000 #endif #ifndef IP_MF #define IP_MF 0x2000 #endif #ifndef IP_OFFMASK #define IP_OFFMASK 0x1fff #endif #ifndef IPTOS_ECN_ECT1 #define IPTOS_ECN_ECT1 0x01 #endif #ifndef IPTOS_ECN_ECT0 #define IPTOS_ECN_ECT0 0x02 #endif #ifndef IPTOS_ECN_CE #define IPTOS_ECN_CE 0x03 #endif #ifndef IPTOS_ECN_MASK #define IPTOS_ECN_MASK 0x03 #endif #ifndef TH_FIN #define TH_FIN 0x01 #endif #ifndef TH_SYN #define TH_SYN 0x02 #endif #ifndef TH_RST #define TH_RST 0x04 #endif #ifndef TH_PUSH #define TH_PUSH 0x08 #endif #ifndef TH_ACK #define TH_ACK 0x10 #endif #ifndef TH_URG #define TH_URG 0x20 #endif #ifndef TH_ECE #define TH_ECE 0x40 #endif #ifndef TH_CWR #define TH_CWR 0x80 #endif #ifndef ICMP_MINLEN #define ICMP_MINLEN 8 #endif #ifndef ICMP_UNREACH #define ICMP_UNREACH 3 #endif #ifndef ICMP_UNREACH_NET #define ICMP_UNREACH_NET 0 #endif #ifndef ICMP_UNREACH_HOST #define ICMP_UNREACH_HOST 1 #endif #ifndef ICMP_UNREACH_PROTOCOL #define ICMP_UNREACH_PROTOCOL 2 #endif #ifndef ICMP_UNREACH_PORT #define ICMP_UNREACH_PORT 3 #endif #ifndef ICMP_UNREACH_NEEDFRAG #define ICMP_UNREACH_NEEDFRAG 4 #endif #ifndef ICMP_UNREACH_SRCFAIL #define ICMP_UNREACH_SRCFAIL 5 #endif #ifndef ICMP_UNREACH_NET_UNKNOWN #define ICMP_UNREACH_NET_UNKNOWN 6 #endif #ifndef ICMP_UNREACH_HOST_UNKNOWN #define ICMP_UNREACH_HOST_UNKNOWN 7 #endif #ifndef ICMP_UNREACH_ISOLATED #define ICMP_UNREACH_ISOLATED 8 #endif #ifndef ICMP_UNREACH_NET_PROHIB #define ICMP_UNREACH_NET_PROHIB 9 #endif #ifndef ICMP_UNREACH_HOST_PROHIB #define ICMP_UNREACH_HOST_PROHIB 10 #endif #ifndef ICMP_UNREACH_TOSNET #define ICMP_UNREACH_TOSNET 11 #endif #ifndef ICMP_UNREACH_TOSHOST #define ICMP_UNREACH_TOSHOST 12 #endif #ifndef ICMP_UNREACH_FILTER_PROHIB #define ICMP_UNREACH_FILTER_PROHIB 13 #endif #ifndef ICMP_ECHOREPLY #define ICMP_ECHOREPLY 0 #endif #ifndef ICMP_ECHO #define ICMP_ECHO 8 #endif #ifndef ICMP_PARAMPROB #define ICMP_PARAMPROB 12 #endif #ifndef ICMP_PARAMPROB_ERRATPTR #define ICMP_PARAMPROB_ERRATPTR 0 #endif #ifndef ICMP_PARAMPROB_OPTABSENT #define ICMP_PARAMPROB_OPTABSENT 1 #endif #ifndef ICMP_PARAMPROB_LENGTH #define ICMP_PARAMPROB_LENGTH 2 #endif #ifndef ICMP_TSTAMP #define ICMP_TSTAMP 13 #endif #ifndef ICMP_TSTAMPREPLY #define ICMP_TSTAMPREPLY 14 #endif #ifndef ICMP_TIMXCEED #define ICMP_TIMXCEED 11 #endif #ifndef ICMP_TIMXCEED_INTRANS #define ICMP_TIMXCEED_INTRANS 0 #endif #ifndef ICMP_TIMXCEED_REASS #define ICMP_TIMXCEED_REASS 1 #endif #ifndef ICMP6_DST_UNREACH #define ICMP6_DST_UNREACH 1 #endif #ifndef ICMP6_PACKET_TOO_BIG #define ICMP6_PACKET_TOO_BIG 2 #endif #ifndef ICMP6_TIME_EXCEEDED #define ICMP6_TIME_EXCEEDED 3 #endif #ifndef ICMP6_TIME_EXCEED_TRANSIT #define ICMP6_TIME_EXCEED_TRANSIT 0 #endif #ifndef ICMP6_TIME_EXCEED_REASSEMBLY #define ICMP6_TIME_EXCEED_REASSEMBLY 1 #endif #ifndef ICMP6_DST_UNREACH_NOROUTE #define ICMP6_DST_UNREACH_NOROUTE 0 #endif #ifndef ICMP6_DST_UNREACH_ADMIN #define ICMP6_DST_UNREACH_ADMIN 1 #endif #ifndef ICMP6_DST_UNREACH_BEYONDSCOPE #define ICMP6_DST_UNREACH_BEYONDSCOPE 2 #endif #ifndef ICMP6_DST_UNREACH_ADDR #define ICMP6_DST_UNREACH_ADDR 3 #endif #ifndef ICMP6_DST_UNREACH_NOPORT #define ICMP6_DST_UNREACH_NOPORT 4 #endif #ifndef ICMP6_ECHO_REQUEST #define ICMP6_ECHO_REQUEST 128 #endif #ifndef ICMP6_ECHO_REPLY #define ICMP6_ECHO_REPLY 129 #endif #ifndef TCP_MAX_SEQNUM #define TCP_MAX_SEQNUM 4294967295U #endif #ifndef SEQ_LT #define SEQ_LT(a,b) ((int)((a)-(b)) < 0) #endif #ifndef SEQ_LEQ #define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) #endif #ifndef SEQ_GT #define SEQ_GT(a,b) ((int)((a)-(b)) > 0) #endif #ifndef SEQ_GEQ #define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0) #endif scamper-cvs-20171204/mjl_heap.c000644 001751 000000 00000016440 11746426252 016054 0ustar00mjlwheel000000 000000 /* * heap routines * by Matthew Luckie * * Adapted from the priority queue in "Robert Sedgewick's Algorithms in C++" * * Copyright (C) 2006-2012 Matthew Luckie. 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 Matthew Luckie ``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 Matthew Luckie BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #ifndef lint static const char rcsid[] = "$Id: mjl_heap.c,v 1.11 2012/04/27 05:20:42 mjl Exp $"; #endif #include #include #if defined(DMALLOC) #include #endif #include "mjl_heap.h" #define HEAP_GROWBY 128 struct heap_node { int id; void *item; }; struct heap { heap_node_t **a; int N; int max; heap_cmp_t cmp; heap_onremove_t onremove; }; #if !defined(NDEBUG) && defined(MJLHEAP_DEBUG) static void heap_assert(const heap_t *heap) { int i; for(i=1; i <= heap->N; i++) { assert(heap->a[i]->id == i); /* parent has to have higher priority than its children */ if(i+i <= heap->N) assert(heap->cmp(heap->a[i]->item, heap->a[i+i]->item) >= 0); if(i+i+1 <= heap->N) assert(heap->cmp(heap->a[i]->item, heap->a[i+i+1]->item) >= 0); } return; } #else #define heap_assert(heap)((void)0) #endif static void upheap(heap_t *heap, int k) { heap_node_t *v = heap->a[k]; while(k > 1 && heap->cmp(heap->a[k/2]->item, v->item) <= 0) { heap->a[k] = heap->a[k/2]; heap->a[k]->id = k; k = k/2; } heap->a[k] = v; v->id = k; return; } static void downheap(heap_t *heap, int k) { heap_node_t *v = heap->a[k]; int j; while(k <= heap->N/2) { j = k+k; if(j < heap->N && heap->cmp(heap->a[j]->item, heap->a[j+1]->item) < 0) j++; if(heap->cmp(v->item, heap->a[j]->item) >= 0) break; heap->a[k] = heap->a[j]; heap->a[k]->id = k; k = j; } heap->a[k] = v; heap->a[k]->id = k; return; } #ifndef DMALLOC heap_t *heap_alloc(heap_cmp_t cmp) #else heap_t *heap_alloc_dm(heap_cmp_t cmp, const char *file, const int line) #endif { heap_t *heap = NULL; #ifndef DMALLOC heap = malloc(sizeof(heap_t)); #else heap = dmalloc_malloc(file, line, sizeof(heap_t), DMALLOC_FUNC_MALLOC, 0, 0); #endif if(heap == NULL) goto err; heap->N = 0; heap->max = HEAP_GROWBY; heap->cmp = cmp; heap->onremove = NULL; if((heap->a = malloc(sizeof(heap_node_t *) * heap->max)) == NULL) goto err; return heap; err: heap_free(heap, NULL); return NULL; } void heap_free(heap_t *heap, heap_free_t free_func) { int i; if(heap == NULL) return; if(heap->a != NULL) { for(i=1; i <= heap->N; i++) { if(free_func != NULL) free_func(heap->a[i]->item); free(heap->a[i]); } free(heap->a); } free(heap); return; } /* * heap_remake * * items in the heap might violate the heap condition. remake the heap. */ void heap_remake(heap_t *heap) { int i; for(i=1; i<=heap->N; i++) upheap(heap, i); return; } void heap_onremove(heap_t *heap, heap_onremove_t onremove) { heap->onremove = onremove; return; } #ifndef DMALLOC heap_node_t *heap_insert(heap_t *heap, void *ptr) #else heap_node_t *heap_insert_dm(heap_t *heap, void *ptr, const char *file, const int line) #endif { heap_node_t *node = NULL; void *tmp; size_t size; heap_assert(heap); size = sizeof(heap_node_t); /* allocate a new node */ #ifndef DMALLOC node = malloc(size); #else node = dmalloc_malloc(file, line, size, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(node == NULL) goto err; node->id = heap->N+1; node->item = ptr; /* determine if we need to increase the size of the array for this node */ if(node->id >= heap->max) { size = (heap->max + HEAP_GROWBY) * sizeof(heap_node_t *); if((tmp = realloc(heap->a, size)) == NULL) goto err; heap->max += HEAP_GROWBY; heap->a = (heap_node_t **)tmp; } /* insert the new node, and then satisfy the heap condition */ heap->a[node->id] = node; heap->N++; upheap(heap, heap->N); heap_assert(heap); return node; err: if(node != NULL) free(node); return NULL; } /* * heap_head_node * * return the node at the top of the heap, without removing it. */ heap_node_t *heap_head_node(heap_t *heap) { heap_assert(heap); if(heap->N == 0) return NULL; return heap->a[1]; } /* * heap_head_item * * return the item at the top of the heap, without removing it. */ void *heap_head_item(heap_t *heap) { heap_assert(heap); if(heap->N == 0) return NULL; return heap->a[1]->item; } void *heap_remove(heap_t *heap) { heap_node_t *v; void *item; heap_assert(heap); if(heap->N == 0) return NULL; v = heap->a[1]; heap->a[1] = heap->a[heap->N--]; heap->a[1]->id = 1; downheap(heap, 1); item = v->item; free(v); heap_assert(heap); if(heap->onremove != NULL) heap->onremove(item); return item; } void heap_foreach(heap_t *heap, void *param, heap_foreach_t func) { int i; for(i=1; i <= heap->N; i++) func(param, heap->a[i]->item); return; } int heap_count(heap_t *heap) { return heap->N; } void *heap_node_item(heap_node_t *node) { return node->item; } int heap_node_id(heap_node_t *node) { return node->id; } /* * heap_delete * * take the last node in the heap and replace the node to be deleted with * it. then, satisfy the heap condition. */ void heap_delete(heap_t *heap, heap_node_t *node) { heap_node_t *v; int i; heap_assert(heap); assert(node != NULL); assert(node->id <= heap->N); assert(node->id > 0); assert(heap->a[node->id] == node); if(node->id == heap->N) { heap->N--; } else { /* * take the last node and put it in the array where the value being * deleted is */ heap->a[node->id] = v = heap->a[heap->N--]; heap->a[node->id]->id = node->id; /* if the priority of the item being replaced is raised, upheap */ if((i = heap->cmp(v->item, node->item)) > 0) { upheap(heap, node->id); } /* if the priority of the item being replaced is lowered, downheap */ else if(i < 0) { downheap(heap, node->id); } } if(heap->onremove != NULL) heap->onremove(node->item); free(node); heap_assert(heap); return; } scamper-cvs-20171204/mjl_heap.h000644 001751 000000 00000005166 12453545764 016072 0ustar00mjlwheel000000 000000 /* * mjl_heap * * Copyright (C) 2006-2012 Matthew Luckie. 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 Matthew Luckie ``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 Matthew Luckie 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. * * $Id: mjl_heap.h,v 1.7 2015/01/08 18:27:00 mjl Exp $ * */ #ifndef __MJL_HEAP_H #define __MJL_HEAP_H typedef struct heap heap_t; typedef struct heap_node heap_node_t; typedef int (*heap_cmp_t)(const void *a, const void *b); typedef void (*heap_free_t)(void *ptr); typedef void (*heap_foreach_t)(void *param, void *item); typedef void (*heap_onremove_t)(void *ptr); #ifndef DMALLOC heap_t *heap_alloc(heap_cmp_t cmp); heap_node_t *heap_insert(heap_t *heap, void *ptr); #endif #ifdef DMALLOC heap_t *heap_alloc_dm(heap_cmp_t cmp, const char *file, const int line); heap_node_t *heap_insert_dm(heap_t *heap, void *ptr, const char *file, const int line); #define heap_alloc(cmp) heap_alloc_dm((cmp), __FILE__, __LINE__) #define heap_insert(heap, ptr) heap_insert_dm((heap),(ptr),__FILE__,__LINE__) #endif void heap_free(heap_t *heap, heap_free_t free_func); void heap_remake(heap_t *heap); void heap_onremove(heap_t *heap, heap_onremove_t onremove); void *heap_remove(heap_t *heap); heap_node_t *heap_head_node(heap_t *heap); void *heap_head_item(heap_t *heap); void heap_delete(heap_t *heap, heap_node_t *node); void heap_foreach(heap_t *heap, void *param, heap_foreach_t func); int heap_count(heap_t *heap); void *heap_node_item(heap_node_t *node); int heap_node_id(heap_node_t *node); #endif /* __MJL_HEAP_H */ scamper-cvs-20171204/mjl_list.c000644 001751 000000 00000077767 13175153547 016137 0ustar00mjlwheel000000 000000 /* * linked list routines * by Matthew Luckie * * Copyright (C) 2004-2016 Matthew Luckie. 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 Matthew Luckie ``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 Matthew Luckie BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #ifndef lint static const char rcsid[] = "$Id: mjl_list.c,v 1.75 2017/10/28 19:15:51 mjl Exp $"; #endif #include #include #if defined(DMALLOC) #include #endif #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include "mjl_list.h" struct slist_node { void *item; struct slist_node *next; }; struct dlist_node { void *item; struct dlist_node *prev; struct dlist_node *next; struct dlist *list; }; struct clist_node { void *item; struct clist_node *prev; struct clist_node *next; }; struct slist { slist_node_t *head; slist_node_t *tail; int length; unsigned int lock; slist_onremove_t onremove; }; struct dlist { dlist_node_t *head; dlist_node_t *tail; int length; unsigned int lock; dlist_onremove_t onremove; }; struct clist { clist_node_t *head; int length; unsigned int lock; clist_onremove_t onremove; }; static int random_u32(unsigned int *r) { #ifdef _WIN32 unsigned int ui; if(rand_s(&ui) != 0) return -1; *r = ui; #elif HAVE_ARC4RANDOM *r = arc4random(); #else *r = random(); #endif return 0; } static int shuffle_array(void **array, int len) { int n = len; unsigned int k; void *tmp; while(n > 1) { n--; if(random_u32(&k) != 0) return -1; k %= n+1; tmp = array[k]; array[k] = array[n]; array[n] = tmp; } return 0; } #if !defined(NDEBUG) && defined(MJLLIST_DEBUG) static void slist_assert_sort(const slist_t *list, slist_cmp_t cmp) { slist_node_t *n; for(n=list->head; n->next != NULL; n = n->next) assert(cmp(n->item, n->next->item) <= 0); return; } static void slist_assert(const slist_t *list) { slist_node_t *node; int i; if(list == NULL) return; assert(list->length >= 0); if(list->length == 0) { assert(list->head == NULL); assert(list->tail == NULL); } else if(list->length == 1) { assert(list->head != NULL); assert(list->tail != NULL); assert(list->head == list->tail); assert(list->head->next == NULL); } else { i = 1; node = list->head; while(ilength) { assert(node != NULL); node = node->next; i++; } assert(node == list->tail); } return; } #else #define slist_assert(list)((void)0) #define slist_assert_sort(list,cmp)((void)0) #endif void slist_lock(slist_t *list) { assert(list != NULL); list->lock++; return; } void slist_unlock(slist_t *list) { assert(list != NULL); assert(list->lock > 0); list->lock--; return; } int slist_islocked(slist_t *list) { assert(list != NULL); return list->lock == 0 ? 0 : 1; } #ifndef DMALLOC slist_t *slist_alloc(void) #else slist_t *slist_alloc_dm(const char *file, const int line) #endif { slist_t *list; size_t len = sizeof(slist_t); #ifndef DMALLOC list = (slist_t *)malloc(len); #else list = (slist_t *)dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(list != NULL) { slist_init(list); } return list; } void slist_init(slist_t *list) { assert(list != NULL); list->head = NULL; list->tail = NULL; list->length = 0; list->lock = 0; list->onremove = NULL; return; } void slist_onremove(slist_t *list, slist_onremove_t onremove) { assert(list != NULL); list->onremove = onremove; return; } #ifndef DMALLOC static slist_node_t *slist_node(void *item, slist_node_t *next) #else static slist_node_t *slist_node(void *item, slist_node_t *next, const char *file, const int line) #endif { slist_node_t *node; size_t len = sizeof(slist_node_t); #ifndef DMALLOC node = malloc(len); #else node = dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(node != NULL) { node->item = item; node->next = next; } return node; } /* * slist_dup * * make a copy of the list that points to the same items. * if the foreach function is not null, call that on each item too. */ #ifndef DMALLOC slist_t *slist_dup(slist_t *oldlist, const slist_foreach_t func, void *param) #else slist_t *slist_dup_dm(slist_t *oldlist,const slist_foreach_t func,void *param, const char *file, const int line) #endif { slist_t *list; slist_node_t *oldnode, *node; size_t len = sizeof(slist_t); /* first, allocate a replacement slist_t structure */ #ifndef DMALLOC list = malloc(len); #else list = dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(list == NULL) return NULL; list->head = NULL; list->tail = NULL; list->length = 0; list->lock = 0; list->onremove = NULL; if(oldlist->head != NULL) { #ifndef DMALLOC if((node = slist_node(oldlist->head->item, NULL)) == NULL) #else if((node = slist_node(oldlist->head->item, NULL, file, line)) == NULL) #endif { goto err; } if(func != NULL) func(oldlist->head->item, param); list->length = oldlist->length; list->head = node; oldnode = oldlist->head->next; } else return list; while(oldnode != NULL) { #ifndef DMALLOC if((node->next = slist_node(oldnode->item, NULL)) == NULL) #else if((node->next = slist_node(oldnode->item, NULL, file, line)) == NULL) #endif { goto err; } if(func != NULL) func(oldnode->item, param); oldnode = oldnode->next; node = node->next; } list->tail = node; return list; err: slist_free(list); return NULL; } void slist_concat(slist_t *first, slist_t *second) { assert(first != NULL); assert(second != NULL); assert(first->lock == 0); assert(second->lock == 0); slist_assert(first); slist_assert(second); /* if there is nothing to concatenate, then return now */ if(second->length == 0) { return; } /* shift the second list's nodes into the first */ if(first->tail != NULL) { first->tail->next = second->head; first->length += second->length; first->tail = second->tail; } else { first->head = second->head; first->tail = second->tail; first->length = second->length; } /* reset the second list */ second->length = 0; second->head = NULL; second->tail = NULL; slist_assert(first); slist_assert(second); return; } static void slist_flush(slist_t *list, slist_free_t free_func) { slist_node_t *node; slist_node_t *next; assert(list != NULL); slist_assert(list); assert(list->lock == 0); node = list->head; while(node != NULL) { next = node->next; if(list->onremove != NULL) list->onremove(node->item); if(free_func != NULL) free_func(node->item); free(node); node = next; } return; } void slist_empty(slist_t *list) { slist_flush(list, NULL); slist_init(list); return; } void slist_empty_cb(slist_t *list, slist_free_t func) { slist_flush(list, func); slist_init(list); return; } void slist_free(slist_t *list) { slist_flush(list, NULL); free(list); return; } void slist_free_cb(slist_t *list, slist_free_t func) { slist_flush(list, func); free(list); return; } #ifndef DMALLOC slist_node_t *slist_head_push(slist_t *list, void *item) #else slist_node_t *slist_head_push_dm(slist_t *list, void *item, const char *file, const int line) #endif { slist_node_t *node; assert(list != NULL); slist_assert(list); assert(list->lock == 0); #ifndef DMALLOC if((node = slist_node(item, list->head)) != NULL) #else if((node = slist_node(item, list->head, file, line)) != NULL) #endif { list->head = node; if(list->tail == NULL) { list->tail = node; } list->length++; } slist_assert(list); return node; } #ifndef DMALLOC slist_node_t *slist_tail_push(slist_t *list, void *item) #else slist_node_t *slist_tail_push_dm(slist_t *list, void *item, const char *file, const int line) #endif { slist_node_t *node; assert(list != NULL); slist_assert(list); assert(list->lock == 0); #ifndef DMALLOC if((node = slist_node(item, NULL)) != NULL) #else if((node = slist_node(item, NULL, file, line)) != NULL) #endif { if(list->tail != NULL) { list->tail->next = node; list->tail = node; } else { list->head = list->tail = node; } list->length++; } slist_assert(list); return node; } void *slist_head_pop(slist_t *list) { slist_node_t *node; void *item = NULL; assert(list != NULL); slist_assert(list); assert(list->lock == 0); if(list->head == NULL) return NULL; node = list->head; item = node->item; /* if there are no nodes left ... */ if((list->head = node->next) == NULL) list->tail = NULL; free(node); list->length--; if(list->onremove != NULL) list->onremove(item); slist_assert(list); return item; } void *slist_head_item(const slist_t *list) { assert(list != NULL); if(list->head == NULL) return NULL; return list->head->item; } void *slist_tail_item(const slist_t *list) { assert(list != NULL); if(list->tail == NULL) return NULL; return list->tail->item; } slist_node_t *slist_head_node(const slist_t *list) { assert(list != NULL); return list->head; } slist_node_t *slist_tail_node(const slist_t *list) { assert(list != NULL); return list->tail; } void *slist_node_item(const slist_node_t *node) { assert(node != NULL); return node->item; } slist_node_t *slist_node_next(const slist_node_t *node) { assert(node != NULL); return node->next; } int slist_foreach(slist_t *list, const slist_foreach_t func, void *param) { slist_node_t *node; slist_node_t *next; assert(list != NULL); slist_lock(list); slist_assert(list); node = list->head; while(node != NULL) { next = node->next; if(func(node->item, param) != 0) { slist_unlock(list); return -1; } node = next; } slist_assert(list); slist_unlock(list); return 0; } int slist_count(const slist_t *list) { assert(list != NULL); slist_assert(list); return list->length; } static void slist_swap(slist_node_t **a, int i, int j) { slist_node_t *item = a[i]; a[i] = a[j]; a[j] = item; return; } static slist_node_t **slist_node_array(const slist_t *list) { slist_node_t **v = NULL, *n; int i = 0; assert(list->length >= 2); if((v = malloc(sizeof(slist_node_t *) * list->length)) == NULL) return NULL; for(n = list->head; n != NULL; n = n->next) v[i++] = n; assert(i == list->length); return v; } static void slist_rebuild(slist_t *list, slist_node_t **v) { int i; list->head = v[0]; list->tail = v[list->length-1]; list->tail->next = NULL; for(i=0; ilength-1; i++) v[i]->next = v[i+1]; slist_assert(list); return; } /* * slist_qsort_3: * * recursive function that implements quicksort with a three-way partition * on an array of slist_node_t structures. */ static void slist_qsort_3(slist_node_t **a, slist_cmp_t cmp, int l, int r) { slist_node_t *c; int i, lt, gt, rc; if(l >= r) return; c = a[l]; lt = l; gt = r; i = l; while(i <= gt) { rc = a[i]->item != c->item ? cmp(a[i]->item, c->item) : 0; if(rc < 0) slist_swap(a, lt++, i++); else if(rc > 0) slist_swap(a, i, gt--); else i++; } slist_qsort_3(a, cmp, l, lt-1); slist_qsort_3(a, cmp, gt+1, r); return; } int slist_qsort(slist_t *list, slist_cmp_t cmp) { slist_node_t **v; slist_assert(list); assert(list->lock == 0); /* don't have to order the list if there less than two items in it */ if(list->length < 2) return 0; if((v = slist_node_array(list)) == NULL) return -1; slist_qsort_3(v, cmp, 0, list->length-1); slist_rebuild(list, v); free(v); slist_assert_sort(list, cmp); return 0; } int slist_shuffle(slist_t *list) { slist_node_t **v; slist_assert(list); assert(list->lock == 0); if(list->length < 2) return 0; if((v = slist_node_array(list)) == NULL) return -1; shuffle_array((void **)v, list->length); slist_rebuild(list, v); free(v); return 0; } #if !defined(NDEBUG) && defined(MJLLIST_DEBUG) static void dlist_assert_sort(const dlist_t *list, dlist_cmp_t cmp) { dlist_node_t *n; for(n=list->head; n->next != NULL; n = n->next) assert(cmp(n->item, n->next->item) <= 0); return; } static void dlist_assert(const dlist_t *list) { dlist_node_t *node; int i; if(list == NULL) return; assert(list->length >= 0); if(list->length == 0) { assert(list->head == NULL); assert(list->tail == NULL); } else if(list->length == 1) { assert(list->head != NULL); assert(list->tail != NULL); assert(list->head == list->tail); assert(list->head->next == NULL); assert(list->head->prev == NULL); assert(list->head->list == list); } else { assert(list->head->prev == NULL); assert(list->tail->next == NULL); i = 1; node = list->head; while(i < list->length-1) { assert(node != NULL); assert(node->next != NULL); assert(node->next->prev == node); assert(node->list == list); node = node->next; i++; } assert(node->next == list->tail); assert(node->list == list); } return; } #else #define dlist_assert(list)((void)0) #define dlist_assert_sort(list,cmp)((void)0) #endif void dlist_lock(dlist_t *list) { assert(list != NULL); list->lock++; return; } void dlist_unlock(dlist_t *list) { assert(list != NULL); assert(list->lock > 0); list->lock--; return; } int dlist_islocked(dlist_t *list) { assert(list != NULL); return list->lock == 0 ? 0 : 1; } #ifndef DMALLOC dlist_t *dlist_alloc(void) #else dlist_t *dlist_alloc_dm(const char *file, const int line) #endif { dlist_t *list; size_t len = sizeof(dlist_t); #ifndef DMALLOC list = malloc(len); #else list = dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(list != NULL) { dlist_init(list); } return list; } void dlist_init(dlist_t *list) { assert(list != NULL); list->head = NULL; list->tail = NULL; list->length = 0; list->lock = 0; list->onremove = NULL; return; } void dlist_onremove(dlist_t *list, dlist_onremove_t onremove) { assert(list != NULL); list->onremove = onremove; return; } #ifndef DMALLOC static dlist_node_t *dlist_node(void *i, dlist_node_t *p, dlist_node_t *n) #else static dlist_node_t *dlist_node(void *i, dlist_node_t *p, dlist_node_t *n, const char *file, const int line) #endif { dlist_node_t *node; size_t len = sizeof(dlist_node_t); #ifndef DMALLOC node = malloc(len); #else node = dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(node != NULL) { node->item = i; node->prev = p; node->next = n; node->list = NULL; } return node; } #ifndef DMALLOC dlist_node_t *dlist_node_alloc(void *item) { return dlist_node(item, NULL, NULL); } #else dlist_node_t *dlist_node_alloc_dm(void *item, const char *file, const int line) { return dlist_node(item, NULL, NULL, file, line); } #endif static void dlist_flush(dlist_t *list, dlist_free_t free_func) { dlist_node_t *node; dlist_node_t *next; assert(list != NULL); dlist_assert(list); assert(list->lock == 0); node = list->head; while(node != NULL) { next = node->next; if(list->onremove != NULL) list->onremove(node->item); if(free_func != NULL) free_func(node->item); free(node); node = next; } return; } void dlist_empty(dlist_t *list) { dlist_flush(list, NULL); dlist_init(list); return; } void dlist_empty_cb(dlist_t *list, dlist_free_t func) { dlist_flush(list, func); dlist_init(list); return; } void dlist_free(dlist_t *list) { dlist_flush(list, NULL); free(list); return; } void dlist_free_cb(dlist_t *list, dlist_free_t func) { dlist_flush(list, func); free(list); return; } void dlist_concat(dlist_t *first, dlist_t *second) { dlist_node_t *p; assert(first != NULL); assert(first->lock == 0); assert(second != NULL); assert(second->lock == 0); dlist_assert(first); dlist_assert(second); /* if there's nothing to concatenate, then stop now */ if(second->head == NULL) return; /* update the nodes in the second list to say they are now in the first */ for(p = second->head; p != NULL; p = p->next) p->list = first; /* shift the second list's nodes into the first */ if(first->tail != NULL) { first->tail->next = second->head; second->head->prev = first->tail; first->tail = second->tail; first->length += second->length; } else { first->head = second->head; first->tail = second->tail; first->length = second->length; } /* reset the second list */ second->length = 0; second->head = NULL; second->tail = NULL; return; } void dlist_node_head_push(dlist_t *list, dlist_node_t *node) { assert(list != NULL); assert(list->lock == 0); assert(node != NULL); dlist_assert(list); /* eject the node from whatever list it is currently on */ dlist_node_eject(node->list, node); /* if we don't have a head node, we don't have a tail node set either */ if(list->head == NULL) { list->tail = node; } else { list->head->prev = node; } /* the current head node will be second on the list */ node->next = list->head; node->list = list; list->head = node; list->length++; dlist_assert(list); return; } void dlist_node_tail_push(dlist_t *list, dlist_node_t *node) { assert(list != NULL); assert(list->lock == 0); assert(node != NULL); dlist_assert(list); /* eject the node from whatever list it is currently on */ dlist_node_eject(node->list, node); /* if we don't have a tail node, we don't have a head node set either */ if(list->tail == NULL) { list->head = node; } else { list->tail->next = node; } /* the current tail node will be second to last on the list */ node->prev = list->tail; node->list = list; list->tail = node; list->length++; dlist_assert(list); return; } #ifndef DMALLOC dlist_node_t *dlist_head_push(dlist_t *list, void *item) #else dlist_node_t *dlist_head_push_dm(dlist_t *list, void *item, const char *file, const int line) #endif { dlist_node_t *node; assert(list != NULL); assert(list->lock == 0); #ifndef DMALLOC if((node = dlist_node(item, NULL, NULL)) != NULL) #else if((node = dlist_node(item, NULL, NULL, file, line)) != NULL) #endif { dlist_node_head_push(list, node); } return node; } #ifndef DMALLOC dlist_node_t *dlist_tail_push(dlist_t *list, void *item) #else dlist_node_t *dlist_tail_push_dm(dlist_t *list, void *item, const char *file, const int line) #endif { dlist_node_t *node; assert(list != NULL); assert(list->lock == 0); #ifndef DMALLOC if((node = dlist_node(item, NULL, NULL)) != NULL) #else if((node = dlist_node(item, NULL, NULL, file, line)) != NULL) #endif { dlist_node_tail_push(list, node); } return node; } void *dlist_head_pop(dlist_t *list) { dlist_node_t *node; void *item; assert(list != NULL); assert(list->lock == 0); dlist_assert(list); if(list->head == NULL) { return NULL; } node = list->head; item = node->item; /* * if we have a non-null node to replace the head with, null its prev * pointer as the node is now at the head of the list */ if((list->head = node->next) != NULL) { list->head->prev = NULL; } else { /* no nodes left in list */ list->tail = NULL; } free(node); list->length--; if(list->onremove != NULL) list->onremove(item); dlist_assert(list); return item; } void *dlist_tail_pop(dlist_t *list) { dlist_node_t *node; void *item; assert(list != NULL); assert(list->lock == 0); dlist_assert(list); if(list->head == NULL) { return NULL; } node = list->tail; item = node->item; list->tail = node->prev; if(list->tail != NULL) { list->tail->next = NULL; } if(list->head == node) { list->head = NULL; } free(node); list->length--; if(list->onremove != NULL) list->onremove(item); dlist_assert(list); return item; } /* * dlist_node_detach * * a node is on a list. detach it from the list, but do not free the * node. */ static void dlist_node_detach(dlist_t *list, dlist_node_t *node) { assert(node != NULL); assert(list == NULL || list->lock == 0); assert(node->list == list); /* if the node is in the list, then we have to detach it */ if(node->prev != NULL || node->next != NULL || (list != NULL && list->head == node)) { if(list != NULL) { if(list->head == node) list->head = node->next; if(list->tail == node) list->tail = node->prev; list->length--; } if(node->prev != NULL) node->prev->next = node->next; if(node->next != NULL) node->next->prev = node->prev; /* node has been detached, reset its pointers */ node->next = NULL; node->prev = NULL; node->list = NULL; } return; } /* * dlist_node_pop * */ void *dlist_node_pop(dlist_t *list, dlist_node_t *node) { void *item; assert(node != NULL); assert(node->list == list); assert(list == NULL || list->lock == 0); dlist_assert(list); dlist_node_detach(list, node); item = node->item; free(node); if(list != NULL && list->onremove != NULL) list->onremove(item); dlist_assert(list); return item; } void *dlist_node_item(const dlist_node_t *node) { assert(node != NULL); return node->item; } dlist_node_t *dlist_node_next(const dlist_node_t *node) { assert(node != NULL); return node->next; } dlist_node_t *dlist_node_prev(const dlist_node_t *node) { assert(node != NULL); return node->prev; } /* * dlist_node_eject * * remove a specified dlist_node from the list. do not actually free the * node structure itself, though. */ void dlist_node_eject(dlist_t *list, dlist_node_t *node) { assert(node != NULL); assert(list == NULL || list->lock == 0); assert(list == node->list); dlist_assert(list); dlist_node_detach(list, node); dlist_assert(list); return; } void *dlist_head_item(const dlist_t *list) { assert(list != NULL); if(list->head == NULL) return NULL; return list->head->item; } dlist_node_t *dlist_head_node(const dlist_t *list) { assert(list != NULL); return list->head; } void *dlist_tail_item(const dlist_t *list) { assert(list != NULL); if(list->tail == NULL) return NULL; return list->tail->item; } int dlist_foreach(dlist_t *list, const dlist_foreach_t func, void *param) { dlist_node_t *node, *next; assert(list != NULL); assert(func != NULL); dlist_lock(list); dlist_assert(list); node = list->head; while(node != NULL) { next = node->next; if(func(node->item, param) != 0) { dlist_unlock(list); return -1; } node = next; } dlist_assert(list); dlist_unlock(list); return 0; } int dlist_count(const dlist_t *list) { assert(list != NULL); dlist_assert(list); return list->length; } static void dlist_swap(dlist_node_t **a, int i, int j) { dlist_node_t *item = a[i]; a[i] = a[j]; a[j] = item; return; } static dlist_node_t **dlist_node_array(const dlist_t *list) { dlist_node_t **v = NULL, *n; int i = 0; assert(list->length >= 2); if((v = malloc(sizeof(dlist_node_t *) * list->length)) == NULL) return NULL; for(n = list->head; n != NULL; n = n->next) v[i++] = n; assert(i == list->length); return v; } static void dlist_rebuild(dlist_t *list, dlist_node_t **v) { int i; list->head = v[0]; list->tail = v[list->length-1]; list->tail->next = NULL; list->head->prev = NULL; for(i=0; ilength; i++) { if(i > 0) v[i]->prev = v[i-1]; if(i < list->length-1) v[i]->next = v[i+1]; } dlist_assert(list); return; } /* * dlist_qsort_3: * * recursive function that implements quicksort with a three-way partition * on an array of slist_node_t structures. */ static void dlist_qsort_3(dlist_node_t **a, dlist_cmp_t cmp, int l, int r) { dlist_node_t *c; int i, lt, gt, rc; if(l >= r) return; c = a[l]; lt = l; gt = r; i = l; while(i <= gt) { rc = a[i]->item != c->item ? cmp(a[i]->item, c->item) : 0; if(rc < 0) dlist_swap(a, lt++, i++); else if(rc > 0) dlist_swap(a, i, gt--); else i++; } dlist_qsort_3(a, cmp, l, lt-1); dlist_qsort_3(a, cmp, gt+1, r); return; } int dlist_qsort(dlist_t *list, dlist_cmp_t cmp) { dlist_node_t **v; dlist_assert(list); assert(list->lock == 0); /* don't have to order the list if there less than two items in it */ if(list->length < 2) return 0; if((v = dlist_node_array(list)) == NULL) return -1; dlist_qsort_3(v, cmp, 0, list->length-1); dlist_rebuild(list, v); free(v); dlist_assert_sort(list, cmp); return 0; } int dlist_shuffle(dlist_t *list) { dlist_node_t **v; dlist_assert(list); assert(list->lock == 0); if(list->length < 2) return 0; if((v = dlist_node_array(list)) == NULL) return -1; shuffle_array((void **)v, list->length); dlist_rebuild(list, v); free(v); return 0; } #if !defined(NDEBUG) && defined(MJLLIST_DEBUG) static void clist_assert(const clist_t *list) { clist_node_t *node; int i; if(list == NULL) return; assert(list->length >= 0); if(list->length == 0) { assert(list->head == NULL); } else if(list->length == 1) { assert(list->head != NULL); assert(list->head->next == list->head); assert(list->head->prev == list->head); } else { i = 1; node = list->head; while(i < list->length) { assert(node != NULL); assert(node->next != NULL); assert(node->next->prev == node); node = node->next; i++; } assert(node->next == list->head); } return; } #else #define clist_assert(list)((void)0) #endif #ifndef DMALLOC clist_t *clist_alloc(void) #else clist_t *clist_alloc_dm(const char *file, const int line) #endif { clist_t *list; size_t len = sizeof(clist_t); #ifndef DMALLOC list = malloc(len); #else list = dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(list != NULL) { clist_init(list); } return list; } void clist_init(clist_t *list) { assert(list != NULL); list->head = NULL; list->length = 0; list->lock = 0; list->onremove = NULL; return; } void clist_onremove(clist_t *list, clist_onremove_t onremove) { assert(list != NULL); list->onremove = onremove; return; } void clist_lock(clist_t *list) { assert(list != NULL); list->lock++; return; } void clist_unlock(clist_t *list) { assert(list != NULL); assert(list->lock > 0); list->lock--; return; } int clist_islocked(clist_t *list) { assert(list != NULL); return list->lock == 0 ? 0 : 1; } static void clist_flush(clist_t *list, clist_free_t free_func) { clist_node_t *node; clist_node_t *next; assert(list != NULL); clist_assert(list); if((node = list->head) == NULL) return; /* break the circle */ list->head->prev->next = NULL; /* delete all the nodes */ while(node != NULL) { next = node->next; if(list->onremove) list->onremove(node->item); if(free_func != NULL) free_func(node->item); free(node); node = next; } return; } void clist_free(clist_t *list) { clist_flush(list, NULL); free(list); return; } void clist_free_cb(clist_t *list, clist_free_t func) { clist_flush(list, func); free(list); return; } #ifndef DMALLOC clist_node_t *clist_tail_push(clist_t *list, void *item) #else clist_node_t *clist_tail_push_dm(clist_t *list, void *item, const char *file, const int line) #endif { clist_node_t *node, *tail; size_t len = sizeof(clist_node_t); assert(list != NULL); clist_assert(list); #ifndef DMALLOC node = malloc(len); #else node = dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(node == NULL) { return NULL; } node->item = item; if(list->head != NULL) { tail = list->head->prev; node->prev = tail; node->next = list->head; tail->next = node; list->head->prev = node; } else { list->head = node; node->prev = node->next = node; } list->length++; clist_assert(list); return node; } clist_node_t *clist_head_push(clist_t *list, void *item) { clist_node_t *node; assert(list != NULL); if((node = clist_tail_push(list, item)) != NULL) { list->head = node; } return node; } void *clist_head_item(const clist_t *list) { assert(list != NULL); if(list->head == NULL) return NULL; return list->head->item; } clist_node_t *clist_head_node(const clist_t *list) { assert(list != NULL); return list->head; } void *clist_tail_item(const clist_t *list) { assert(list != NULL); if(list->head == NULL) return NULL; return list->head->prev->item; } void *clist_node_pop(clist_t *list, clist_node_t *node) { void *item; assert(list != NULL); assert(list->lock == 0); clist_assert(list); item = node->item; if(node == node->prev) { list->head = NULL; } else { if(list->head == node) { list->head = node->next; } node->prev->next = node->next; node->next->prev = node->prev; } free(node); list->length--; if(list->onremove != NULL) list->onremove(item); clist_assert(list); return item; } void *clist_tail_pop(clist_t *list) { assert(list != NULL); if(list->head == NULL) { return NULL; } return clist_node_pop(list, list->head->prev); } void *clist_head_pop(clist_t *list) { assert(list != NULL); if(list->head == NULL) { return NULL; } return clist_node_pop(list, list->head); } void *clist_node_item(const clist_node_t *node) { assert(node != NULL); return node->item; } clist_node_t *clist_node_next(const clist_node_t *node) { assert(node != NULL); return node->next; } clist_node_t *clist_head_left(clist_t *list) { assert(list != NULL); if(list->head == NULL) { return NULL; } list->head = list->head->prev; return list->head; } clist_node_t *clist_head_right(clist_t *list) { assert(list != NULL); if(list->head == NULL) { return NULL; } list->head = list->head->next; return list->head; } int clist_foreach(clist_t *list, const clist_foreach_t func, void *param) { clist_node_t *node; clist_node_t *next; assert(list != NULL); clist_lock(list); clist_assert(list); node = list->head; if(node == NULL) { clist_unlock(list); return 0; } for(;;) { next = node->next; if(func(node->item, param) != 0) { clist_unlock(list); return -1; } if(next != list->head) { node = next; } else break; } clist_assert(list); clist_unlock(list); return 0; } int clist_count(const clist_t *list) { assert(list != NULL); clist_assert(list); return list->length; } scamper-cvs-20171204/mjl_list.h000644 001751 000000 00000017064 13175153547 016124 0ustar00mjlwheel000000 000000 /* * linked list routines * by Matthew Luckie * * Copyright (C) 2004-2013 Matthew Luckie. 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 Matthew Luckie ``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 Matthew Luckie 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. * * $Id: mjl_list.h,v 1.40 2017/10/28 19:15:51 mjl Exp $ * */ #ifndef __MJL_LIST_H #define __MJL_LIST_H typedef struct slist slist_t; typedef struct dlist dlist_t; typedef struct clist clist_t; typedef struct slist_node slist_node_t; typedef struct dlist_node dlist_node_t; typedef struct clist_node clist_node_t; typedef int (*slist_foreach_t)(void *item, void *param); typedef int (*dlist_foreach_t)(void *item, void *param); typedef int (*clist_foreach_t)(void *item, void *param); typedef void (*slist_onremove_t)(void *item); typedef void (*dlist_onremove_t)(void *item); typedef void (*clist_onremove_t)(void *item); typedef int (*slist_cmp_t)(const void *a, const void *b); typedef int (*dlist_cmp_t)(const void *a, const void *b); typedef void (*slist_free_t)(void *item); typedef void (*dlist_free_t)(void *item); typedef void (*clist_free_t)(void *item); #ifndef DMALLOC slist_t *slist_alloc(void); slist_t *slist_dup(slist_t *list, const slist_foreach_t func, void *param); slist_node_t *slist_head_push(slist_t *list, void *item); slist_node_t *slist_tail_push(slist_t *list, void *item); #endif #ifdef DMALLOC slist_t *slist_alloc_dm(const char *file, const int line); slist_t *slist_dup_dm(slist_t *oldlist,const slist_foreach_t func,void *param, const char *file, const int line); slist_node_t *slist_head_push_dm(slist_t *list, void *item, const char *file, const int line); slist_node_t *slist_tail_push_dm(slist_t *list, void *item, const char *file, const int line); #define slist_alloc() slist_alloc_dm(__FILE__, __LINE__) #define slist_dup(old,func,param) slist_dup_dm((old), (func), (param), \ __FILE__, __LINE__) #define slist_head_push(list, item) slist_head_push_dm((list), (item), \ __FILE__, __LINE__) #define slist_tail_push(list, item) slist_tail_push_dm((list), (item), \ __FILE__, __LINE__) #endif void slist_init(slist_t *list); void slist_onremove(slist_t *list, slist_onremove_t onremove); void slist_concat(slist_t *first, slist_t *second); void *slist_head_pop(slist_t *list); void *slist_head_item(const slist_t *list); void *slist_tail_item(const slist_t *list); void *slist_node_item(const slist_node_t *node); slist_node_t *slist_head_node(const slist_t *list); slist_node_t *slist_tail_node(const slist_t *list); slist_node_t *slist_node_next(const slist_node_t *node); int slist_foreach(slist_t *list, const slist_foreach_t func, void *param); int slist_count(const slist_t *list); int slist_qsort(slist_t *list, slist_cmp_t func); int slist_shuffle(slist_t *list); void slist_lock(slist_t *list); void slist_unlock(slist_t *list); int slist_islocked(slist_t *list); void slist_empty(slist_t *list); void slist_empty_cb(slist_t *list, slist_free_t func); void slist_free(slist_t *list); void slist_free_cb(slist_t *list, slist_free_t func); #ifndef DMALLOC dlist_t *dlist_alloc(void); dlist_node_t *dlist_node_alloc(void *item); dlist_node_t *dlist_head_push(dlist_t *list, void *item); dlist_node_t *dlist_tail_push(dlist_t *list, void *item); #else dlist_t *dlist_alloc_dm(const char *file, const int line); dlist_node_t *dlist_node_alloc_dm(void *item,const char *file,const int line); dlist_node_t *dlist_head_push_dm(dlist_t *list, void *item, const char *file, const int line); dlist_node_t *dlist_tail_push_dm(dlist_t *list, void *item, const char *file, const int line); #define dlist_alloc() dlist_alloc_dm(__FILE__, __LINE__) #define dlist_node_alloc(item) dlist_node_alloc_dm((item), __FILE__, __LINE__) #define dlist_head_push(list,item) dlist_head_push_dm((list), (item), \ __FILE__, __LINE__) #define dlist_tail_push(list,item) dlist_tail_push_dm((list), (item), \ __FILE__, __LINE__) #endif void dlist_init(dlist_t *list); void dlist_onremove(dlist_t *list, dlist_onremove_t onremove); void dlist_concat(dlist_t *first, dlist_t *second); void *dlist_head_pop(dlist_t *list); void *dlist_tail_pop(dlist_t *list); void *dlist_head_item(const dlist_t *list); void *dlist_tail_item(const dlist_t *list); void *dlist_node_pop(dlist_t *list, dlist_node_t *node); void *dlist_node_item(const dlist_node_t *node); dlist_node_t *dlist_head_node(const dlist_t *list); dlist_node_t *dlist_node_next(const dlist_node_t *node); dlist_node_t *dlist_node_prev(const dlist_node_t *node); void dlist_node_eject(dlist_t *list, dlist_node_t *node); void dlist_node_head_push(dlist_t *list, dlist_node_t *node); void dlist_node_tail_push(dlist_t *list, dlist_node_t *node); int dlist_foreach(dlist_t *list, const dlist_foreach_t func, void *param); int dlist_count(const dlist_t *list); int dlist_qsort(dlist_t *list, dlist_cmp_t func); int dlist_shuffle(dlist_t *list); void dlist_lock(dlist_t *list); void dlist_unlock(dlist_t *list); int dlist_islocked(dlist_t *list); void dlist_empty(dlist_t *list); void dlist_empty_cb(dlist_t *list, dlist_free_t func); void dlist_free(dlist_t *list); void dlist_free_cb(dlist_t *list, dlist_free_t func); #ifndef DMALLOC clist_t *clist_alloc(void); clist_node_t *clist_tail_push(clist_t *list, void *item); #else clist_t *clist_alloc_dm(const char *file, const int line); clist_node_t *clist_tail_push_dm(clist_t *list, void *item, const char *file, const int line); #define clist_alloc() clist_alloc_dm(__FILE__, __LINE__) #define clist_tail_push(list,item) clist_tail_push_dm((list), (item), \ __FILE__, __LINE__) #endif void clist_init(clist_t *list); void clist_onremove(clist_t *list, clist_onremove_t onremove); clist_node_t *clist_head_node(const clist_t *list); clist_node_t *clist_head_push(clist_t *list, void *item); void *clist_head_pop(clist_t *list); void *clist_tail_pop(clist_t *list); void *clist_head_item(const clist_t *list); void *clist_tail_item(const clist_t *list); void *clist_node_pop(clist_t *list, clist_node_t *node); void *clist_node_item(const clist_node_t *node); clist_node_t *clist_node_next(const clist_node_t *node); clist_node_t *clist_head_left(clist_t *node); clist_node_t *clist_head_right(clist_t *node); int clist_foreach(clist_t *list, const clist_foreach_t func, void *param); int clist_count(const clist_t *list); void clist_lock(clist_t *list); void clist_unlock(clist_t *list); int clist_islocked(clist_t *list); void clist_free(clist_t *list); void clist_free_cb(clist_t *list, clist_free_t func); #endif scamper-cvs-20171204/mjl_patricia.c000644 001751 000000 00000021706 12760012756 016731 0ustar00mjlwheel000000 000000 /* * mjl_patricia * * Adapted from the patricia trie in "Robert Sedgewick's Algorithms in C++" * and from the Java implementation by Josh Hentosh and Robert Sedgewick. * * Copyright (C) 2016 Matthew Luckie. 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 Matthew Luckie ``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 Matthew Luckie 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. * * $Id: mjl_patricia.c,v 1.3 2016/08/26 10:11:58 mjl Exp $ * */ #ifndef lint static const char rcsid[] = "$Id: mjl_patricia.c,v 1.3 2016/08/26 10:11:58 mjl Exp $"; #endif #include #include #if defined(DMALLOC) #include #endif #include "mjl_patricia.h" struct patricia { patricia_node_t *head; patricia_bit_t bit; patricia_cmp_t cmp; patricia_fbd_t fbd; int count; }; struct patricia_node { void *item; int bit; patricia_node_t *left; patricia_node_t *right; }; void *patricia_find(const patricia_t *trie, const void *item) { patricia_node_t *p, *x = trie->head; do { p = x; if(x->bit != 0 && trie->bit(item, x->bit) == 0) x = x->left; else x = x->right; } while(p->bit < x->bit); if(x->item != NULL && trie->cmp(item, x->item) == 0) return x->item; return NULL; } #ifndef DMALLOC patricia_node_t *patricia_insert(patricia_t *trie, void *item) #else patricia_node_t *patricia_insert_dm(patricia_t *trie, void *item, const char *file, const int line) #endif { patricia_node_t *t, *p, *x = trie->head; size_t len; int b; do { p = x; if(x->bit != 0 && trie->bit(item, x->bit) == 0) x = x->left; else x = x->right; } while(p->bit < x->bit); b = 0; if(x->item != NULL) { /* cannot insert the item if it is already in the trie */ if(trie->cmp(item, x->item) == 0) return NULL; /* * find the left most bit position where the two items differ * * note: trie->fbd should return the same as the following * computation. * * while(trie->bit(x->item, b) == trie->bit(item, b)) * b++; * */ b = trie->fbd(x->item, item); } /* travel down the trie to that point */ x = trie->head; do { p = x; if(x->bit != 0 && trie->bit(item, x->bit) == 0) x = x->left; else x = x->right; } while(p->bit < x->bit && x->bit < b); /* insert a new node at this point */ len = sizeof(patricia_node_t); #ifndef DMALLOC t = malloc(len); #else t = dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(t == NULL) return NULL; t->item = item; t->bit = b; if(t->bit != 0 && trie->bit(item, t->bit) == 0) { t->left = t; t->right = x; } else { t->left = x; t->right = t; } if(p->bit != 0 && trie->bit(item, p->bit) == 0) p->left = t; else p->right = t; trie->count++; return t; } static int patricia_gpx_node(patricia_t *trie, patricia_node_t *node, patricia_node_t **g, patricia_node_t **p, patricia_node_t **x) { *p = trie->head; *x = trie->head; do { *g = *p; *p = *x; if((*x)->bit != 0 && trie->bit(node->item, (*x)->bit) == 0) *x = (*x)->left; else *x = (*x)->right; } while((*p)->bit < (*x)->bit); if(node != *x) return 0; return 1; } static int patricia_gpx_item(patricia_t *trie, const void *item, patricia_node_t **g, patricia_node_t **p, patricia_node_t **x) { *p = trie->head; *x = trie->head; do { *g = *p; *p = *x; if((*x)->bit != 0 && trie->bit(item, (*x)->bit) == 0) *x = (*x)->left; else *x = (*x)->right; } while((*p)->bit < (*x)->bit); if((*x)->item == NULL || trie->cmp((*x)->item, item) != 0) return 0; return 1; } static void patricia_gpx_remove(patricia_t *trie, patricia_node_t *g, patricia_node_t *p, patricia_node_t *x) { patricia_node_t *z, *y, *c; y = trie->head; do { z = y; if(y->bit != 0 && trie->bit(x->item, y->bit) == 0) y = y->left; else y = y->right; } while(y != x); if(x == p) { if(x->bit != 0 && trie->bit(x->item, x->bit) == 0) c = x->right; else c = x->left; if(z->bit != 0 && trie->bit(x->item, z->bit) == 0) z->left = c; else z->right = c; } else { if(p->bit != 0 && trie->bit(x->item, p->bit) == 0) c = p->right; else c = p->left; if(g->bit != 0 && trie->bit(x->item, g->bit) == 0) g->left = c; else g->right = c; if(z->bit != 0 && trie->bit(x->item, z->bit) == 0) z->left = p; else z->right = p; p->left = x->left; p->right = x->right; p->bit = x->bit; } /* when the trie is empty, reset it to how it was at initialisation */ if(--trie->count == 0) { trie->head->left = trie->head; trie->head->right = trie->head; trie->head->bit = 0; trie->head->item = NULL; } /* don't need the node structure anymore, so free it */ free(x); if(trie->head->left == x) trie->head->left = trie->head; if(trie->head->right == x) trie->head->right = trie->head; return; } int patricia_remove_node(patricia_t *trie, patricia_node_t *node) { patricia_node_t *g, *p, *x; if(patricia_gpx_node(trie, node, &g, &p, &x) == 0) return -1; patricia_gpx_remove(trie, g, p, x); return 0; } int patricia_remove_item(patricia_t *trie, const void *item) { patricia_node_t *g, *p, *x; if(patricia_gpx_item(trie, item, &g, &p, &x) == 0) return -1; patricia_gpx_remove(trie, g, p, x); return 0; } int patricia_count(const patricia_t *trie) { if(trie == NULL) return -1; return trie->count; } #ifndef DMALLOC patricia_t *patricia_alloc(patricia_bit_t bit, patricia_cmp_t cmp, patricia_fbd_t fbd) #else patricia_t *patricia_alloc_dm(patricia_bit_t bit, patricia_cmp_t cmp, patricia_fbd_t fbd, const char *file, const int line) #endif { patricia_t *trie = NULL; size_t len; /* * allocate the patricia trie data structure */ len = sizeof(patricia_t); #ifndef DMALLOC trie = malloc(len); #else trie = dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(trie == NULL) goto err; trie->bit = bit; trie->cmp = cmp; trie->fbd = fbd; trie->count = 0; /* * allocate an initial head node for the patricia trie */ len = sizeof(patricia_node_t); #ifndef DMALLOC trie->head = malloc(len); #else trie->head = dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(trie->head == NULL) goto err; trie->head->left = trie->head; trie->head->right = trie->head; trie->head->bit = 0; trie->head->item = NULL; return trie; err: if(trie != NULL) patricia_free(trie); return NULL; } /* * patricia_free_rec * * implementation by trial and error */ static void patricia_free_rec(patricia_t *trie, patricia_node_t *node, patricia_free_t free_cb) { patricia_node_t *tmp; if(node != node->left && node->left != NULL && (node->bit <= node->left->bit || node->left->bit == 0)) { tmp = node->left; node->left = NULL; patricia_free_rec(trie, tmp, free_cb); } if(node != node->right && node->right != NULL && (node->bit <= node->right->bit || node->right->bit == 0)) { tmp = node->right; node->right = NULL; patricia_free_rec(trie, tmp, free_cb); } if(node != trie->head) { if(free_cb != NULL) free_cb(node->item); free(node); } return; } void patricia_free_cb(patricia_t *trie, patricia_free_t free_cb) { if(trie == NULL) return; if(trie->head != NULL) { patricia_free_rec(trie, trie->head->left, free_cb); if(trie->head->right != trie->head->left && trie->head->right != NULL) patricia_free_rec(trie, trie->head->right, free_cb); free(trie->head); } free(trie); return; } void patricia_free(patricia_t *trie) { patricia_free_cb(trie, NULL); return; } scamper-cvs-20171204/mjl_patricia.h000644 001751 000000 00000005346 12760012756 016740 0ustar00mjlwheel000000 000000 /* * mjl_patricia * * Copyright (C) 2016 Matthew Luckie. 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 Matthew Luckie ``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 Matthew Luckie 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. * * $Id: mjl_patricia.h,v 1.3 2016/08/26 10:11:58 mjl Exp $ * */ #ifndef MJL_PATRICIA_H #define MJL_PATRICIA_H typedef struct patricia_node patricia_node_t; typedef struct patricia patricia_t; typedef int (*patricia_bit_t)(const void *item, int bit); typedef int (*patricia_cmp_t)(const void *a, const void *b); typedef int (*patricia_fbd_t)(const void *a, const void *b); typedef void (*patricia_free_t)(void *item); void *patricia_find(const patricia_t *trie, const void *item); int patricia_remove_node(patricia_t *trie, patricia_node_t *node); int patricia_remove_item(patricia_t *trie, const void *item); int patricia_count(const patricia_t *trie); #ifndef DMALLOC patricia_node_t *patricia_insert(patricia_t *trie, void *item); patricia_t *patricia_alloc(patricia_bit_t bit, patricia_cmp_t cmp, patricia_fbd_t fbd); #else patricia_t *patricia_alloc_dm(patricia_bit_t bit, patricia_cmp_t cmp, patricia_fbd_t fbd, const char *file, const int line); patricia_node_t *patricia_insert_dm(patricia_t *trie, void *item, const char *file, const int line); #define patricia_alloc(bit,cmp,fbd) patricia_alloc_dm((bit),(cmp),(fbd), \ __FILE__, __LINE__) #define patricia_insert(trie,item) patricia_insert_dm((trie), (item), \ __FILE__, __LINE__) #endif void patricia_free_cb(patricia_t *trie, patricia_free_t free_cb); void patricia_free(patricia_t *trie); #endif /* MJL_PATRICIA_H */ scamper-cvs-20171204/mjl_prefixtree.c000644 001751 000000 00000047416 13130623030 017301 0ustar00mjlwheel000000 000000 /* * mjl_prefixtree * * Adapted from Dave Plonka's Net::Patricia, which includes material * from MRT. Some of the variables are named as they are in * mjl_patricia for clarity with that code. The main improvements are * in the bit testing, which uses a method shared with bit testing in * mjl_patricia. Note, we cannot use a generic Patricia Trie to do * longest matching prefix lookup, hence this tree. * * Copyright (C) 2016 Matthew Luckie. 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 Matthew Luckie ``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 Matthew Luckie 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. * * $Id: mjl_prefixtree.c,v 1.11 2017/07/10 07:00:40 mjl Exp $ * */ #ifndef lint static const char rcsid[] = "$Id: mjl_prefixtree.c,v 1.11 2017/07/10 07:00:40 mjl Exp $"; #endif #include #include #include #include #include #include #include #if defined(DMALLOC) #include #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(__sun__) # define s6_addr32 _S6_un._S6_u32 #elif !defined(s6_addr32) # define s6_addr32 __u6_addr.__u6_addr32 #endif #include "mjl_prefixtree.h" struct prefixtree_node { union { prefix4_t *v4; prefix6_t *v6; void *raw; } pref; prefixtree_node_t *parent; prefixtree_node_t *left; prefixtree_node_t *right; int bit; }; struct prefixtree { prefixtree_node_t *head; int v; }; static const uint32_t uint32_netmask[] = { 0x80000000, 0xc0000000, 0xe0000000, 0xf0000000, 0xf8000000, 0xfc000000, 0xfe000000, 0xff000000, 0xff800000, 0xffc00000, 0xffe00000, 0xfff00000, 0xfff80000, 0xfffc0000, 0xfffe0000, 0xffff0000, 0xffff8000, 0xffffc000, 0xffffe000, 0xfffff000, 0xfffff800, 0xfffffc00, 0xfffffe00, 0xffffff00, 0xffffff80, 0xffffffc0, 0xffffffe0, 0xfffffff0, 0xfffffff8, 0xfffffffc, 0xfffffffe, 0xffffffff, }; #ifdef _WIN32 static const uint16_t uint16_mask[] = { 0x8000, 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, 0xffc0, 0xffe0, 0xfff0, 0xfff8, 0xfffc, 0xfffe, 0xffff, }; #endif #ifndef DMALLOC prefix4_t *prefix4_alloc(struct in_addr *net, uint8_t len, void *ptr) #else prefix4_t *prefix4_alloc_dm(struct in_addr *net, uint8_t len, void *ptr, const char *file, const int line) #endif { prefix4_t *p; #ifndef DMALLOC p = malloc(sizeof(prefix4_t)); #else p = dmalloc_malloc(file, line, sizeof(prefix4_t), DMALLOC_FUNC_MALLOC, 0, 0); #endif if(p == NULL) return NULL; p->net.s_addr = net->s_addr; p->len = len; p->ptr = ptr; return p; } #ifndef DMALLOC prefix4_t *prefix4_dup(const prefix4_t *item) #else prefix4_t *prefix4_dup_dm(const prefix4_t *item, const char *file, const int line) #endif { prefix4_t *dup; #ifndef DMALLOC dup = malloc(sizeof(prefix4_t)); #else dup = dmalloc_malloc(file,line,sizeof(prefix4_t), DMALLOC_FUNC_MALLOC, 0, 0); #endif if(dup == NULL) return NULL; memcpy(dup, item, sizeof(prefix4_t)); dup->ptr = NULL; return dup; } void prefix4_free(prefix4_t *pref) { free(pref); return; } int prefix4_cmp(const prefix4_t *a, const prefix4_t *b) { uint32_t ua = ntohl(a->net.s_addr); uint32_t ub = ntohl(b->net.s_addr); if(ua < ub) return -1; if(ua > ub) return 1; if(a->len < b->len) return -1; if(a->len > b->len) return 1; return 0; } #ifndef DMALLOC prefix6_t *prefix6_alloc(struct in6_addr *net, uint8_t len, void *ptr) #else prefix6_t *prefix6_alloc_dm(struct in6_addr *net, uint8_t len, void *ptr, const char *file, const int line) #endif { prefix6_t *p; #ifndef DMALLOC p = malloc(sizeof(prefix6_t)); #else p = dmalloc_malloc(file, line, sizeof(prefix6_t), DMALLOC_FUNC_MALLOC, 0, 0); #endif if(p == NULL) return NULL; memcpy(&p->net, net, sizeof(struct in6_addr)); p->len = len; p->ptr = ptr; return p; } #ifndef DMALLOC prefix6_t *prefix6_dup(const prefix6_t *item) #else prefix6_t *prefix6_dup_dm(const prefix6_t *item, const char *file, const int line) #endif { prefix6_t *dup; #ifndef DMALLOC dup = malloc(sizeof(prefix6_t)); #else dup = dmalloc_malloc(file,line,sizeof(prefix6_t), DMALLOC_FUNC_MALLOC, 0, 0); #endif if(dup == NULL) return NULL; memcpy(dup, item, sizeof(prefix6_t)); dup->ptr = NULL; return dup; } void prefix6_free(prefix6_t *pref) { free(pref); return; } int prefix6_cmp(const prefix6_t *a, const prefix6_t *b) { int i; #ifndef _WIN32 uint32_t ua, ub; for(i=0; i<4; i++) { ua = ntohl(a->net.s6_addr32[i]); ub = ntohl(b->net.s6_addr32[i]); if(ua < ub) return -1; if(ua > ub) return 1; } #else uint16_t ua, ub; for(i=0; i<8; i++) { ua = ntohs(a->net.u.Word[i]); ub = ntohs(b->net.u.Word[i]); if(ua < ub) return -1; if(ua > ub) return 1; } #endif if(a->len < b->len) return -1; if(a->len > b->len) return 1; return 0; } #ifndef DMALLOC static prefixtree_node_t *prefixtree_node_alloc(void *pref, int bit) #else static prefixtree_node_t *prefixtree_node_alloc_dm(void *pref, int bit, const char *file, const int line) #endif { prefixtree_node_t *n; #ifndef DMALLOC n = malloc(sizeof(prefixtree_node_t)); #else n = dmalloc_malloc(file,line,sizeof(prefixtree_node_t), DMALLOC_FUNC_MALLOC, 0, 0); #endif if(n == NULL) return NULL; n->pref.raw = pref; n->bit = bit; n->parent = n->left = n->right = NULL; return n; } static int ip4_bit(const struct in_addr *ip, int bit) { assert(bit >= 0); assert(bit < 32); return (ntohl(ip->s_addr) >> (31 - bit)) & 1; } static int ip6_bit(const struct in6_addr *ip, int bit) { assert(bit >= 0); assert(bit < 128); #ifndef _WIN32 return (ntohl(ip->s6_addr32[bit/32]) >> (32 - ((bit+1) % 32))) & 1; #else return (ntohs(ip->u.Word[bit/16]) >> (16 - ((bit+1) % 16))) & 1; #endif } static int prefix4_bit(const prefix4_t *pref, int bit) { assert(bit >= 0); assert(bit < 32); return (ntohl(pref->net.s_addr) >> (31 - bit)) & 1; } static int prefix6_bit(const prefix6_t *pref, int bit) { assert(bit >= 0); assert(bit < 128); #ifndef _WIN32 return (ntohl(pref->net.s6_addr32[bit/32]) >> (32 - ((bit+1) % 32))) & 1; #else return (ntohs(pref->net.u.Word[bit/16]) >> (16 - ((bit+1) % 16))) & 1; #endif } static int prefix4_fbd(const prefix4_t *a, const prefix4_t *b) { uint32_t v; int r; if((v = ntohl(a->net.s_addr ^ b->net.s_addr)) == 0) return 32; #ifdef HAVE___BUILTIN_CLZ r = __builtin_clz(v); #else r = 0; if(v & 0xFFFF0000) { v >>= 16; r += 16; } if(v & 0xFF00) { v >>= 8; r += 8; } if(v & 0xF0) { v >>= 4; r += 4; } if(v & 0xC) { v >>= 2; r += 2; } if(v & 0x2) { r += 1; } r = 31 - r; #endif return r; } static int prefix6_fbd(const prefix6_t *a, const prefix6_t *b) { uint32_t v; int i, r; for(i=0; i<4; i++) { if((v = ntohl(a->net.s6_addr32[i] ^ b->net.s6_addr32[i])) == 0) continue; #ifdef HAVE___BUILTIN_CLZ r = __builtin_clz(v) + (i * 32); #else r = 0; if(v & 0xFFFF0000) { v >>= 16; r += 16; } if(v & 0xFF00) { v >>= 8; r += 8; } if(v & 0xF0) { v >>= 4; r += 4; } if(v & 0xC) { v >>= 2; r += 2; } if(v & 0x2) { r += 1; } r = (31 - r) + (i * 32); #endif return r; } return 128; } static int prefix4_ip_in(const prefix4_t *p4, const struct in_addr *ip4) { assert(p4->len >= 0); assert(p4->len <= 32); if(p4->len == 0) return 1; if(((ip4->s_addr ^ p4->net.s_addr) & htonl(uint32_netmask[p4->len-1])) == 0) return 1; return 0; } static int prefix6_ip_in(const prefix6_t *p6, const struct in6_addr *ip6) { int i, len; #ifndef _WIN32 uint32_t mask; #else uint16_t mask; #endif assert(p6->len >= 0); assert(p6->len <= 128); if((len = p6->len) == 0) return 1; #ifndef _WIN32 for(i=0; i<4; i++) { /* * handle the fact that we can only check 32 bits at a time. * no need to change byte order as all bytes are the same */ if(len > 32) mask = uint32_netmask[31]; else mask = htonl(uint32_netmask[len-1]); if(((ip6->s6_addr32[i] ^ p6->net.s6_addr32[i]) & mask) != 0) return 0; if(len <= 32) return 1; len -= 32; } #else for(i=0; i<8; i++) { if(len > 16) mask = uint16_mask[15]; else mask = htons(uint16_mask[len-1]); if(((ip6->u.Word[i] ^ p6->net.u.Word[i]) & mask) != 0) return 0; if(len <= 16) return 1; len -= 16; } #endif return -1; } prefix4_t *prefixtree_find_ip4(const prefixtree_t *tree, const struct in_addr *ip4) { prefixtree_node_t *x = tree->head; prefix4_t *stack[33]; int i = 0; assert(tree->v == 4); /* go through the tree, assembling possible prefix matches */ while(x != NULL && x->bit < 32) { if(x->pref.v4 != NULL) stack[i++] = x->pref.v4; if(ip4_bit(ip4, x->bit) == 0) x = x->left; else x = x->right; } if(x != NULL && x->pref.v4 != NULL) stack[i++] = x->pref.v4; /* go from the top of the stack, looking for the longest prefix match */ while(--i >= 0) if(prefix4_ip_in(stack[i], ip4) != 0) return stack[i]; return NULL; } prefix4_t *prefixtree_find_best4(const prefixtree_t *tree, const prefix4_t *item) { prefixtree_node_t *x = tree->head; prefix4_t *stack[33]; int i = 0; assert(tree->v == 4); /* go through the tree, assembling possible prefix matches */ while(x != NULL && x->bit < item->len) { if(x->pref.v4 != NULL && x->pref.v4->len <= item->len) stack[i++] = x->pref.v4; if(ip4_bit(&item->net, x->bit) == 0) x = x->left; else x = x->right; } if(x != NULL && x->pref.v4 != NULL && x->pref.v4->len <= item->len) stack[i++] = x->pref.v4; /* * go from the top of the stack, looking for the most specific * enclosing prefix */ while(--i >= 0) if(prefix4_ip_in(stack[i], &item->net) != 0) return stack[i]; return NULL; } prefix6_t *prefixtree_find_ip6(const prefixtree_t *tree, const struct in6_addr *ip6) { prefixtree_node_t *x = tree->head; prefix6_t *stack[129]; int i = 0; assert(tree->v == 6); /* go through the tree, assembling possible prefix matches */ while(x != NULL && x->bit < 128) { if(x->pref.v6 != NULL) stack[i++] = x->pref.v6; if(ip6_bit(ip6, x->bit) == 0) x = x->left; else x = x->right; } if(x != NULL && x->pref.v6 != NULL) stack[i++] = x->pref.v6; /* go from the top of the stack, looking for the longest prefix match */ while(--i >= 0) if(prefix6_ip_in(stack[i], ip6) != 0) return stack[i]; return NULL; } prefix6_t *prefixtree_find_best6(const prefixtree_t *tree, const prefix6_t *item) { prefixtree_node_t *x = tree->head; prefix6_t *stack[129]; int i = 0; assert(tree->v == 6); /* go through the tree, assembling possible prefix matches */ while(x != NULL && x->bit < item->len) { if(x->pref.v6 != NULL && x->pref.v6->len <= item->len) stack[i++] = x->pref.v6; if(ip6_bit(&item->net, x->bit) == 0) x = x->left; else x = x->right; } if(x != NULL && x->pref.v6 != NULL && x->pref.v6->len <= item->len) stack[i++] = x->pref.v6; /* * go from the top of the stack, looking for the most specific * enclosing prefix */ while(--i >= 0) if(prefix6_ip_in(stack[i], &item->net) != 0) return stack[i]; return NULL; } #ifndef DMALLOC prefixtree_node_t *prefixtree_insert4(prefixtree_t *tree, prefix4_t *pref) #else prefixtree_node_t *prefixtree_insert4_dm(prefixtree_t *tree, prefix4_t *pref, const char *file, const int line) #endif { prefixtree_node_t *t, *g, *p, *x; struct in_addr *a; int bit, fbd; assert(tree->v == 4); if((x = tree->head) == NULL) { #ifndef DMALLOC t = prefixtree_node_alloc(pref, pref->len); #else t = prefixtree_node_alloc_dm(pref, pref->len, file, line); #endif if(t == NULL) return NULL; tree->head = t; return t; } /* go through the tree until we get to the appropriate level */ while(x->bit < pref->len || x->pref.v4 == NULL) { if(x->bit == 32 || prefix4_bit(pref, x->bit) == 0) { if(x->left == NULL) break; x = x->left; } else { if(x->right == NULL) break; x = x->right; } } if(x->bit < pref->len) bit = x->bit; else bit = pref->len; /* get the first bit different between the two prefixes */ fbd = prefix4_fbd(x->pref.v4, pref); if(fbd > bit) fbd = bit; /* * remember the address that we want to reference when inserting, * before we go up the tree */ a = &x->pref.v4->net; p = x->parent; while(p != NULL && p->bit >= fbd) { x = p; p = x->parent; } if(fbd == pref->len && x->bit == pref->len) { /* not going to insert the same prefix twice */ if(x->pref.v4 != NULL) return NULL; x->pref.v4 = pref; return x; } #ifndef DMALLOC t = prefixtree_node_alloc(pref, pref->len); #else t = prefixtree_node_alloc_dm(pref, pref->len, file, line); #endif if(t == NULL) return NULL; if(x->bit == fbd) { t->parent = x; if(x->bit == 32 || prefix4_bit(pref, x->bit) == 0) x->left = t; else x->right = t; } else if(pref->len == fbd) { if(pref->len == 32 || ip4_bit(a, pref->len) == 0) t->left = x; else t->right = x; t->parent = x->parent; if(x->parent == NULL) tree->head = t; else if(x->parent->left == x) x->parent->left = t; else x->parent->right = t; x->parent = t; } else { /* insert a new branch node (with no attached prefix) into the tree */ #ifndef DMALLOC g = prefixtree_node_alloc(NULL, fbd); #else g = prefixtree_node_alloc_dm(NULL, fbd, file, line); #endif if(g == NULL) { free(t); return NULL; } g->parent = x->parent; if(fbd == 32 || prefix4_bit(pref, fbd) == 0) { g->left = t; g->right = x; } else { g->left = x; g->right = t; } t->parent = g; if(x->parent == NULL) tree->head = g; else if(x->parent->left == x) x->parent->left = g; else x->parent->right = g; x->parent = g; } return t; } #ifndef DMALLOC prefixtree_node_t *prefixtree_insert6(prefixtree_t *tree, prefix6_t *pref) #else prefixtree_node_t *prefixtree_insert6_dm(prefixtree_t *tree, prefix6_t *pref, const char *file, const int line) #endif { prefixtree_node_t *t, *g, *p, *x; struct in6_addr *a; int bit, fbd; assert(tree->v == 6); if((x = tree->head) == NULL) { #ifndef DMALLOC t = prefixtree_node_alloc(pref, pref->len); #else t = prefixtree_node_alloc_dm(pref, pref->len, file, line); #endif if(t == NULL) return NULL; tree->head = t; return t; } /* go through the tree until we get to the appropriate level */ while(x->bit < pref->len || x->pref.v6 == NULL) { if(x->bit == 128 || prefix6_bit(pref, x->bit) == 0) { if(x->left == NULL) break; x = x->left; } else { if(x->right == NULL) break; x = x->right; } } if(x->bit < pref->len) bit = x->bit; else bit = pref->len; /* get the first bit different between the two prefixes */ fbd = prefix6_fbd(x->pref.v6, pref); if(fbd > bit) fbd = bit; /* * remember the address that we want to reference when inserting, * before we go up the tree */ a = &x->pref.v6->net; p = x->parent; while(p != NULL && p->bit >= fbd) { x = p; p = x->parent; } if(fbd == pref->len && x->bit == pref->len) { /* not going to insert the same prefix twice */ if(x->pref.v6 != NULL) return NULL; x->pref.v6 = pref; return x; } #ifndef DMALLOC t = prefixtree_node_alloc(pref, pref->len); #else t = prefixtree_node_alloc_dm(pref, pref->len, file, line); #endif if(t == NULL) return NULL; if(x->bit == fbd) { t->parent = x; if(x->bit == 128 || prefix6_bit(pref, x->bit) == 0) x->left = t; else x->right = t; } else if(pref->len == fbd) { if(pref->len == 128 || ip6_bit(a, pref->len) == 0) t->left = x; else t->right = x; t->parent = x->parent; if(x->parent == NULL) tree->head = t; else if(x->parent->left == x) x->parent->left = t; else x->parent->right = t; x->parent = t; } else { /* insert a new branch node (with no attached prefix) into the tree */ #ifndef DMALLOC g = prefixtree_node_alloc(NULL, fbd); #else g = prefixtree_node_alloc_dm(NULL, fbd, file, line); #endif if(g == NULL) { free(t); return NULL; } g->parent = x->parent; if(fbd == 128 || prefix6_bit(pref, fbd) == 0) { g->left = t; g->right = x; } else { g->left = x; g->right = t; } t->parent = g; if(x->parent == NULL) tree->head = g; else if(x->parent->left == x) x->parent->left = g; else x->parent->right = g; x->parent = g; } return t; } #ifndef DMALLOC prefixtree_t *prefixtree_alloc4(void) #else prefixtree_t *prefixtree_alloc4_dm(const char *file, const int line) #endif { prefixtree_t *tree; #ifndef DMALLOC tree = malloc(sizeof(prefixtree_t)); #else tree = dmalloc_malloc(file, line, sizeof(prefixtree_t), DMALLOC_FUNC_MALLOC, 0, 0); #endif if(tree == NULL) return NULL; tree->v = 4; tree->head = NULL; return tree; } #ifndef DMALLOC prefixtree_t *prefixtree_alloc6(void) #else prefixtree_t *prefixtree_alloc6_dm(const char *file, const int line) #endif { prefixtree_t *tree; #ifndef DMALLOC tree = malloc(sizeof(prefixtree_t)); #else tree = dmalloc_malloc(file, line, sizeof(prefixtree_t), DMALLOC_FUNC_MALLOC, 0, 0); #endif if(tree == NULL) return NULL; tree->v = 6; tree->head = NULL; return tree; } #ifndef DMALLOC prefixtree_t *prefixtree_alloc(int af) #else prefixtree_t *prefixtree_alloc_dm(int af, const char *file, const int line) #endif { #ifndef DMALLOC if(af == AF_INET) return prefixtree_alloc4(); if(af == AF_INET6) return prefixtree_alloc6(); #else if(af == AF_INET) return prefixtree_alloc4_dm(file, line); if(af == AF_INET6) return prefixtree_alloc6_dm(file, line); #endif return NULL; } static void prefixtree_free_cb2(prefixtree_node_t *node, prefix_free_t cb) { if(node->left != NULL) prefixtree_free_cb2(node->left, cb); if(node->right != NULL) prefixtree_free_cb2(node->right, cb); if(cb != NULL && node->pref.raw != NULL) cb(node->pref.raw); free(node); return; } void prefixtree_free_cb(prefixtree_t *tree, prefix_free_t cb) { if(tree == NULL) return; if(tree->head != NULL) prefixtree_free_cb2(tree->head, cb); free(tree); return; } void prefixtree_free(prefixtree_t *tree) { if(tree == NULL) return; if(tree->head != NULL) prefixtree_free_cb2(tree->head, NULL); free(tree); return; } scamper-cvs-20171204/mjl_prefixtree.h000644 001751 000000 00000011234 13004572041 017300 0ustar00mjlwheel000000 000000 /* * mjl_prefixtree * * Copyright (C) 2016 Matthew Luckie. 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 Matthew Luckie ``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 Matthew Luckie 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. * * $Id: mjl_prefixtree.h,v 1.6 2016/10/28 06:45:53 mjl Exp $ * */ #ifndef MJL_PREFIXTREE_H #define MJL_PREFIXTREE_H typedef struct prefix4 { struct in_addr net; uint8_t len; void *ptr; } prefix4_t; typedef struct prefix6 { struct in6_addr net; uint8_t len; void *ptr; } prefix6_t; typedef struct prefixtree prefixtree_t; typedef struct prefixtree_node prefixtree_node_t; typedef void (*prefix_free_t)(void *item); #ifndef DMALLOC prefixtree_t *prefixtree_alloc4(void); prefixtree_t *prefixtree_alloc6(void); prefixtree_t *prefixtree_alloc(int); #else prefixtree_t *prefixtree_alloc4_dm(const char *file, const int line); prefixtree_t *prefixtree_alloc6_dm(const char *file, const int line); prefixtree_t *prefixtree_alloc_dm(int, const char *file, const int line); #define prefixtree_alloc4() prefixtree_alloc4_dm(__FILE__, __LINE__) #define prefixtree_alloc6() prefixtree_alloc6_dm(__FILE__, __LINE__) #define prefixtree_alloc(af) prefixtree_alloc_dm((af), __FILE__, __LINE__) #endif void prefixtree_free(prefixtree_t *tree); void prefixtree_free_cb(prefixtree_t *tree, prefix_free_t cb); #ifndef DMALLOC prefixtree_node_t *prefixtree_insert4(prefixtree_t *tree, prefix4_t *item); prefixtree_node_t *prefixtree_insert6(prefixtree_t *tree, prefix6_t *item); #else prefixtree_node_t *prefixtree_insert4_dm(prefixtree_t *tree, prefix4_t *item, const char *file, const int line); prefixtree_node_t *prefixtree_insert6_dm(prefixtree_t *tree, prefix6_t *item, const char *file, const int line); #define prefixtree_insert4(tree,item) prefixtree_insert4_dm((tree), (item), \ __FILE__, __LINE__) #define prefixtree_insert6(tree,item) prefixtree_insert6_dm((tree), (item), \ __FILE__, __LINE__) #endif prefix4_t *prefixtree_find_ip4(const prefixtree_t *tree, const struct in_addr *ip4); prefix6_t *prefixtree_find_ip6(const prefixtree_t *tree, const struct in6_addr *ip6); prefix4_t *prefixtree_find_best4(const prefixtree_t *tree, const prefix4_t *item); prefix6_t *prefixtree_find_best6(const prefixtree_t *tree, const prefix6_t *item); #ifndef DMALLOC prefix4_t *prefix4_alloc(struct in_addr *net, uint8_t len, void *ptr); prefix6_t *prefix6_alloc(struct in6_addr *net, uint8_t len, void *ptr); #else prefix4_t *prefix4_alloc_dm(struct in_addr *net, uint8_t len, void *ptr, const char *file, const int line); prefix6_t *prefix6_alloc_dm(struct in6_addr *net, uint8_t len, void *ptr, const char *file, const int line); #define prefix4_alloc(net,len,ptr) prefix4_alloc_dm((net),(len),(ptr), \ __FILE__, __LINE__) #define prefix6_alloc(net,len,ptr) prefix6_alloc_dm((net),(len),(ptr), \ __FILE__, __LINE__) #endif void prefix4_free(prefix4_t *pfx); void prefix6_free(prefix6_t *pfx); int prefix4_cmp(const prefix4_t *a, const prefix4_t *b); int prefix6_cmp(const prefix6_t *a, const prefix6_t *b); #ifndef DMALLOC prefix4_t *prefix4_dup(const prefix4_t *item); prefix6_t *prefix6_dup(const prefix6_t *item); #else prefix4_t *prefix4_dup_dm(const prefix4_t *item, const char *file, const int line); prefix6_t *prefix6_dup_dm(const prefix6_t *item, const char *file, const int line); #define prefix4_dup(item) prefix4_dup_dm((item), __FILE__, __LINE__) #define prefix6_dup(item) prefix6_dup_dm((item), __FILE__, __LINE__) #endif #endif /* MJL_PREFIXTREE */ scamper-cvs-20171204/mjl_splaytree.c000644 001751 000000 00000053770 13101060272 017135 0ustar00mjlwheel000000 000000 /* * splay tree routines * By Matthew Luckie * U of Waikato 0657.317b 1999 * * Copyright (C) 1999-2017 Matthew Luckie. 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 Matthew Luckie ``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 Matthew Luckie BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #ifndef lint static const char rcsid[] = "$Id: mjl_splaytree.c,v 1.29 2017/04/29 09:45:30 mjl Exp $"; #endif #include #include #if defined(DMALLOC) #include #endif #include "mjl_splaytree.h" /* * the splay tree algorithm needs a simple stack to do the work. * the implementations of these functions is found at the bottom of this * file. */ typedef struct splaytree_stack { splaytree_node_t **nodes; int i; int c; } splaytree_stack_t; /* * splay tree node data structure * conveniently hidden from users of the splay tree. */ struct splaytree_node { void *item; splaytree_node_t *left; splaytree_node_t *right; }; struct splaytree { splaytree_node_t *head; int size; splaytree_cmp_t cmp; splaytree_stack_t *stack; splaytree_onremove_t onremove; }; static splaytree_stack_t *stack_create(void); static splaytree_node_t *stack_pop(splaytree_stack_t *stack); static void stack_destroy(splaytree_stack_t *stack); static int stack_push(splaytree_stack_t *stack, splaytree_node_t *node); static void stack_clean(splaytree_stack_t *stack); #if !defined(NDEBUG) && defined(MJLSPLAYTREE_DEBUG) static void splaytree_assert2(splaytree_t *tree, splaytree_node_t *node) { int i; if(node != NULL) { if(node->left != NULL) { i = tree->cmp(node->left->item, node->item); assert(i < 0); splaytree_assert2(tree, node->left); } if(node->right != NULL) { i = tree->cmp(node->right->item, node->item); assert(i > 0); splaytree_assert2(tree, node->right); } } return; } static void splaytree_assert(splaytree_t *tree) { splaytree_assert2(tree, tree->head); return; } #else #define splaytree_assert(tree)((void)0) #endif /* * splaytree_rotate * * perform the generic treenode-rotate algorithm. */ static void splaytree_rotate(splaytree_node_t *above, splaytree_node_t *below) { splaytree_node_t *temp; /* * above and below must be valid treenode pointers. * above must point to the below node */ assert(above != NULL); assert(below != NULL); assert(above->left == below || above->right == below); /* * check to see if the below node is to the left of the above or to * the right */ if(above->left == below) { temp = below->right; below->right = above; above->left = temp; } else { temp = below->left; below->left = above; above->right = temp; } return; } /* * splaytree_splay2 * * appropriately splay the treenodes passed in so that the child is moved * higher than the other nodes passed in */ static void splaytree_splay2(splaytree_node_t *child, splaytree_node_t *parent, splaytree_node_t *grandparent) { /* pre-condition: grandparent points to parent, parent points to child */ assert(child != NULL); assert(parent == NULL || (parent->left == child || parent->right == child)); assert(grandparent == NULL || (grandparent->left == parent || grandparent->right == parent)); /* case 0: access node is root */ if(parent == NULL) { return; } /* case 1: parent is root */ else if(grandparent == NULL) { splaytree_rotate(parent, child); } /* * case 2: zig zig - p is not the root and the child and the parent are both * left (right) children */ else if((parent->left == child && grandparent->left == parent) || (parent->right == child && grandparent->right == parent)) { splaytree_rotate(grandparent, parent); splaytree_rotate(parent, child); } /* * case 3: zig zag - p is not the root and the child is a left(right) child * and parent is a right(left) child */ else if((parent->left == child && grandparent->right == parent) || (parent->right == child && grandparent->left == parent)) { if(grandparent->left == parent) { splaytree_rotate(parent, child); grandparent->left = child; splaytree_rotate(grandparent, child); } else { splaytree_rotate(parent, child); grandparent->right = child; splaytree_rotate(grandparent, child); } } return; } /* * splaytree_splay * * coordinate the calls to splaytree_splay2. * the stack contains, in order, the path to the child so that the nodes can * be splayed. */ static void splaytree_splay(splaytree_t *tree) { splaytree_node_t *child, *parent, *grandparent, *keep; child = stack_pop(tree->stack); parent = stack_pop(tree->stack); grandparent = stack_pop(tree->stack); /* there has to be at least one entry in the stack */ assert(child != NULL); /* is there only one node in the tree */ if(parent == NULL) { tree->head = child; return; } /* splay the node */ splaytree_splay2(child, parent, grandparent); /* it was a simple swap at the root */ if(grandparent == NULL) { tree->head = child; return; } /* * remember the grandparent so that we can figure out where to relink the * splayed child to */ keep = grandparent; /* just loop and we will break out when we need to */ for(;;) { /* get the parent nodes to the child */ parent = stack_pop(tree->stack); grandparent = stack_pop(tree->stack); /* * if the child node is now at the root, break out as the splay is * complete */ if(parent == NULL) { break; } assert(parent->left == keep || parent->right == keep); /* * figure out where to relink the child to * (as the grandparent in keep is now down the tree) */ if(parent->left == keep) { parent->left = child; } else { parent->right = child; } /* splay now */ splaytree_splay2(child, parent, grandparent); if(grandparent == NULL) { break; } keep = grandparent; } /* return the new root of the tree */ tree->head = child; return; } /* * splaytree_node_alloc * * creates/mallocs a node and initialises the contents of the node ready to * insert to the tree */ #ifndef DMALLOC static splaytree_node_t *splaytree_node_alloc(const void *item) #else static splaytree_node_t *splaytree_node_alloc(const void *item, const char *file, const int line) #endif { splaytree_node_t *node; size_t len = sizeof(splaytree_node_t); #ifndef DMALLOC node = (splaytree_node_t *)malloc(len); #else node = (splaytree_node_t *)dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); #endif if(node != NULL) { node->left = NULL; node->right = NULL; node->item = (void *)item; } return node; } /* * splaytree_insert2 * * insert the item into the tree. * returns 0 if inserted, -1 on error. */ #ifndef DMALLOC static int splaytree_insert2(splaytree_t *tree, const void *item) #else static int splaytree_insert2(splaytree_t *tree, const void *item, const char *file, const int line) #endif { splaytree_node_t *tn, *node; int i; tn = tree->head; for(;;) { /* put the node into the insert path and try the next level */ if(stack_push(tree->stack, tn) != 0) return -1; /* see whether the data belongs to the left, right, or is a duplicate */ i = tree->cmp(item, tn->item); if(i < 0) { if(tn->left != NULL) { tn = tn->left; continue; } /* insert the item into the tree here */ #ifndef DMALLOC if((node = splaytree_node_alloc(item)) == NULL) #else if((node = splaytree_node_alloc(item, file, line)) == NULL) #endif return -1; if(stack_push(tree->stack, node) != 0) { free(node); return -1; } tn->left = node; break; } else if(i > 0) { if(tn->right != NULL) { tn = tn->right; continue; } #ifndef DMALLOC if((node = splaytree_node_alloc(item)) == NULL) #else if((node = splaytree_node_alloc(item, file, line)) == NULL) #endif return -1; if(stack_push(tree->stack, node) != 0) { free(node); return -1; } tn->right = node; break; } else { /* the data already exists in the tree: do not add it */ return -1; } } return 0; } /* * splaytree_insert * * insert a value into the splay tree, and return with the tree splayed on * that value. return the node of the item. * */ #ifndef DMALLOC splaytree_node_t *splaytree_insert(splaytree_t *tree, const void *item) #else splaytree_node_t *splaytree_insert_dm(splaytree_t *tree, const void *item, const char *file, const int line) #endif { assert(tree != NULL); splaytree_assert(tree); /* * if the tree actually has something in it, then we need to * find the place to insert the node and splay on that. */ if(tree->head != NULL) { stack_clean(tree->stack); /* * try and insert the item. can't insert it if an item matching this * one is already there */ #ifndef DMALLOC if(splaytree_insert2(tree, item) != 0) #else if(splaytree_insert2(tree, item, file, line) != 0) #endif { return NULL; } splaytree_splay(tree); } else { #ifndef DMALLOC if((tree->head = splaytree_node_alloc(item)) == NULL) #else if((tree->head = splaytree_node_alloc(item, file, line)) == NULL) #endif { return NULL; } } tree->size++; splaytree_assert(tree); return tree->head; } /* * splaytree_find2 * * find the node with the data item matching. returns the node, if found. */ static splaytree_node_t *splaytree_find2(splaytree_t *tree, const void *item) { splaytree_node_t *tn; int i; stack_clean(tree->stack); tn = tree->head; while(tn != NULL) { /* * try and push the node onto the stack. * if we don't then we can't splay the node to the top of the tree, so * we fail. */ if(stack_push(tree->stack, tn) != 0) return NULL; /* determine the next node to visit */ i = tree->cmp(item, tn->item); if(i < 0) tn = tn->left; else if(i > 0) tn = tn->right; else break; } /* we found it ! */ return tn; } /* * splaytree_find * * finds an item in the tree, and then splays the tree on that value */ void *splaytree_find(splaytree_t *tree, const void *item) { if(tree == NULL || tree->head == NULL) { return NULL; } splaytree_assert(tree); if(splaytree_find2(tree, item) == NULL) { return NULL; } splaytree_splay(tree); splaytree_assert(tree); return tree->head->item; } /* * splaytree_remove * * remove the first item in the splaytree */ static int splaytree_remove(splaytree_t *tree) { splaytree_node_t *node; splaytree_node_t *l, *r; splaytree_node_t *temp; node = tree->head; l = node->left; r = node->right; /* * search for the right most node in the left tree * if there are no nodes on the left hand side of the tree, then we just * need to shift the head of the tree to whatever is there on the right * of it. */ if(l != NULL) { stack_clean(tree->stack); if(stack_push(tree->stack, l) != 0) { return -1; } temp = l; while(temp->right != NULL) { if(stack_push(tree->stack, temp->right) != 0) { return -1; } temp = temp->right; } /* bring this node to the top of the tree with a splay operation */ splaytree_splay(tree); /* * as the right most node on the left branch has no nodes on the right * branch, we connect the right hand branch to it */ tree->head->right = r; } else { tree->head = r; } tree->size--; if(tree->onremove != NULL) tree->onremove(node->item); free(node); return 0; } /* * splaytree_remove_item * * remove an item from the tree that matches the particular key */ int splaytree_remove_item(splaytree_t *tree, const void *item) { /* * find the node that we are supposed to delete. * if we can't find it, then the remove operation has failed. */ if(splaytree_find2(tree, item) == NULL) { return -1; } /* * now that we've found it, splay the tree to bring the node we are to * delete to the top of the tree and then delete it. */ splaytree_splay(tree); return splaytree_remove(tree); } /* * splaytree_remove_node * * remove a specific node from the splay tree */ int splaytree_remove_node(splaytree_t *tree, splaytree_node_t *node) { /* * find the path to the node that we are supposed to delete. the node * that we find has to match what was passed in */ if(splaytree_find2(tree, node->item) != node) { return -1; } /* * now that we've found it, splay the tree to bring the node we are to * delete to the top of the tree and then delete it. */ splaytree_splay(tree); return splaytree_remove(tree); } /* * splaytree_findclosest * * find a value in the tree as close to the specified one as possible */ void *splaytree_findclosest(splaytree_t *tree, const void *item, splaytree_diff_t diff) { splaytree_node_t *ret; splaytree_node_t *first, *second; int first_diff, second_diff; if(tree == NULL || tree->head == NULL) return NULL; /* wow, the value we are looking for is actually in the tree! */ if((ret = splaytree_find2(tree, item)) != NULL) { splaytree_splay(tree); assert(ret == tree->head); return tree->head->item; } /* * we need to get the last two items off the stack and figure out which * one of the two is the closest to the one we are looking for */ first = stack_pop(tree->stack); second = stack_pop(tree->stack); /* need at least one item in the stack if tree->head != NULL */ assert(first != NULL); /* if there is only one item in the stack, splay? on it and return it */ if(second == NULL) { if(stack_push(tree->stack, first) != 0) { return NULL; } splaytree_splay(tree); return tree->head->item; } /* work out which one is closer to the value we are looking for */ first_diff = abs(diff(first->item, item)); second_diff = abs(diff(second->item, item)); /* * if the first item is closer than the second, put the first back on the * stack and the splay on that * else put them both back on and splay on that */ if(second_diff > first_diff) { if(stack_push(tree->stack, second) != 0) { return NULL; } } else { if(stack_push(tree->stack, second) != 0 || stack_push(tree->stack, first) != 0) { return NULL; } } splaytree_splay(tree); return tree->head->item; } /* * splaytree_depth2 * * recursive function to return the depth of the splay tree. */ static int splaytree_depth2(splaytree_node_t *tn) { int left = 0; int right = 0; if(tn == NULL) return 0; if(tn->left != NULL) { left = splaytree_depth2(tn->left) + 1; } if(tn->right != NULL) { right = splaytree_depth2(tn->right) + 1; } return (left > right) ? left : right; } /* * splaytree_depth * * returns the longest path (the depth) of the splay tree */ int splaytree_depth(splaytree_t *tree) { if(tree == NULL) return -1; if(tree->head == NULL) return 0; return splaytree_depth2(tree->head) + 1; } /* * splaytree_free2 * * iterative function used to free a splaytree's nodes. */ static void splaytree_free2(splaytree_t *tree, splaytree_free_t free_ptr) { splaytree_node_t *tn = tree->head, *tn2; stack_clean(tree->stack); while(tn != NULL) { if(tn->left != NULL) { tn2 = tn->left; tn->left = NULL; stack_push(tree->stack, tn); tn = tn2; continue; } if(tn->right != NULL) { tn2 = tn->right; tn->right = NULL; stack_push(tree->stack, tn); tn = tn2; continue; } if(tree->onremove != NULL) tree->onremove(tn->item); if(free_ptr != NULL) free_ptr(tn->item); free(tn); tn = stack_pop(tree->stack); } return; } /* * splaytree_free * * dellocate the splaytree */ void splaytree_free(splaytree_t *tree, splaytree_free_t free_ptr) { if(tree == NULL) return; splaytree_free2(tree, free_ptr); stack_destroy(tree->stack); free(tree); return; } void splaytree_empty(splaytree_t *tree, splaytree_free_t free_ptr) { if(tree == NULL) return; splaytree_free2(tree, free_ptr); tree->head = NULL; tree->size = 0; return; } void splaytree_onremove(splaytree_t *tree, splaytree_onremove_t onremove) { tree->onremove = onremove; return; } void *splaytree_gethead(splaytree_t *tree) { if(tree == NULL || tree->head == NULL) { return NULL; } return tree->head->item; } void *splaytree_pophead(splaytree_t *tree) { void *item; if(tree->head == NULL) return NULL; item = tree->head->item; if(splaytree_remove(tree) != 0) return NULL; return item; } /* * splaytree_getrmlb * * return the right-most item on the left branch of the tree */ void *splaytree_getrmlb(splaytree_t *tree) { splaytree_node_t *tn; if(tree == NULL || tree->head == NULL || tree->head->left == NULL) { return NULL; } tn = tree->head->left; while(tn->right != NULL) { tn = tn->right; } return tn->item; } /* * splaytree_getlmrb * * return the left-most item on the right branch of the tree */ void *splaytree_getlmrb(splaytree_t *tree) { splaytree_node_t *tn; if(tree == NULL || tree->head == NULL || tree->head->right == NULL) { return NULL; } tn = tree->head->right; while(tn->left != NULL) { tn = tn->left; } return tn->item; } /* * splaytree_display2 * * recursive function to print the contents of the splaytree, ascii-like. */ static void splaytree_display2(splaytree_node_t *tn, splaytree_display_t disp, int pad) { if(tn != NULL) { splaytree_display2(tn->left, disp, pad+1); disp(tn->item, pad); splaytree_display2(tn->right, disp, pad+1); } return; } /* * splaytree_display * * print the contents of the splaytree. */ void splaytree_display(splaytree_t *tree, splaytree_display_t disp) { if(tree != NULL && disp != NULL) { splaytree_display2(tree->head, disp, 1); } return; } /* * splaytree_inorder * * call a user-provided function on all items in the splay tree in order */ void splaytree_inorder(splaytree_t *tree, splaytree_inorder_t func, void *in) { splaytree_node_t *tn; if(tree == NULL || func == NULL) return; stack_clean(tree->stack); tn = tree->head; for(;;) { if(tn != NULL) { stack_push(tree->stack, tn); tn = tn->left; } else if((tn = stack_pop(tree->stack)) != NULL) { func(in, tn->item); tn = tn->right; } else break; } return; } /* * splaytree_alloc * * allocate a splaytree */ #ifndef DMALLOC splaytree_t *splaytree_alloc(splaytree_cmp_t cmp) #else splaytree_t *splaytree_alloc_dm(splaytree_cmp_t cmp, const char *file, const int line) #endif { splaytree_t *tree; size_t len = sizeof(splaytree_t); #ifndef DMALLOC tree = (splaytree_t *)malloc(len); #else tree = (splaytree_t *)dmalloc_malloc(file,line,len,DMALLOC_FUNC_MALLOC,0,0); #endif if(tree == NULL || (tree->stack = stack_create()) == NULL) goto err; tree->head = NULL; tree->onremove = NULL; tree->size = 0; tree->cmp = cmp; return tree; err: if(tree != NULL) free(tree); return NULL; } /* * splaytree_count * * return the number of items in the splaytree. */ int splaytree_count(splaytree_t *tree) { if(tree == NULL) return -1; return tree->size; } /* * stack_create * * create a stack that is optimised for dealing with splaytree processing */ static splaytree_stack_t *stack_create(void) { splaytree_stack_t *s; if((s = (splaytree_stack_t *)malloc(sizeof(splaytree_stack_t))) == NULL) { return NULL; } s->i = -1; s->c = 128; if((s->nodes = malloc(sizeof(splaytree_node_t *) * s->c)) == NULL) { free(s); return NULL; } return s; } /* * stack_clean * * reset the splaytree stack so it is emptied. */ static void stack_clean(splaytree_stack_t *s) { s->i = -1; return; } /* * stack_destroy * * free the memory allocated to the splaytree stack. */ static void stack_destroy(splaytree_stack_t *s) { free(s->nodes); free(s); return; } /* * stack_push * * put the node on the splaytree stack, growing the array if necessary. */ static int stack_push(splaytree_stack_t *s, splaytree_node_t *node) { splaytree_node_t **nodes; size_t size; if(s->i+1 == s->c) { size = sizeof(splaytree_node_t *) * (s->c + 128); if((nodes = (splaytree_node_t **)realloc(s->nodes, size)) == NULL) { return -1; } s->c += 128; s->nodes = nodes; } s->nodes[++s->i] = node; return 0; } /* * stack_pop * * remove the splaytree node at the top of the stack. */ static splaytree_node_t *stack_pop(splaytree_stack_t *s) { if(s->i == -1) return NULL; return s->nodes[s->i--]; } scamper-cvs-20171204/mjl_splaytree.h000644 001751 000000 00000010127 11372427441 017144 0ustar00mjlwheel000000 000000 /* * mjl_splaytree * * The (almost) completely reusable splay tree data structure and accompanying * algorithms. * this code was written for 0657.317 1999 at the University of Waikato * by Matthew Luckie * * Copyright (C) 1999-2010 Matthew Luckie. 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 Matthew Luckie ``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 Matthew Luckie 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. * * $Id: mjl_splaytree.h,v 1.15 2010/05/12 04:31:29 mjl Exp $ * */ #ifndef __MJL_SPLAYTREE_H #define __MJL_SPLAYTREE_H typedef struct splaytree splaytree_t; typedef struct splaytree_node splaytree_node_t; typedef int (*splaytree_cmp_t)(const void *a, const void *b); typedef int (*splaytree_diff_t)(const void *a, const void *b); typedef void (*splaytree_display_t)(const void *ptr, int pad); typedef int (*splaytree_inorder_t)(void *ptr, void *entry); typedef void (*splaytree_free_t)(void *ptr); typedef void (*splaytree_onremove_t)(void *ptr); #ifndef DMALLOC /* * functions for * (1) allocating and freeing a splaytree structure * (2) inserting a node into the tree */ splaytree_t *splaytree_alloc(splaytree_cmp_t cmp); splaytree_node_t *splaytree_insert(splaytree_t *tree, const void *ptr); #endif #ifdef DMALLOC /* dmalloc-enabled functions that do the same as the functions above */ splaytree_t *splaytree_alloc_dm(splaytree_cmp_t cmp, const char *file, const int line); splaytree_node_t *splaytree_insert_dm(splaytree_t *tree, const void *ptr, const char *file, const int line); #define splaytree_alloc(cmp) splaytree_alloc_dm((cmp), __FILE__, __LINE__) #define splaytree_insert(t,p) splaytree_insert_dm((t), (p), __FILE__, __LINE__) #endif void splaytree_free(splaytree_t *tree, splaytree_free_t free_ptr); void splaytree_empty(splaytree_t *tree, splaytree_free_t free_ptr); void splaytree_onremove(splaytree_t *tree, splaytree_onremove_t onremove); /* remove a node from the tree */ int splaytree_remove_item(splaytree_t *tree, const void *ptr); int splaytree_remove_node(splaytree_t *tree, splaytree_node_t *node); /* find a node in the tree and return it */ void *splaytree_find(splaytree_t *tree, const void *ptr); /* find a value in the tree closest to a particular value */ void *splaytree_findclosest(splaytree_t *tree, const void *ptr, splaytree_diff_t diff); /* return the right most node on the left branch of the tree */ void *splaytree_getrmlb(splaytree_t *tree); /* return the left most node on the right branch of the tree */ void *splaytree_getlmrb(splaytree_t *tree); /* return the node at the head of the tree */ void *splaytree_gethead(splaytree_t *tree); /* pop the node at the head of the tree */ void *splaytree_pophead(splaytree_t *tree); /* calculate the longest search path of the subtree passed in */ int splaytree_depth(splaytree_t *tree); void splaytree_display(splaytree_t *tree, splaytree_display_t disp); int splaytree_count(splaytree_t *tree); void splaytree_inorder(splaytree_t *tree, splaytree_inorder_t func, void *in); #endif /* __MJL_SPLAYTREE_H */ scamper-cvs-20171204/utils.c000644 001751 000000 00000117547 13131350352 015432 0ustar00mjlwheel000000 000000 /* * utils.c * * $Id: utils.c,v 1.185 2017/07/12 07:34:02 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2011 Matthew Luckie * Copyright (C) 2012-2015 The Regents of the University of California * Copyright (C) 2015-2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: utils.c,v 1.185 2017/07/12 07:34:02 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "utils.h" #if defined(HAVE_STRUCT_SOCKADDR_SA_LEN) int sockaddr_len(const struct sockaddr *sa) { return sa->sa_len; } #else int sockaddr_len(const struct sockaddr *sa) { if(sa->sa_family == AF_INET) return sizeof(struct sockaddr_in); if(sa->sa_family == AF_INET6) return sizeof(struct sockaddr_in6); #if defined(AF_LINK) if(sa->sa_family == AF_LINK) return sizeof(struct sockaddr_dl); #endif #if defined(AF_UNIX) && !defined(_WIN32) if(sa->sa_family == AF_UNIX) return sizeof(struct sockaddr_un); #endif return -1; } #endif void *addr_dup(const int af, const void *addr_in) { void *addr; size_t size; if(af == AF_INET) { size = sizeof(struct in_addr); } else if(af == AF_INET6) { size = sizeof(struct in6_addr); } else return NULL; if((addr = malloc(size)) != NULL) { memcpy(addr, addr_in, size); } return addr; } struct sockaddr *sockaddr_dup(const struct sockaddr *sa) { struct sockaddr *addr; int len; if((len = sockaddr_len(sa)) <= 0) { return NULL; } if((addr = malloc((size_t)len)) != NULL) { memcpy(addr, sa, (size_t)len); } return addr; } int sockaddr_compose(struct sockaddr *sa, const int af, const void *addr, const int port) { socklen_t len; struct sockaddr_in *sin4; struct sockaddr_in6 *sin6; assert(port >= 0); assert(port <= 65535); if(af == AF_INET) { len = sizeof(struct sockaddr_in); memset(sa, 0, len); sin4 = (struct sockaddr_in *)sa; if(addr != NULL) memcpy(&sin4->sin_addr, addr, sizeof(struct in_addr)); sin4->sin_port = htons(port); } else if(af == AF_INET6) { len = sizeof(struct sockaddr_in6); memset(sa, 0, len); sin6 = (struct sockaddr_in6 *)sa; if(addr != NULL) memcpy(&sin6->sin6_addr, addr, sizeof(struct in6_addr)); sin6->sin6_port = htons(port); } else return -1; #if defined(HAVE_STRUCT_SOCKADDR_SA_LEN) sa->sa_len = len; #endif sa->sa_family = af; return 0; } int sockaddr_compose_un(struct sockaddr *sa, const char *file) { #if defined(AF_UNIX) && !defined(_WIN32) struct sockaddr_un *sn = (struct sockaddr_un *)sa; if(strlen(file) + 1 > sizeof(sn->sun_path)) return -1; memset(sn, 0, sizeof(struct sockaddr_un)); sn->sun_family = AF_UNIX; snprintf(sn->sun_path, sizeof(sn->sun_path), "%s", file); #if defined(HAVE_STRUCT_SOCKADDR_SA_LEN) sn->sun_len = sizeof(struct sockaddr_un); #endif return 0; #else errno = EINVAL; return -1; #endif } int sockaddr_compose_str(struct sockaddr *sa, const char *addr, const int port) { struct addrinfo hints, *res, *res0; int rc = -1; void *va; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = IPPROTO_UDP; hints.ai_family = AF_UNSPEC; if(getaddrinfo(addr, NULL, &hints, &res0) != 0 || res0 == NULL) return rc; for(res = res0; res != NULL; res = res->ai_next) { if(res->ai_family == PF_INET) { va = &((struct sockaddr_in *)res->ai_addr)->sin_addr; sockaddr_compose(sa, AF_INET, va, port); rc = 0; break; } else if(res->ai_family == PF_INET6) { va = &((struct sockaddr_in6 *)res->ai_addr)->sin6_addr; sockaddr_compose(sa, AF_INET6, va, port); rc = 0; break; } } freeaddrinfo(res0); return rc; } #if defined(AF_LINK) && !defined(_WIN32) static char *link_tostr(const struct sockaddr_dl *sdl, char *buf, const size_t len) { static const char hex[] = "01234567890abcdef"; size_t off = 0; uint8_t *u8, i; if((off = snprintf(buf, len, "t%d", sdl->sdl_type)) + 1 > len) { return NULL; } if(sdl->sdl_nlen == 0 && sdl->sdl_alen == 0) { return buf; } else { buf[off++] = '.'; } /* check for enough remaining space */ if((size_t)(sdl->sdl_nlen + 1 + (3 * sdl->sdl_alen)) > len-off) { return NULL; } if(sdl->sdl_nlen > 0) { memcpy(buf+off, sdl->sdl_data, sdl->sdl_nlen); off += sdl->sdl_nlen; if(sdl->sdl_alen > 0) { buf[off++] = '.'; } else { buf[off] = '\0'; return buf; } } if(sdl->sdl_alen > 0) { u8 = (uint8_t *)LLADDR(sdl); for(i=0; isdl_alen; i++) { buf[off++] = hex[u8[i] & 0xf]; buf[off++] = hex[(u8[i] >> 4) & 0xf]; buf[off++] = ':'; } buf[off-1] = '\0'; } return buf; } #endif char *sockaddr_tostr(const struct sockaddr *sa, char *buf, const size_t len) { char addr[128]; if(sa->sa_family == AF_INET) { #ifndef _WIN32 if(inet_ntop(AF_INET, &((const struct sockaddr_in *)sa)->sin_addr, addr, sizeof(addr)) == NULL) { return NULL; } #else if(getnameinfo(sa, sizeof(struct sockaddr_in), addr, sizeof(addr), NULL, 0, NI_NUMERICHOST) != 0) { return NULL; } #endif snprintf(buf, len, "%s:%d", addr, ntohs(((const struct sockaddr_in *)sa)->sin_port)); } else if(sa->sa_family == AF_INET6) { #ifndef _WIN32 if(inet_ntop(AF_INET6, &((const struct sockaddr_in6 *)sa)->sin6_addr, addr, sizeof(addr)) == NULL) { return NULL; } #else if(getnameinfo(sa, sizeof(struct sockaddr_in6), addr, sizeof(addr), NULL, 0, NI_NUMERICHOST) != 0) { return NULL; } #endif snprintf(buf, len, "%s.%d", addr, ntohs(((const struct sockaddr_in6 *)sa)->sin6_port)); } #if defined(AF_LINK) && !defined(_WIN32) else if(sa->sa_family == AF_LINK) { return link_tostr((const struct sockaddr_dl *)sa, buf, len); } #endif #if defined(AF_UNIX) && !defined(_WIN32) else if(sa->sa_family == AF_UNIX) { snprintf(buf, len, "%s", ((const struct sockaddr_un *)sa)->sun_path); } #endif else { return NULL; } return buf; } int addr4_cmp(const void *va, const void *vb) { const struct in_addr *a = (const struct in_addr *)va; const struct in_addr *b = (const struct in_addr *)vb; if(a->s_addr < b->s_addr) return -1; if(a->s_addr > b->s_addr) return 1; return 0; } int addr4_human_cmp(const void *va, const void *vb) { const struct in_addr *a = (const struct in_addr *)va; const struct in_addr *b = (const struct in_addr *)vb; uint32_t ua = ntohl(a->s_addr); uint32_t ub = ntohl(b->s_addr); if(ua < ub) return -1; if(ua > ub) return 1; return 0; } int addr6_cmp(const void *va, const void *vb) { const struct in6_addr *a = (const struct in6_addr *)va; const struct in6_addr *b = (const struct in6_addr *)vb; int i; #ifndef _WIN32 for(i=0; i<4; i++) { if(a->s6_addr32[i] < b->s6_addr32[i]) return -1; if(a->s6_addr32[i] > b->s6_addr32[i]) return 1; } #else for(i=0; i<8; i++) { if(a->u.Word[i] < b->u.Word[i]) return -1; if(a->u.Word[i] > b->u.Word[i]) return 1; } #endif return 0; } int addr6_human_cmp(const void *va, const void *vb) { const struct in6_addr *a = (const struct in6_addr *)va; const struct in6_addr *b = (const struct in6_addr *)vb; int i; #ifndef _WIN32 uint32_t ua, ub; for(i=0; i<4; i++) { ua = ntohl(a->s6_addr32[i]); ub = ntohl(b->s6_addr32[i]); if(ua < ub) return -1; if(ua > ub) return 1; } #else uint16_t ua, ub; for(i=0; i<8; i++) { ua = ntohs(a->u.Word[i]); ub = ntohs(b->u.Word[i]); if(ua < ub) return -1; if(ua > ub) return 1; } #endif return 0; } /* * addr_cmp: * this function is used to provide a sorting order, not for advising the * numerical order of the addresses passed in. */ int addr_cmp(const int af, const void *a, const void *b) { if(af == AF_INET) return addr4_cmp(a, b); if(af == AF_INET6) return addr6_cmp(a, b); return 0; } #ifndef _WIN32 const char *addr_tostr(int af, const void *addr, char *buf, size_t len) { return inet_ntop(af, addr, buf, len); } #endif #ifdef _WIN32 const char *addr_tostr(int af, const void *addr, char *buf, size_t len) { struct sockaddr_storage sas; if(sockaddr_compose((struct sockaddr *)&sas, af, addr, 0) != 0) return NULL; if(getnameinfo((const struct sockaddr *)&sas, sizeof(sas), buf, len, NULL, 0, NI_NUMERICHOST) != 0) { return NULL; } return buf; } #endif /* * memdup * * duplicate some memory. */ #ifndef DMALLOC void *memdup(const void *ptr, const size_t len) { void *d; if((d = malloc(len)) != NULL) { memcpy(d, ptr, len); } return d; } #endif /* * malloc_zero * * allocate some memory, zero it, and return a pointer to it. */ #if !defined(DMALLOC) && !defined(HAVE_CALLOC) void *malloc_zero(const size_t size) { void *ptr; if((ptr = malloc(size)) != NULL) { memset(ptr, 0, size); } return ptr; } #endif #ifdef DMALLOC void *malloc_zero_dm(const size_t size, const char *file, const int line) { void *ptr; if((ptr = dmalloc_malloc(file,line,size,DMALLOC_FUNC_MALLOC,0,0)) != NULL) { memset(ptr, 0, size); } return ptr; } #endif #ifndef DMALLOC int realloc_wrap(void **ptr, size_t len) { void *tmp; if(len != 0) { if(*ptr != NULL) tmp = realloc(*ptr, len); else tmp = malloc(len); if(tmp != NULL) { *ptr = tmp; return 0; } } else { if(*ptr != NULL) { free(*ptr); *ptr = NULL; } return 0; } return -1; } #endif #ifdef DMALLOC int realloc_wrap_dm(void **ptr, size_t len, const char *file, const int line) { void *tmp; if(len != 0) { if(*ptr != NULL) tmp = dmalloc_realloc(file, line, *ptr, len, DMALLOC_FUNC_REALLOC, 0); else tmp = dmalloc_malloc(file, line, len, DMALLOC_FUNC_MALLOC, 0, 0); if(tmp != NULL) { *ptr = tmp; return 0; } } else { if(*ptr != NULL) { dmalloc_free(file, line, *ptr, DMALLOC_FUNC_FREE); *ptr = NULL; } return 0; } return -1; } #endif int array_findpos(void **array, int nmemb, const void *item, array_cmp_t cmp) { int l, r, k, i; if(nmemb == 0) { return -1; } l = 0; r = nmemb-1; if(r == 0) { if(cmp(array[0], item) == 0) return 0; return -1; } while(l <= r) { k = (l + r) / 2; i = cmp(array[k], item); if(i > 0) r = k-1; else if(i < 0) l = k+1; else return k; } return -1; } void *array_find(void **array, int nmemb, const void *item, array_cmp_t cmp) { int k = array_findpos(array, nmemb, item, cmp); if(k >= 0) return array[k]; return NULL; } /* * array_insert_0 * * handy function that deals with inserting an element into an array * and then sorting the array, if necessary. using mergesort because * the array is likely to have pre-existing order. */ static int array_insert_0(void **array,int *nmemb,void *item,array_cmp_t cmp) { assert(array != NULL); array[*nmemb] = item; *nmemb = *nmemb + 1; if(cmp != NULL) array_qsort(array, *nmemb, cmp); return 0; } #ifndef DMALLOC int array_insert(void ***array, int *nmemb, void *item, array_cmp_t cmp) { size_t len; assert(nmemb != NULL); assert(*nmemb >= 0); len = ((*nmemb) + 1) * sizeof(void *); if(realloc_wrap((void **)array, len) != 0) return -1; return array_insert_0(*array, nmemb, item, cmp); } int array_insert_gb(void ***array, int *nmemb, int *mmemb, int growby, void *item, array_cmp_t cmp) { size_t len; assert(nmemb != NULL && *nmemb >= 0); if(*nmemb + 1 >= *mmemb) { assert(*mmemb + growby > *nmemb); len = (*mmemb + growby) * sizeof(void *); if(realloc_wrap((void **)array, len) != 0) return -1; *mmemb += growby; } return array_insert_0(*array, nmemb, item, cmp); } #endif #ifdef DMALLOC int array_insert_dm(void ***array, int *nmemb, void *item, array_cmp_t cmp, const char *file, const int line) { size_t len; assert(nmemb != NULL && *nmemb >= 0); len = ((*nmemb) + 1) * sizeof(void *); if(realloc_wrap_dm((void **)array, len, file, line) != 0) return -1; return array_insert_0(*array, nmemb, item, cmp); } int array_insert_gb_dm(void ***array, int *nmemb, int *mmemb, int growby, void *item, array_cmp_t cmp, const char *file, const int line) { size_t len; assert(nmemb != NULL && *nmemb >= 0); if(*nmemb + 1 >= *mmemb) { assert(*mmemb + growby > *nmemb); len = (*mmemb + growby) * sizeof(void *); if(realloc_wrap_dm((void **)array, len, file, line) != 0) return -1; *mmemb += growby; } return array_insert_0(*array, nmemb, item, cmp); } #endif void array_remove(void **array, int *nmemb, int p) { assert(p >= 0 && p < *nmemb); memmove(array+p, array+p+1, ((*nmemb)-p-1) * sizeof(void *)); *nmemb = *nmemb - 1; return; } static void array_swap(void **a, int i, int j) { void *item = a[i]; a[i] = a[j]; a[j] = item; return; } static void array_qsort_3(void **a, array_cmp_t cmp, int l, int r) { int lt, gt, i, rc; void *c; if(l >= r) return; lt = l; gt = r; i = l; c = a[l]; while(i <= gt) { rc = a[i] != c ? cmp(a[i], c) : 0; if(rc < 0) array_swap(a, lt++, i++); else if(rc > 0) array_swap(a, i, gt--); else i++; } array_qsort_3(a, cmp, l, lt-1); array_qsort_3(a, cmp, gt+1, r); return; } void array_qsort(void **a, int n, array_cmp_t cmp) { array_qsort_3(a, cmp, 0, n-1); return; } #ifndef _WIN32 void gettimeofday_wrap(struct timeval *tv) { struct timezone tz; gettimeofday(tv, &tz); return; } #endif #ifdef _WIN32 void gettimeofday_wrap(struct timeval *tv) { FILETIME ft; uint64_t u64; GetSystemTimeAsFileTime(&ft); u64 = ft.dwHighDateTime; u64 <<= 32; u64 |= ft.dwLowDateTime; u64 /= 10; u64 -= 11644473600000000LL; tv->tv_sec = (long)(u64 / 1000000UL); tv->tv_usec = (long)(u64 % 1000000UL); return; } #endif int timeval_cmp(const struct timeval *a, const struct timeval *b) { if(a->tv_sec < b->tv_sec) return -1; if(a->tv_sec > b->tv_sec) return 1; if(a->tv_usec < b->tv_usec) return -1; if(a->tv_usec > b->tv_usec) return 1; return 0; } static void timeval_handlewrap(struct timeval *tv) { if(tv->tv_usec >= 1000000) { tv->tv_sec++; tv->tv_usec -= 1000000; } else if(tv->tv_usec < 0) { tv->tv_sec--; tv->tv_usec += 1000000; } return; } void timeval_add_cs(struct timeval *out, const struct timeval *in, int cs) { out->tv_sec = in->tv_sec + (cs / 100); out->tv_usec = in->tv_usec + ((cs % 100) * 10000); timeval_handlewrap(out); return; } void timeval_add_ms(struct timeval *out, const struct timeval *in, int msec) { out->tv_sec = in->tv_sec + (msec / 1000); out->tv_usec = in->tv_usec + ((msec % 1000) * 1000); timeval_handlewrap(out); return; } void timeval_add_us(struct timeval *out, const struct timeval *in, int us) { out->tv_sec = in->tv_sec + (us / 1000000); out->tv_usec = in->tv_usec + (us % 1000000); timeval_handlewrap(out); return; } void timeval_add_s(struct timeval *out, const struct timeval *in, int s) { out->tv_sec = in->tv_sec + s; out->tv_usec = in->tv_usec; return; } void timeval_sub_us(struct timeval *out, const struct timeval *in, int us) { out->tv_sec = in->tv_sec - (us / 1000000); out->tv_usec = in->tv_usec - (us % 1000000); timeval_handlewrap(out); return; } void timeval_add_tv(struct timeval *tv, const struct timeval *add) { assert(add->tv_sec >= 0); assert(add->tv_usec >= 0); tv->tv_sec += add->tv_sec; tv->tv_usec += add->tv_usec; /* check for overflow */ if(tv->tv_usec > 1000000) { tv->tv_sec++; tv->tv_usec -= 1000000; } return; } void timeval_add_tv3(struct timeval *out, const struct timeval *a, const struct timeval *b) { assert(a->tv_sec >= 0); assert(a->tv_usec >= 0); assert(b->tv_sec >= 0); assert(b->tv_usec >= 0); out->tv_sec = a->tv_sec + b->tv_sec; out->tv_usec = a->tv_usec + b->tv_usec; if(out->tv_usec > 1000000) { out->tv_sec++; out->tv_usec -= 1000000; } return; } void timeval_diff_tv(struct timeval *rtt, const struct timeval *from, const struct timeval *to) { rtt->tv_sec = to->tv_sec - from->tv_sec; rtt->tv_usec = to->tv_usec - from->tv_usec; if(rtt->tv_usec < 0) { rtt->tv_sec--; rtt->tv_usec += 1000000; } return; } /* * timeval_diff_ms * return the millisecond difference between the two timevals. * a - b */ int timeval_diff_ms(const struct timeval *a, const struct timeval *b) { struct timeval tv; timeval_diff_tv(&tv, b, a); return ((int)tv.tv_sec * 1000) + ((int)tv.tv_usec / 1000); } /* * timeval_diff_us * return the microsecond difference between the two timevals. * a - b */ int timeval_diff_us(const struct timeval *a, const struct timeval *b) { struct timeval tv; timeval_diff_tv(&tv, b, a); return ((int)tv.tv_sec * 1000000) + tv.tv_usec; } void timeval_cpy(struct timeval *dst, const struct timeval *src) { memcpy(dst, src, sizeof(struct timeval)); return; } int timeval_inrange_us(const struct timeval *a, const struct timeval *b, int c) { struct timeval tv; int rc = timeval_cmp(a, b); if(rc < 0) { timeval_add_us(&tv, a, c); if(timeval_cmp(&tv, b) < 0) return 0; } else if(rc > 0) { timeval_add_us(&tv, b, c); if(timeval_cmp(&tv, a) < 0) return 0; } return 1; } char *timeval_tostr_us(const struct timeval *rtt, char *str, size_t len) { uint32_t usec = (rtt->tv_sec * 1000000) + rtt->tv_usec; snprintf(str, len, "%d.%03d", usec / 1000, usec % 1000); return str; } #ifndef _WIN32 int fcntl_unset(const int fd, const int flags) { int i; if((i = fcntl(fd, F_GETFL, 0)) == -1) { return -1; } if(fcntl(fd, F_SETFL, i & (~flags)) == -1) { return -1; } return 0; } int fcntl_set(const int fd, const int flags) { int i; if((i = fcntl(fd, F_GETFL, 0)) == -1) { return -1; } if(fcntl(fd, F_SETFL, i | flags) == -1) { return -1; } return 0; } #endif int string_isprint(const char *str, const size_t len) { size_t i = 0; for(i=0; i 65535) goto err; *first = NULL; *port = lo; return 0; } if((dup = strdup(in)) == NULL) goto err; if(dup[0] == '[') { string_nullterm_char(dup, ']', &ptr); if(ptr == NULL || *ptr != ':' || (first_tmp = strdup(dup+1)) == NULL) goto err; ptr++; } else { string_nullterm_char(dup, ':', &ptr); if(ptr == NULL || (first_tmp = strdup(dup)) == NULL) goto err; } if(string_tolong(ptr, &lo) != 0 || lo < 1 || lo > 65535) goto err; *first = first_tmp; *port = lo; free(dup); return 0; err: if(first_tmp != NULL) free(first_tmp); if(dup != NULL) free(dup); return -1; } void mem_concat(void *dst,const void *src,size_t len,size_t *off,size_t size) { assert(*off + len <= size); memcpy(((uint8_t *)dst) + *off, src, len); *off += len; return; } int ishex(char c) { if((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) { return 1; } return 0; } uint8_t hex2byte(char a, char b) { uint8_t out; assert(ishex(a)); assert(ishex(b)); if(a <= '9') out = (((int)a - (int)'0') << 4); else if(a <= 'F') out = (((int)a - (int)'A' + 10) << 4); else out = (((int)a - (int)'a' + 10) << 4); if(b <= '9') out |= ((int)b - (int)'0'); else if(b <= 'F') out |= ((int)b - (int)'A' + 10); else out |= ((int)b - (int)'a' + 10); return out; } void byte2hex(uint8_t byte, char *a) { static const char hex[] = "01234567890abcdef"; a[0] = hex[(byte >> 4)]; a[1] = hex[byte & 0x0f]; return; } uint16_t bytes_ntohs(const uint8_t *bytes) { uint16_t u16; memcpy(&u16, bytes, 2); return ntohs(u16); } uint32_t bytes_ntohl(const uint8_t *bytes) { uint32_t u32; memcpy(&u32, bytes, 4); return ntohl(u32); } void bytes_htons(uint8_t *bytes, uint16_t u16) { uint16_t tmp = htons(u16); memcpy(bytes, &tmp, 2); return; } void bytes_htonl(uint8_t *bytes, uint32_t u32) { uint32_t tmp = htonl(u32); memcpy(bytes, &tmp, 4); return; } int read_wrap(const int fd, void *ptr, size_t *rc_out, const size_t rt) { uint8_t *buf; int ret = 0; ssize_t r; size_t rc; assert(rt > 0); assert(ptr != NULL); buf = (uint8_t *)ptr; for(rc = 0; rc < rt; rc += r) { if((r = read(fd, buf+rc, rt-rc)) < 0) { if(errno == EINTR) { r = 0; continue; } ret = -1; break; } else if(r == 0) { ret = -2; break; } } if(rc_out != NULL) { *rc_out = rc; } return ret; } int write_wrap(const int fd, const void *ptr, size_t *wc_out, const size_t wt) { int ret = 0; ssize_t w; size_t wc; assert(wt > 0); assert(ptr != NULL); for(wc = 0; wc < wt; wc += w) { if((w = write(fd, ((const uint8_t *)ptr)+wc, wt-wc)) < 0) { if(errno == EINTR) { w = 0; continue; } ret = -1; break; } } if(wc_out != NULL) { *wc_out = wc; } return ret; } /* * mkdir_wrap * * iteratively call mkdir until the full path has been created */ #ifndef _WIN32 int mkdir_wrap(const char *path, mode_t mode) #else int mkdir_wrap(const char *path) #endif { char *d = NULL; char *ptr; /* ensure there is actually a path to create ... */ if(path[0] == '\0' || (path[0] == '/' && path[1] == '\0')) { return 0; } /* make a duplicate copy of the path that we are going to create */ if((d = strdup(path)) == NULL) { goto err; } ptr = d; /* don't need to create the root directory ... */ if(ptr[0] == '/') ptr++; while(ptr[0] != '\0') { if(ptr[0] == '/') { /* temporarily replace the path delimeter */ ptr[0] = '\0'; if(mkdir(d, mode) != 0 && errno != EEXIST) { goto err; } ptr[0] = '/'; } ptr++; } /* create the last directory in the path */ if(ptr[-1] != '/') { if(mkdir(d, mode) != 0 && errno != EEXIST) { goto err; } } free(d); return 0; err: if(d != NULL) free(d); return -1; } /* * fstat_mtime * * simple utility function that gets the mtime field from * a fstat call as a time_t. */ int fstat_mtime(int fd, time_t *mtime) { struct stat sb; if(fstat(fd, &sb) != 0) { return -1; } *mtime = sb.st_mtime; return 0; } /* * stat_mtime * * simple utility function that gets the mtime field from * a stat call as a time_t. */ int stat_mtime(const char *filename, time_t *mtime) { struct stat sb; if(stat(filename, &sb) != 0) { return -1; } *mtime = sb.st_mtime; return 0; } #if !defined(__sun__) && !defined(_WIN32) int sysctl_wrap(int *mib, u_int len, void **buf, size_t *size) { if(sysctl(mib, len, NULL, size, NULL, 0) != 0) { return -1; } if(*size == 0) { *buf = NULL; return 0; } if((*buf = malloc(*size)) == NULL) { return -1; } if(sysctl(mib, len, *buf, size, NULL, 0) != 0) { free(*buf); return -1; } return 0; } #endif void random_seed(void) { #if defined(_WIN32) || defined(HAVE_ARC4RANDOM) return; #else struct timeval tv; gettimeofday_wrap(&tv); srandom(tv.tv_usec); return; #endif } int random_u32(uint32_t *r) { #if defined(_WIN32) unsigned int ui; if(rand_s(&ui) != 0) return -1; *r = ui; #elif defined(HAVE_ARC4RANDOM) *r = arc4random(); #else *r = random(); #endif return 0; } int random_u16(uint16_t *r) { #ifdef _WIN32 unsigned int ui; if(rand_s(&ui) != 0) return -1; *r = ui; #elif defined(HAVE_ARC4RANDOM) *r = arc4random(); #else *r = random(); #endif return 0; } int random_u8(uint8_t *r) { #ifdef _WIN32 unsigned int ui; if(rand_s(&ui) != 0) return -1; *r = ui; #elif defined(HAVE_ARC4RANDOM) *r = arc4random(); #else *r = random(); #endif return 0; } /* * countbits32 * * count the number of bits set in v. first published by Peter Wegner in * CACM 3 (1960), 322. */ int countbits32(uint32_t v) { int c; for(c=0; v != 0; c++) v &= v - 1; return c; } /* Fisher-Yates shuffle */ int shuffle16(uint16_t *array, int len) { int x, n = len; uint32_t k; uint16_t tmp; while(n > 1) { n--; if(random_u32(&k) != 0) return -1; x = k % (n+1); tmp = array[x]; array[x] = array[n]; array[n] = tmp; } return 0; } /* Fisher-Yates shuffle */ int shuffle32(uint32_t *array, int len) { int n = len; uint32_t k, tmp; while(n > 1) { n--; if(random_u32(&k) != 0) return -1; k %= n+1; tmp = array[k]; array[k] = array[n]; array[n] = tmp; } return 0; } uint16_t in_cksum(const void *buf, size_t len) { uint16_t *w = (uint16_t *)buf; size_t l = len; int sum = 0; while(l > 1) { sum += *w++; l -= 2; } if(l != 0) { sum += ((uint8_t *)w)[0]; } sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); return ~sum; } /* * uudecode_4 * * decode four ascii characters to form up to 3 binary bytes. */ static int uudecode_4(uint8_t *out, const char *in, size_t c) { char a, b; if(c == 0) return -1; if(in[0] >= '!' && in[0] <= '`') a = in[0]; else return -1; if(in[1] >= '!' && in[1] <= '`') b = in[1]; else return -1; out[0] = (((a - 32) & 0x3f) << 2 & 0xfc) | (((b - 32) & 0x3f) >> 4 & 0x3); if(in[2] >= '!' && in[2] <= '`') a = in[2]; else return -1; if(c > 1) out[1] = (((b - 32) & 0x3f) << 4 & 0xf0) | (((a - 32) & 0x3f) >> 2 & 0xf); if(in[3] >= '!' && in[3] <= '`') b = in[3]; else return -1; if(c > 2) out[2] = (((a - 32) & 0x3f) << 6 & 0xc0) | ((b - 32) & 0x3f); return 0; } /* * uudecode_line * * decode a uuencoded line into binary bytes. */ int uudecode_line(const char *in, size_t ilen, uint8_t *out, size_t *olen) { size_t i, j, o; if(ilen == 0) goto err; /* EOF */ if(in[0] == '`') { *olen = 0; return 0; } /* figure out the number of binary bytes that should be found */ if(in[0] >= '!' && in[0] <= '`') o = in[0] - 32; else goto err; /* make sure we can uudecode to the buffer provided */ if(o > *olen) goto err; i = 0; j = 1; for(;;) { /* there needs to be at least four characters remaining */ if(ilen - j < 4) goto err; /* decode 4 characters into 3 bytes */ if(uudecode_4(out+i, in+j, o-i) != 0) goto err; /* next block of 4 characters */ j += 4; /* advance */ if(o-i > 3) i += 3; else break; } *olen = o; return 0; err: return -1; } void *uudecode(const char *in, size_t len) { uint8_t *out = NULL; size_t i, j, k, x; /* if the first character is a ` (EOF) there is nothing to decode */ if(in[0] == '`') return NULL; i = 0; x = 0; /* first, figure out how much memory to allocate */ for(;;) { /* make sure character is valid */ if(in[i] < '!' || in[i] > '`') { goto err; } /* check for EOF */ if(in[i] == '`') break; /* number of uuencoded bytes on this line */ j = in[i++] - 32; /* number of ascii bytes required */ k = j + (j/3); if((k % 4) != 0) { k /= 4; k++; k *= 4; } /* advance to the end of the line */ if(len - i < k+1 || in[i+k] != '\n') { goto err; } i += k + 1; x += j; } /* make sure the uuencoded data ends with a new line */ if(len - i < 1 || in[i+1] != '\n') { goto err; } if((out = malloc(x)) == NULL) goto err; i = 0; j = 0; for(;;) { /* number of uuencoded bytes on this line */ k = in[i++] - 32; for(;;) { /* there needs to be at least four characters remaining */ if(len - i < 4) goto err; /* decode the next four */ if(uudecode_4(out+j, in+i, x-j) != 0) goto err; i += 4; if(k > 3) { j += 3; k -= 3; } else { j += k; break; } } /* advance to next line */ if(in[i] != '\n') goto err; i++; if(j == x) break; } return out; err: if(out != NULL) free(out); return NULL; } static void uuencode_3(uint8_t *out, uint8_t a, uint8_t b, uint8_t c) { uint8_t t; out[0] = (t = ((a >> 2) & 0x3f)) != 0 ? t + 32 : '`'; out[1] = (t = (((a << 4) | ((b >> 4) & 0xf)) & 0x3f)) != 0 ? t + 32 : '`'; out[2] = (t = (((b << 2) | ((c >> 6) & 0x3)) & 0x3f)) != 0 ? t + 32 : '`'; out[3] = (t = (c & 0x3f)) != 0 ? t + 32 : '`'; return; } size_t uuencode_len(size_t ilen, size_t *complete, size_t *leftover) { size_t len; size_t complete_lines; size_t leftover_bytes; assert(ilen != 0); /* * figure out how many complete lines there are, * and then how many leftover bytes there are */ complete_lines = ilen / 45; leftover_bytes = ilen % 45; /* * an input line of 45 characters is transformed into an 60 character * sequence, with the length encoded as a character at the start, and * a new-line character at the end of the line */ len = (complete_lines * 62); /* * if there are leftover bytes, then each group of three characters * will take four output bytes. if the number of leftover bytes is not * a multiple of three, then they are encoded in a 4 character sequence. * finally, there's a length character at the start and a new line at the * end. */ if(leftover_bytes != 0) { len += ((leftover_bytes / 3) * 4); if((leftover_bytes % 3) > 0) { len += 4; } len += 2; } /* allocate the end-of-data bytes */ len += 2; if(complete != NULL) *complete = complete_lines; if(leftover != NULL) *leftover = leftover_bytes; return len; } /* * uuencode_bytes * * take an input buffer, and an offset into that buffer, and encode as * much of it as possible into the output buffer */ size_t uuencode_bytes(const uint8_t *in, size_t len, size_t *off, uint8_t *out, size_t olen) { static const uint8_t b[] = { 2, 6,6,6, 10,10,10, 14,14,14, 18,18,18, 22,22,22, 26,26,26, 30,30,30, 34,34,34, 38,38,38, 42,42,42, 46,46,46, 50,50,50, 54,54,54, 58,58,58, 62,62,62}; size_t ooff = 0, i, lc, bb; assert(*off < len); for(;;) { /* determine how many characters will be written out this time */ if(len - *off >= 45) lc = 45; else lc = len - *off; /* determine how many bytes will be required */ bb = b[lc]; if(*off + lc == len) bb += 2; /* if not enough space, then stop now */ if(olen - ooff < bb) break; /* write out the line */ out[ooff++] = 32 + lc; for(i=0; i+3<=lc; i+=3) { uuencode_3(out+ooff, in[*off], in[*off+1], in[*off+2]); *off += 3; ooff += 4; } if(i != lc) { lc -= i; uuencode_3(out+ooff, in[*off], lc == 2 ? in[*off+1] : 0, 0); *off += lc; ooff += 4; } out[ooff++] = '\n'; /* encode eof */ if(*off == len) { out[ooff++] = '`'; out[ooff++] = '\n'; break; } } return ooff; } int uuencode(const uint8_t *in, size_t ilen, uint8_t **out, size_t *olen) { uint8_t *ptr; size_t len; size_t complete_lines; size_t leftover_bytes; size_t i, j; /* figure out how large the allocated buffer needs to be */ len = uuencode_len(ilen, &complete_lines, &leftover_bytes); assert(len != 0); /* allocate memory to encode the data to */ if((ptr = malloc(len)) == NULL) return -1; *out = ptr; *olen = len; /* encode all complete lines */ for(i=0; i 0) { uuencode_3(ptr, in[0], (leftover_bytes % 3) == 2 ? in[1] : 0, 0); ptr += 4; } *ptr = '\n'; ptr++; } /* this line has no data -- uuencode EOF */ *ptr = '`'; ptr++; *ptr = '\n'; return 0; } uint16_t byteswap16(const uint16_t word) { return ((word >> 8) | (word << 8)); } uint32_t byteswap32(const uint32_t word) { return ((word << 24) | (word >> 24) | ((word & 0xff00) << 8) | ((word >> 8) & 0xff00)); } /* process a text file, line by line */ int file_lines(const char *filename, int (*func)(char *, void *), void *param) { struct stat sb; off_t off, start; char *readbuf = NULL; int fd = -1; if((fd = open(filename, O_RDONLY)) < 0) goto err; if(fstat(fd, &sb) != 0) goto err; /* don't process a zero length file */ if(sb.st_size == 0) { close(fd); return 0; } if((readbuf = malloc(sb.st_size+1)) == NULL) goto err; if(read_wrap(fd, readbuf, NULL, sb.st_size) != 0) goto err; readbuf[sb.st_size] = '\0'; close(fd); fd = -1; /* parse the contents of the file */ start = 0; off = 0; while(off < sb.st_size+1) { if(readbuf[off] == '\n' || readbuf[off] == '\0') { if(start == off) { start = ++off; continue; } readbuf[off] = '\0'; if(func(readbuf+start, param) != 0) goto err; start = ++off; } else { ++off; } } free(readbuf); return 0; err: if(readbuf != NULL) free(readbuf); if(fd != -1) close(fd); return -1; } char *offt_tostr(char *buf, size_t len, off_t off, int lz, char c) { char sp[8]; assert(lz >= 0); if(sizeof(int) == sizeof(off_t)) { if(lz == 0) snprintf(sp, sizeof(sp), "%%%c", c); else snprintf(sp, sizeof(sp), "%%0%d%c", lz, c); } else if(sizeof(long int) == sizeof(off_t)) { if(lz == 0) snprintf(sp, sizeof(sp), "%%l%c", c); else snprintf(sp, sizeof(sp), "%%0%dl%c", lz, c); } else if(sizeof(long long int) == sizeof(off_t)) { if(lz == 0) snprintf(sp, sizeof(sp), "%%ll%c", c); else snprintf(sp, sizeof(sp), "%%0%dll%c", lz, c); } else { return NULL; } snprintf(buf, len, sp, off); return buf; } scamper-cvs-20171204/utils.h000644 001751 000000 00000017420 13131350352 015424 0ustar00mjlwheel000000 000000 /* * utils.h * * $Id: utils.h,v 1.115 2017/07/12 07:34:02 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2014 The Regents of the University of California * Copyright (C) 2015 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __UTILS_H #define __UTILS_H /* * Functions for dealing with time and timestamps */ int timeval_cmp(const struct timeval *a, const struct timeval *b); int timeval_diff_ms(const struct timeval *a, const struct timeval *b); int timeval_diff_us(const struct timeval *a, const struct timeval *b); void timeval_diff_tv(struct timeval *rtt, const struct timeval *from, const struct timeval *to); void timeval_add_cs(struct timeval *out, const struct timeval *in, int cs); void timeval_add_ms(struct timeval *out, const struct timeval *in, int ms); void timeval_add_us(struct timeval *out, const struct timeval *in, int us); void timeval_add_tv(struct timeval *tv, const struct timeval *add); void timeval_add_tv3(struct timeval *out, const struct timeval *a, const struct timeval *b); void timeval_add_s(struct timeval *out, const struct timeval *in, int s); void timeval_sub_us(struct timeval *out, const struct timeval *in, int us); void timeval_cpy(struct timeval *dst, const struct timeval *src); int timeval_inrange_us(const struct timeval *a,const struct timeval *b,int c); char *timeval_tostr_us(const struct timeval *rtt, char *str, size_t len); void gettimeofday_wrap(struct timeval *tv); int fstat_mtime(int fd, time_t *mtime); int stat_mtime(const char *filename, time_t *mtime); /* * Functions for dealing with memory allocation */ #ifndef DMALLOC #ifdef HAVE_CALLOC #define malloc_zero(size) calloc(1, (size)) #else void *malloc_zero(const size_t size); #endif void *memdup(const void *ptr, const size_t len); int realloc_wrap(void **ptr, size_t len); #else int realloc_wrap_dm(void **ptr,size_t len, const char *file,const int line); void *malloc_zero_dm(const size_t size, const char *file, const int line); #define realloc_wrap(ptr, len) realloc_wrap_dm((ptr),(len), __FILE__,__LINE__) #define malloc_zero(size) malloc_zero_dm((size), __FILE__, __LINE__) #define memdup(ptr, len) memcpy(malloc(len), ptr, len) #endif void mem_concat(void *dst,const void *src,size_t len,size_t *off,size_t size); typedef int (*array_cmp_t)(const void *va, const void *vb); void *array_find(void **a, int nmemb, const void *item, array_cmp_t cmp); int array_findpos(void **a, int nmemb, const void *item, array_cmp_t cmp); void array_remove(void **, int *nmemb, int pos); void array_qsort(void **a, int n, array_cmp_t cmp); #ifndef DMALLOC int array_insert(void ***a, int *nmemb, void *item, array_cmp_t cmp); int array_insert_gb(void ***a, int *nmemb, int *mmemb, int growby, void *item, array_cmp_t cmp); #else int array_insert_dm(void ***a, int *nmemb, void *item, array_cmp_t cmp, const char *file, const int line); int array_insert_gb_dm(void ***a, int *nmemb, int *mmemb, int growby, void *item, array_cmp_t cmp, const char *file, const int line); #define array_insert(a, nmemb, item, cmp) \ array_insert_dm((a), (nmemb), (item), (cmp), __FILE__, __LINE__) #define array_insert_gb(a, nmemb, mmemb, growby, item, cmp) \ array_insert_gb_dm((a), (nmemb), (mmemb), (growby), (item), (cmp), \ __FILE__, __LINE__) #endif /* * Functions for dealing with raw IPv4/IPv6 addresses */ int addr4_cmp(const void *a, const void *b); int addr4_human_cmp(const void *a, const void *b); int addr6_cmp(const void *a, const void *b); int addr6_human_cmp(const void *a, const void *b); int addr_cmp(const int af, const void *a, const void *b); void *addr_dup(const int af, const void *addr); const char *addr_tostr(int af, const void *addr, char *buf, size_t len); /* * Functions for dealing with sockaddr addresses */ int sockaddr_compose(struct sockaddr *sa, const int af, const void *addr, const int port); int sockaddr_compose_un(struct sockaddr *sa, const char *name); int sockaddr_compose_str(struct sockaddr *sa, const char *ip, const int port); int sockaddr_len(const struct sockaddr *sa); struct sockaddr *sockaddr_dup(const struct sockaddr *sa); char *sockaddr_tostr(const struct sockaddr *sa, char *buf, const size_t len); /* * Functions for dealing with fcntl flags on a file descriptor */ int fcntl_set(const int fd, const int flags); int fcntl_unset(const int fd, const int flags); /* * Functions for parsing strings */ char *string_nextword(char *str); char *string_nullterm(char *str, const char *delim, char **next); char *string_nullterm_char(char *str, const char delim, char **next); int string_isprint(const char *str, const size_t len); int string_isnumber(const char *str); int string_isfloat(const char *str); int string_tolong(const char *str, long *l); char *string_lastof(char *str, const char *delim); char *string_lastof_char(char *str, const char delim); char *string_firstof_char(char *str, const char delim); char *string_concat(char *str, size_t len, size_t *off, const char *fs, ...); const char *string_findlc(const char *str, const char *find); int string_addrport(const char *in, char **addr, int *port); /* check the character to see if it is possibly hex */ int ishex(char c); uint8_t hex2byte(char a, char b); void byte2hex(uint8_t byte, char *a); /* functions for extracting and inserting values from byte arrays */ uint16_t bytes_ntohs(const uint8_t *); uint32_t bytes_ntohl(const uint8_t *); void bytes_htons(uint8_t *, uint16_t); void bytes_htonl(uint8_t *, uint32_t); /* * Functions for doing I/O */ int read_wrap(const int fd, void *ptr, size_t *rc, const size_t rt); int write_wrap(const int fd, const void *ptr, size_t *wc, const size_t wt); #ifndef _WIN32 int mkdir_wrap(const char *path, mode_t mode); #else int mkdir_wrap(const char *path); #endif /* * Functions for dealing with sysctls */ #if !defined(__sun__) && !defined (_WIN32) int sysctl_wrap(int *mib, u_int len, void **buf, size_t *size); #endif /* function for formatting an off_t */ char *offt_tostr(char *buf, size_t len, off_t off, int lz, char m); /* * Function for computing an Internet checksum */ uint16_t in_cksum(const void *buf, size_t len); /* generate a 32-bit random number and return it */ void random_seed(void); int random_u32(uint32_t *r); int random_u16(uint16_t *r); int random_u8(uint8_t *r); /* fisher-yates shuffle */ int shuffle16(uint16_t *array, int len); int shuffle32(uint32_t *array, int len); /* count the number of bits set */ int countbits32(uint32_t v); /* * Functions for uuencode and uudecode. */ int uuencode(const uint8_t *in, size_t ilen, uint8_t **out, size_t *olen); size_t uuencode_len(size_t ilen, size_t *complete, size_t *leftover); size_t uuencode_bytes(const uint8_t *in, size_t len, size_t *off, uint8_t *out, size_t olen); void *uudecode(const char *in, size_t len); int uudecode_line(const char *in, size_t ilen, uint8_t *out, size_t *olen); /* swap bytes in a 16 bit word */ uint16_t byteswap16(const uint16_t word); uint32_t byteswap32(const uint32_t word); /* process a text file, line by line */ int file_lines(const char *filename, int (*func)(char *, void *), void *param); #endif /* __UTILS_H */ scamper-cvs-20171204/scamper/000755 001751 000000 00000000000 13211200553 015535 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/000755 001751 000000 00000000000 13211200553 015243 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/m4/000755 001751 000000 00000000000 13211200047 014421 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/autom4te.cache/000755 001751 000000 00000000000 13211200056 016705 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/aclocal.m4000644 001751 000000 00001327404 13211200045 015752 0ustar00mjlwheel000000 000000 # generated automatically by aclocal 1.15.1 -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. 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 what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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 no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [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 # that 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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # Copyright (C) 2002-2017 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.15' 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.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2017 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], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_check_openssl.m4]) m4_include([m4/ax_gcc_builtin.m4]) m4_include([m4/ax_pthread.m4]) scamper-cvs-20171204/ltmain.sh000644 001751 000000 00001170771 13211200046 015736 0ustar00mjlwheel000000 000000 #! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 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. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! 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 # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! 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 ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >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 "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # 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 "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 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. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # 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 else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # 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 yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; 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 prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && 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 built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; 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 lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; 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 yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; 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 prog = "$linkmode"; 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 unsupported != "$hardcode_direct"; 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 yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; 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 cannot 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 yes = "$module"; 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 no = "$build_old_libs"; 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 lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; 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 no = "$build_old_libs"; 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 no = "$allow_undefined"; 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 no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && 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 : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: scamper-cvs-20171204/config.h.in000644 001751 000000 00000024074 13211200052 016127 0ustar00mjlwheel000000 000000 /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `arc4random' function. */ #undef HAVE_ARC4RANDOM /* Define to 1 if you have the `arc4random_uniform' function. */ #undef HAVE_ARC4RANDOM_UNIFORM /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the `calloc' function. */ #undef HAVE_CALLOC /* Define to 1 if your system has a working `chown' function. */ #undef HAVE_CHOWN /* Define to 1 if you have the `daemon' function. */ #undef HAVE_DAEMON /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `endpwent' function. */ #undef HAVE_ENDPWENT /* Define to 1 if you have the `epoll_wait' function. */ #undef HAVE_EPOLL_WAIT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE /* Define to 1 if you have the `getdtablesize' function. */ #undef HAVE_GETDTABLESIZE /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the `getifaddrs' function. */ #undef HAVE_GETIFADDRS /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_IFADDRS_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `kqueue' function. */ #undef HAVE_KQUEUE /* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ #undef HAVE_LIBIPHLPAPI /* Define to 1 if you have the `ws2_32' library (-lws2_32). */ #undef HAVE_LIBWS2_32 /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* 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 `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET6_IP6_FW_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_IP_FW_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_TCP_VAR_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_PFVAR_H /* Define to 1 if you have OpenSSL */ #undef HAVE_OPENSSL /* Define to 1 if you have the `poll' function. */ #undef HAVE_POLL /* Define to 1 if you have the header file. */ #undef HAVE_POLL_H /* Define to 1 if you have pthread */ #undef HAVE_PTHREAD /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT /* Define to 1 if you have the `rmdir' function. */ #undef HAVE_RMDIR /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setproctitle' function. */ #undef HAVE_SETPROCTITLE /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* 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 `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strcasestr' function. */ #undef HAVE_STRCASESTR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* 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 `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `ip6_ext' struct. */ #undef HAVE_STRUCT_IP6_EXT /* Define if struct pfioc_trans_e has a rs_num member */ #undef HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM /* Define if struct pfioc_trans_e has a type member */ #undef HAVE_STRUCT_PFIOC_TRANS_E_TYPE /* Define if struct pf_rule has a nat member */ #undef HAVE_STRUCT_PF_RULE_NAT /* Define if struct pf_rule has a rdr member */ #undef HAVE_STRUCT_PF_RULE_RDR /* Define if struct sockaddr has an sa_len member */ #undef HAVE_STRUCT_SOCKADDR_SA_LEN /* Define to 1 if you have the header file. */ #undef HAVE_SYS_EPOLL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_EVENT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_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_SYSCTL_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 that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if the system has the `__builtin_clz' built-in function */ #undef HAVE___BUILTIN_CLZ /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if we don't want to do any debugging */ #undef NDEBUG /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* chroot directory for privsep process */ #undef PRIVSEP_DIR /* chroot directory group id */ #undef PRIVSEP_DIR_GROUP /* chroot directory owner */ #undef PRIVSEP_DIR_USER /* user name for privsep process */ #undef PRIVSEP_USER /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Defined to 1 if we don't want to be able generate a debugfile */ #undef WITHOUT_DEBUGFILE /* Define to 1 if we don't want privilege separation */ #undef WITHOUT_PRIVSEP /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint64_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT64_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* 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 the type of a signed integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef int16_t /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t /* Define to `int' if does not define. */ #undef mode_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 /* Define to `int' if does not define. */ #undef ssize_t /* Define to `int' if doesn't define. */ #undef uid_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef uint64_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t /* Define as `fork' if `vfork' does not work. */ #undef vfork scamper-cvs-20171204/compile000755 001751 000000 00000016326 13211200056 015467 0ustar00mjlwheel000000 000000 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2016-01-11.22; # UTC # Copyright (C) 1999-2017 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: scamper-cvs-20171204/config.guess000755 001751 000000 00000124431 13211200056 016426 0ustar00mjlwheel000000 000000 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-03-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /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 ;; earmv*) arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-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*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; 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}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac 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: scamper-cvs-20171204/config.sub000755 001751 000000 00000106246 13211200056 016075 0ustar00mjlwheel000000 000000 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-03-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2015 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-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -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 \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-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-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | powerpcspe-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*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 ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-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 ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; 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 ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) 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 | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) 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 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # 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 ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) 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 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: scamper-cvs-20171204/install-sh000755 001751 000000 00000034524 13211200056 016115 0ustar00mjlwheel000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2016-01-11.22; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # 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 "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: scamper-cvs-20171204/missing000755 001751 000000 00000015331 13211200056 015503 0ustar00mjlwheel000000 000000 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2016-01-11.22; # UTC # Copyright (C) 1996-2017 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: scamper-cvs-20171204/Makefile.in000644 001751 000000 00000062152 13211200057 016155 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in COPYING \ TODO compile config.guess config.sub install-sh ltmain.sh \ missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = scamper utils ACLOCAL_AMFLAGS = -I m4 CLEANFILES = *~ *.core all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # 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: scamper-cvs-20171204/depcomp000755 001751 000000 00000056017 13211200057 015470 0ustar00mjlwheel000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2016-01-11.22; # UTC # Copyright (C) 1999-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: scamper-cvs-20171204/configure000755 001751 000000 00002034143 13211200072 016015 0ustar00mjlwheel000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for scamper 20171204. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and mjl@luckie.org.nz $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: 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'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='scamper' PACKAGE_TARNAME='scamper' PACKAGE_VERSION='20171204' PACKAGE_STRING='scamper 20171204' PACKAGE_BUGREPORT='mjl@luckie.org.nz' PACKAGE_URL='' ac_unique_file="scamper/scamper.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC ax_pthread_config OPENSSL_LDFLAGS OPENSSL_LIBS OPENSSL_INCLUDES PKG_CONFIG WITH_SC_UPTIME_FALSE WITH_SC_UPTIME_TRUE privsep_dir_group privsep_dir_user privsep_dir privsep_user CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_shared enable_static with_pic enable_fast_install with_aix_soname enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_debug enable_privsep with_privsep_user with_privsep_dir with_privsep_dir_owner with_privsep_dir_group enable_debug_file with_dmalloc with_sc_uptime with_openssl enable_threads ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures scamper 20171204 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/scamper] --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 scamper 20171204:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-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] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug build with debugging symbols --disable-privsep disable privilege separation --disable-debug-file remove support for generating a debug file --disable-threads disable use of threads Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-privsep-user=USER sets user name for privsep process --with-privsep-dir=DIR sets chroot directory for privsep process --with-privsep-dir-user=USER sets chroot directory owner --with-privsep-dir-group=GROUP sets chroot directory group id --with-dmalloc enable support for dmalloc --with-sc_uptime enable support for sc_uptime --with-openssl=DIR root of the OpenSSL directory 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 LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF scamper configure 20171204 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------- ## ## Report this to mjl@luckie.org.nz ## ## -------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_find_intX_t LINENO BITS VAR # ----------------------------------- # Finds a signed integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 $as_echo_n "checking for int$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_intX_t # 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_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_uintX_t # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member 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 scamper $as_me 20171204, 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 am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='scamper' VERSION='20171204' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_config_headers="$ac_config_headers config.h" case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that 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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. 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 what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # 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 shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; 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 no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $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 yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; 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 relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; 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 yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi 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 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 # Whether all the debugging output should be spewed out # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi if test "x$enable_debug" != "xyes"; then $as_echo "#define NDEBUG 1" >>confdefs.h fi # No privilege separation # Check whether --enable-privsep was given. if test "${enable_privsep+set}" = set; then : enableval=$enable_privsep; fi if test "x$enable_privsep" = xno; then $as_echo "#define WITHOUT_PRIVSEP 1" >>confdefs.h fi # privsep parameters # Check whether --with-privsep_user was given. if test "${with_privsep_user+set}" = set; then : withval=$with_privsep_user; privsep_user=$withval else privsep_user=nobody fi # Check whether --with-privsep_dir was given. if test "${with_privsep_dir+set}" = set; then : withval=$with_privsep_dir; privsep_dir=$withval else privsep_dir=/var/empty fi # Check whether --with-privsep_dir_owner was given. if test "${with_privsep_dir_owner+set}" = set; then : withval=$with_privsep_dir_owner; privsep_dir_user=$withval else privsep_dir_user=root fi # Check whether --with-privsep_dir_group was given. if test "${with_privsep_dir_group+set}" = set; then : withval=$with_privsep_dir_group; privsep_dir_group=$withval else privsep_dir_group=wheel fi cat >>confdefs.h <<_ACEOF #define PRIVSEP_USER "$privsep_user" _ACEOF cat >>confdefs.h <<_ACEOF #define PRIVSEP_DIR "$privsep_dir" _ACEOF cat >>confdefs.h <<_ACEOF #define PRIVSEP_DIR_USER "$privsep_dir_user" _ACEOF cat >>confdefs.h <<_ACEOF #define PRIVSEP_DIR_GROUP "$privsep_dir_group" _ACEOF # Debug file support # Check whether --enable-debug-file was given. if test "${enable_debug_file+set}" = set; then : enableval=$enable_debug_file; fi if test "x$enable_debug_file" = xno; then $as_echo "#define WITHOUT_DEBUGFILE 1" >>confdefs.h fi # dmalloc support # Check whether --with-dmalloc was given. if test "${with_dmalloc+set}" = set; then : withval=$with_dmalloc; fi if test "x$with_dmalloc" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_malloc in -ldmalloc" >&5 $as_echo_n "checking for dmalloc_malloc in -ldmalloc... " >&6; } if ${ac_cv_lib_dmalloc_dmalloc_malloc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $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 dmalloc_malloc (); int main () { return dmalloc_malloc (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dmalloc_dmalloc_malloc=yes else ac_cv_lib_dmalloc_dmalloc_malloc=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_dmalloc_dmalloc_malloc" >&5 $as_echo "$ac_cv_lib_dmalloc_dmalloc_malloc" >&6; } if test "x$ac_cv_lib_dmalloc_dmalloc_malloc" = xyes; then : CFLAGS="$CFLAGS -DDMALLOC" LDFLAGS="$LDFLAGS -ldmalloc" 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 $? "dmalloc test failed (remove --with-dmalloc) See \`config.log' for more details" "$LINENO" 5; } fi fi # sc_uptime prober support # Check whether --with-sc_uptime was given. if test "${with_sc_uptime+set}" = set; then : withval=$with_sc_uptime; with_sc_uptime=$withval else with_sc_uptime=no fi if test x$with_sc_uptime = xyes; then WITH_SC_UPTIME_TRUE= WITH_SC_UPTIME_FALSE='#' else WITH_SC_UPTIME_TRUE='#' WITH_SC_UPTIME_FALSE= fi # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GetIpNetTable in -liphlpapi" >&5 $as_echo_n "checking for GetIpNetTable in -liphlpapi... " >&6; } if ${ac_cv_lib_iphlpapi_GetIpNetTable+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liphlpapi $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 GetIpNetTable (); int main () { return GetIpNetTable (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iphlpapi_GetIpNetTable=yes else ac_cv_lib_iphlpapi_GetIpNetTable=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_iphlpapi_GetIpNetTable" >&5 $as_echo "$ac_cv_lib_iphlpapi_GetIpNetTable" >&6; } if test "x$ac_cv_lib_iphlpapi_GetIpNetTable" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBIPHLPAPI 1 _ACEOF LIBS="-liphlpapi $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WSAStartup in -lws2_32" >&5 $as_echo_n "checking for WSAStartup in -lws2_32... " >&6; } if ${ac_cv_lib_ws2_32_WSAStartup+:} 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 WSAStartup (); int main () { return WSAStartup (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ws2_32_WSAStartup=yes else ac_cv_lib_ws2_32_WSAStartup=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_WSAStartup" >&5 $as_echo "$ac_cv_lib_ws2_32_WSAStartup" >&6; } if test "x$ac_cv_lib_ws2_32_WSAStartup" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWS2_32 1 _ACEOF LIBS="-lws2_32 $LIBS" fi # Checks for header files. { $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 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 { $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 for ac_header in arpa/inet.h do : ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" if test "x$ac_cv_header_arpa_inet_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARPA_INET_H 1 _ACEOF fi done for ac_header in fcntl.h do : ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_fcntl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FCNTL_H 1 _ACEOF fi done for ac_header in limits.h do : ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIMITS_H 1 _ACEOF fi done for ac_header in netdb.h do : ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" if test "x$ac_cv_header_netdb_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NETDB_H 1 _ACEOF fi done for ac_header in net/if_dl.h do : ac_fn_c_check_header_mongrel "$LINENO" "net/if_dl.h" "ac_cv_header_net_if_dl_h" "$ac_includes_default" if test "x$ac_cv_header_net_if_dl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NET_IF_DL_H 1 _ACEOF fi done for ac_header in net/if_types.h do : ac_fn_c_check_header_mongrel "$LINENO" "net/if_types.h" "ac_cv_header_net_if_types_h" "$ac_includes_default" if test "x$ac_cv_header_net_if_types_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NET_IF_TYPES_H 1 _ACEOF fi done for ac_header in netinet/in.h do : ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" if test "x$ac_cv_header_netinet_in_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NETINET_IN_H 1 _ACEOF fi done for ac_header in poll.h do : ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" if test "x$ac_cv_header_poll_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_POLL_H 1 _ACEOF fi done for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H 1 _ACEOF fi done for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done for ac_header in string.h do : ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRING_H 1 _ACEOF fi done for ac_header in sys/epoll.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" if test "x$ac_cv_header_sys_epoll_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_EPOLL_H 1 _ACEOF fi done for ac_header in sys/event.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" if test "x$ac_cv_header_sys_event_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_EVENT_H 1 _ACEOF fi done for ac_header in sys/ioctl.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_IOCTL_H 1 _ACEOF fi done for ac_header in sys/param.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" if test "x$ac_cv_header_sys_param_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_PARAM_H 1 _ACEOF fi done for ac_header in sys/socket.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" if test "x$ac_cv_header_sys_socket_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SOCKET_H 1 _ACEOF fi done for ac_header in sys/time.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TIME_H 1 _ACEOF fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done for ac_header in ifaddrs.h do : ac_fn_c_check_header_mongrel "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default" if test "x$ac_cv_header_ifaddrs_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_IFADDRS_H 1 _ACEOF fi done # sys/sysctl.h requires other headers on at least OpenBSD for ac_header in sys/sysctl.h do : ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" " #if HAVE_SYS_PARAM_H # include #endif " if test "x$ac_cv_header_sys_sysctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SYSCTL_H 1 _ACEOF fi done for ac_header in netinet/ip_fw.h netinet6/ip6_fw.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" " #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif #if HAVE_NETINET_IN_H # include #endif #if HAVE_ARPA_INET_H # include #endif #include #include " 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 netinet/tcp_var.h do : ac_fn_c_check_header_compile "$LINENO" "netinet/tcp_var.h" "ac_cv_header_netinet_tcp_var_h" " #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif #if HAVE_NETINET_IN_H # include #endif #include #include " if test "x$ac_cv_header_netinet_tcp_var_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NETINET_TCP_VAR_H 1 _ACEOF fi done for ac_header in net/pfvar.h do : ac_fn_c_check_header_compile "$LINENO" "net/pfvar.h" "ac_cv_header_net_pfvar_h" " #include #include #include #include " if test "x$ac_cv_header_net_pfvar_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NET_PFVAR_H 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 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 ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" case $ac_cv_c_int16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int16_t $ac_cv_c_int16_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int32_t $ac_cv_c_int32_t _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "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 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) $as_echo "#define _UINT64_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint64_t $ac_cv_c_uint64_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "#define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac # Checks for library functions. for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 $as_echo_n "checking for working chown... " >&6; } if ${ac_cv_func_chown_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_chown_works=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include int main () { char *f = "conftest.chown"; struct stat before, after; if (creat (f, 0600) < 0) return 1; if (stat (f, &before) < 0) return 1; if (chown (f, (uid_t) -1, (gid_t) -1) == -1) return 1; if (stat (f, &after) < 0) return 1; return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_chown_works=yes else ac_cv_func_chown_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f conftest.chown fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 $as_echo "$ac_cv_func_chown_works" >&6; } if test $ac_cv_func_chown_works = yes; then $as_echo "#define HAVE_CHOWN 1" >>confdefs.h fi for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi for ac_func in arc4random do : ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random" if test "x$ac_cv_func_arc4random" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARC4RANDOM 1 _ACEOF fi done for ac_func in arc4random_uniform do : ac_fn_c_check_func "$LINENO" "arc4random_uniform" "ac_cv_func_arc4random_uniform" if test "x$ac_cv_func_arc4random_uniform" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARC4RANDOM_UNIFORM 1 _ACEOF fi done for ac_func in atexit do : ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit" if test "x$ac_cv_func_atexit" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ATEXIT 1 _ACEOF fi done for ac_func in calloc do : ac_fn_c_check_func "$LINENO" "calloc" "ac_cv_func_calloc" if test "x$ac_cv_func_calloc" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CALLOC 1 _ACEOF fi done for ac_func in daemon do : ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon" if test "x$ac_cv_func_daemon" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DAEMON 1 _ACEOF fi done for ac_func in endpwent do : ac_fn_c_check_func "$LINENO" "endpwent" "ac_cv_func_endpwent" if test "x$ac_cv_func_endpwent" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ENDPWENT 1 _ACEOF fi done for ac_func in epoll_wait do : ac_fn_c_check_func "$LINENO" "epoll_wait" "ac_cv_func_epoll_wait" if test "x$ac_cv_func_epoll_wait" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_EPOLL_WAIT 1 _ACEOF fi done for ac_func in ftruncate do : ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" if test "x$ac_cv_func_ftruncate" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FTRUNCATE 1 _ACEOF fi done for ac_func in getdtablesize do : ac_fn_c_check_func "$LINENO" "getdtablesize" "ac_cv_func_getdtablesize" if test "x$ac_cv_func_getdtablesize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETDTABLESIZE 1 _ACEOF fi done for ac_func in gethostname do : ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname" if test "x$ac_cv_func_gethostname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETHOSTNAME 1 _ACEOF fi done for ac_func in getifaddrs do : ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" if test "x$ac_cv_func_getifaddrs" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETIFADDRS 1 _ACEOF fi done for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" if test "x$ac_cv_func_getpagesize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETPAGESIZE 1 _ACEOF fi done for ac_func in gettimeofday do : ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETTIMEOFDAY 1 _ACEOF fi done for ac_func in kqueue do : ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue" if test "x$ac_cv_func_kqueue" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_KQUEUE 1 _ACEOF fi done for ac_func in memmove do : ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" if test "x$ac_cv_func_memmove" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MEMMOVE 1 _ACEOF fi done for ac_func in memset do : ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" if test "x$ac_cv_func_memset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MEMSET 1 _ACEOF fi done for ac_func in mkdir do : ac_fn_c_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" if test "x$ac_cv_func_mkdir" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MKDIR 1 _ACEOF fi done for ac_func in poll do : ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" if test "x$ac_cv_func_poll" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_POLL 1 _ACEOF fi done for ac_func in rmdir do : ac_fn_c_check_func "$LINENO" "rmdir" "ac_cv_func_rmdir" if test "x$ac_cv_func_rmdir" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_RMDIR 1 _ACEOF fi done for ac_func in select do : ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" if test "x$ac_cv_func_select" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SELECT 1 _ACEOF fi done for ac_func in socket do : ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" if test "x$ac_cv_func_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SOCKET 1 _ACEOF fi done for ac_func in snprintf do : ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SNPRINTF 1 _ACEOF fi done for ac_func in setproctitle do : ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle" if test "x$ac_cv_func_setproctitle" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETPROCTITLE 1 _ACEOF fi done for ac_func in strcasecmp do : ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRCASECMP 1 _ACEOF fi done for ac_func in strcasestr do : ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" if test "x$ac_cv_func_strcasestr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRCASESTR 1 _ACEOF fi done for ac_func in strdup do : ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRDUP 1 _ACEOF fi done for ac_func in strerror do : ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR 1 _ACEOF fi done for ac_func in strncasecmp do : ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" if test "x$ac_cv_func_strncasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRNCASECMP 1 _ACEOF fi done for ac_func in strtol do : ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" if test "x$ac_cv_func_strtol" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRTOL 1 _ACEOF fi done for ac_func in uname do : ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" if test "x$ac_cv_func_uname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNAME 1 _ACEOF fi done # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include #include " if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : $as_echo "#define HAVE_STRUCT_SOCKADDR_SA_LEN 1" >>confdefs.h else : fi if test "x$ac_cv_header_net_pfvar_h" == xyes; then ac_fn_c_check_member "$LINENO" "struct pfioc_trans_e" "type" "ac_cv_member_struct_pfioc_trans_e_type" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pfioc_trans_e_type" = xyes; then : $as_echo "#define HAVE_STRUCT_PFIOC_TRANS_E_TYPE 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pfioc_trans_e" "rs_num" "ac_cv_member_struct_pfioc_trans_e_rs_num" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pfioc_trans_e_rs_num" = xyes; then : $as_echo "#define HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pf_rule" "nat" "ac_cv_member_struct_pf_rule_nat" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pf_rule_nat" = xyes; then : $as_echo "#define HAVE_STRUCT_PF_RULE_NAT 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pf_rule" "rdr" "ac_cv_member_struct_pf_rule_rdr" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pf_rule_rdr" = xyes; then : $as_echo "#define HAVE_STRUCT_PF_RULE_RDR 1" >>confdefs.h else : fi fi # Check for structs { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ip6_ext" >&5 $as_echo_n "checking for struct ip6_ext... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #include ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_IP6_EXT 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } #AC_DEFINE_UNQUOTED([HAVE_STRUCT_IP6_EXT], 0, [Define to 1 if you have the `ip6_ext' struct.]) fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # These libraries have to be explicitly linked in OpenSolaris { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 $as_echo_n "checking for library containing getaddrinfo... " >&6; } if ${ac_cv_search_getaddrinfo+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getaddrinfo (); int main () { return getaddrinfo (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib -lnsl $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getaddrinfo=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_getaddrinfo+:} false; then : break fi done if ${ac_cv_search_getaddrinfo+:} false; then : else ac_cv_search_getaddrinfo=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 $as_echo "$ac_cv_search_getaddrinfo" >&6; } ac_res=$ac_cv_search_getaddrinfo if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 $as_echo_n "checking for library containing inet_ntop... " >&6; } if ${ac_cv_search_inet_ntop+:} 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 inet_ntop (); int main () { return inet_ntop (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib -lsocket $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_ntop=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_ntop+:} false; then : break fi done if ${ac_cv_search_inet_ntop+:} false; then : else ac_cv_search_inet_ntop=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 $as_echo "$ac_cv_search_inet_ntop" >&6; } ac_res=$ac_cv_search_inet_ntop if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # Some systems need -lm to use sqrt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sqrt" >&5 $as_echo_n "checking for library containing sqrt... " >&6; } if ${ac_cv_search_sqrt+:} 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 sqrt (); int main () { return sqrt (); ; return 0; } _ACEOF for ac_lib in '' m; 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_sqrt=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_sqrt+:} false; then : break fi done if ${ac_cv_search_sqrt+:} false; then : else ac_cv_search_sqrt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sqrt" >&5 $as_echo "$ac_cv_search_sqrt" >&6; } ac_res=$ac_cv_search_sqrt if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi found=false # Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; case "$withval" in "" | y | ye | yes | n | no) as_fn_error $? "Invalid --with-openssl value" "$LINENO" 5 ;; *) ssldirs="$withval" ;; esac else # if pkg-config is installed and openssl has installed a .pc file, # then use that information and don't search ssldirs if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PKG_CONFIG"; then ac_cv_prog_PKG_CONFIG="$PKG_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config" $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 PKG_CONFIG=$ac_cv_prog_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_PKG_CONFIG"; then ac_ct_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_PKG_CONFIG"; then ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config" $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_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG if test -n "$ac_ct_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5 $as_echo "$ac_ct_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_ct_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_prog_PKG_CONFIG" fi if test x"$PKG_CONFIG" != x""; then OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` if test $? = 0; then OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` found=true fi fi # no such luck; use some default ssldirs if ! $found; then ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" fi fi # note that we #include , so the OpenSSL headers have to be in # an 'openssl' subdirectory if ! $found; then OPENSSL_INCLUDES= for ssldir in $ssldirs; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h in $ssldir" >&5 $as_echo_n "checking for openssl/ssl.h in $ssldir... " >&6; } if test -f "$ssldir/include/openssl/ssl.h"; then OPENSSL_INCLUDES="-I$ssldir/include" OPENSSL_LDFLAGS="-L$ssldir/lib" OPENSSL_LIBS="-lssl -lcrypto" found=true { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } break else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi done # if the file wasn't found, well, go ahead and try the link anyway -- maybe # it will just work! fi # try the preprocessor and linker with our new flags, # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling and linking against OpenSSL works" >&5 $as_echo_n "checking whether compiling and linking against OpenSSL works... " >&6; } echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&5 save_LIBS="$LIBS" save_LDFLAGS="$LDFLAGS" save_CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" LIBS="$OPENSSL_LIBS $LIBS" CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { SSL_new(NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_OPENSSL 1" >>confdefs.h CFLAGS="$CFLAGS $OPENSSL_INCLUDES" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_clz" >&5 $as_echo_n "checking for __builtin_clz... " >&6; } if ${ax_cv_have___builtin_clz+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { __builtin_clz(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have___builtin_clz=yes else ax_cv_have___builtin_clz=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have___builtin_clz" >&5 $as_echo "$ax_cv_have___builtin_clz" >&6; } if test yes = $ax_cv_have___builtin_clz; then : cat >>confdefs.h <<_ACEOF #define HAVE___BUILTIN_CLZ 1 _ACEOF fi # No thread support # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then : enableval=$enable_threads; fi if test "x$enable_threads" != 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 ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then ax_pthread_save_CC="$CC" ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" if test "x$PTHREAD_CC" != "x"; then : CC="$PTHREAD_CC" fi CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 $as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } 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_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi CC="$ax_pthread_save_CC" CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 # (Note: HP C rejects this with "bad form for `-t' option") # -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads and # -D_REENTRANT too), HP C (must be checked before -lpthread, which # is present but should not be used directly; and before -mthreads, # because the compiler interprets this as "-mt" + "-hreads") # -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case $host_os in freebsd*) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) ax_pthread_flags="-kthread lthread $ax_pthread_flags" ;; hpux*) # From the cc(1) man page: "[-mt] Sets various -D flags to enable # multi-threading and also sets -lpthread." ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" ;; openedition*) # IBM z/OS requires a feature-test macro to be defined in order to # enable POSIX threads at all, so give the user a hint if this is # not set. (We don't define these ourselves, as they can affect # other portions of the system API in unpredictable ways.) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) AX_PTHREAD_ZOS_MISSING # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 $as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} fi rm -f conftest* ;; solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (N.B.: The stubs are missing # pthread_cleanup_push, or rather a function called by this macro, # so we could check for that, but who knows whether they'll stub # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" ;; esac # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) if test "x$GCC" = "xyes"; then : ax_pthread_flags="-pthread -pthreads $ax_pthread_flags" fi # The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled case $host_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; aix*) ax_pthread_check_macro="_THREAD_SAFE" ;; *) ax_pthread_check_macro="--" ;; esac if test "x$ax_pthread_check_macro" = "x--"; then : ax_pthread_check_cond=0 else ax_pthread_check_cond="!defined($ax_pthread_check_macro)" fi # Are we compiling with Clang? { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 $as_echo_n "checking whether $CC is Clang... " >&6; } if ${ax_cv_PTHREAD_CLANG+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Note: Clang 2.7 lacks __clang_[a-z]+__ */ # if defined(__clang__) && defined(__llvm__) AX_PTHREAD_CC_IS_CLANG # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then : ax_cv_PTHREAD_CLANG=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 $as_echo "$ax_cv_PTHREAD_CLANG" >&6; } ax_pthread_clang="$ax_cv_PTHREAD_CLANG" ax_pthread_clang_warning=no # Clang needs special handling, because older versions handle the -pthread # option in a rather... idiosyncratic way if test "x$ax_pthread_clang" = "xyes"; then # Clang takes -pthread; it has never supported any other flag # (Note 1: This will need to be revisited if a system that Clang # supports has POSIX threads in a separate library. This tends not # to be the way of modern systems, but it's conceivable.) # (Note 2: On some systems, notably Darwin, -pthread is not needed # to get POSIX threads support; the API is always present and # active. We could reasonably leave PTHREAD_CFLAGS empty. But # -pthread does define _REENTRANT, and while the Darwin headers # ignore this macro, third-party headers might not.) PTHREAD_CFLAGS="-pthread" PTHREAD_LIBS= ax_pthread_ok=yes # However, older versions of Clang make a point of warning the user # that, in an invocation where only linking and no compilation is # taking place, the -pthread option has no effect ("argument unused # during compilation"). They expect -pthread to be passed in only # when source code is being compiled. # # Problem is, this is at odds with the way Automake and most other # C build frameworks function, which is that the same flags used in # compilation (CFLAGS) are also used in linking. Many systems # supported by AX_PTHREAD require exactly this for POSIX threads # support, and in fact it is often not straightforward to specify a # flag that is used only in the compilation phase and not in # linking. Such a scenario is extremely rare in practice. # # Even though use of the -pthread flag in linking would only print # a warning, this can be a nuisance for well-run software projects # that build with -Werror. So if the active version of Clang has # this misfeature, we search for an option to squash it. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 $as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second # step ax_pthread_save_ac_link="$ac_link" ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do if test "x$ax_pthread_try" = "xunknown"; then : break fi CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" ac_link="$ax_pthread_save_ac_link" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void){return 0;} _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_link="$ax_pthread_2step_ac_link" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void){return 0;} _ACEOF if ac_fn_c_try_link "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done ac_link="$ax_pthread_save_ac_link" CFLAGS="$ax_pthread_save_CFLAGS" if test "x$ax_pthread_try" = "x"; then : ax_pthread_try=no fi ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 $as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in no | unknown) ;; *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; esac fi # $ax_pthread_clang = yes if test "x$ax_pthread_ok" = "xno"; then for ax_pthread_try_flag in $ax_pthread_flags; do case $ax_pthread_try_flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -mt,pthread) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5 $as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; } PTHREAD_CFLAGS="-mt" PTHREAD_LIBS="-lpthread" ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 $as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ax_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ax_pthread_config="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_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" fi fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 $as_echo "$ax_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ax_pthread_config" = "xno"; then : continue fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 $as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; } int main () { pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xyes"; then : break fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = "xyes"; then ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr = $ax_pthread_attr; return attr /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 $as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ test "x$ax_pthread_joinable_attr_defined" != "xyes"; then : cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR _ACEOF ax_pthread_joinable_attr_defined=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 $as_echo_n "checking whether more special flags are required for pthreads... " >&6; } if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 $as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ test "x$ax_pthread_special_flags_added" != "xyes"; then : PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" ax_pthread_special_flags_added=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int i = PTHREAD_PRIO_INHERIT; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_PTHREAD_PRIO_INHERIT=yes else ax_cv_PTHREAD_PRIO_INHERIT=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ test "x$ax_pthread_prio_inherit_defined" != "xyes"; then : $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h ax_pthread_prio_inherit_defined=yes fi CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then case $host_os in aix*) case "x/$CC" in #( x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : #handle absolute path differently from PATH based program lookup case "x$CC" in #( x/*) : if as_fn_executable_p ${CC}_r; then : PTHREAD_CC="${CC}_r" fi ;; #( *) : for ac_prog in ${CC}_r 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_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_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_PTHREAD_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 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" ;; esac ;; #( *) : ;; esac ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else ax_pthread_ok=no 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 fi ac_config_files="$ac_config_files Makefile scamper/Makefile utils/Makefile utils/sc_ally/Makefile utils/sc_analysis_dump/Makefile utils/sc_attach/Makefile utils/sc_bdrmap/Makefile utils/sc_filterpolicy/Makefile utils/sc_ipiddump/Makefile utils/sc_prefixscan/Makefile utils/sc_radargun/Makefile utils/sc_remoted/Makefile utils/sc_speedtrap/Makefile utils/sc_tbitblind/Makefile utils/sc_tracediff/Makefile" if test "x$with_sc_uptime" != xno; then ac_config_files="$ac_config_files utils/sc_uptime/Makefile" fi ac_config_files="$ac_config_files utils/sc_warts2csv/Makefile utils/sc_warts2json/Makefile utils/sc_warts2pcap/Makefile utils/sc_warts2text/Makefile utils/sc_wartscat/Makefile utils/sc_wartsdump/Makefile utils/sc_wartsfix/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_SC_UPTIME_TRUE}" && test -z "${WITH_SC_UPTIME_FALSE}"; then as_fn_error $? "conditional \"WITH_SC_UPTIME\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by scamper $as_me 20171204, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ scamper config.status 20171204 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "scamper/Makefile") CONFIG_FILES="$CONFIG_FILES scamper/Makefile" ;; "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "utils/sc_ally/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_ally/Makefile" ;; "utils/sc_analysis_dump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_analysis_dump/Makefile" ;; "utils/sc_attach/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_attach/Makefile" ;; "utils/sc_bdrmap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_bdrmap/Makefile" ;; "utils/sc_filterpolicy/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_filterpolicy/Makefile" ;; "utils/sc_ipiddump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_ipiddump/Makefile" ;; "utils/sc_prefixscan/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_prefixscan/Makefile" ;; "utils/sc_radargun/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_radargun/Makefile" ;; "utils/sc_remoted/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_remoted/Makefile" ;; "utils/sc_speedtrap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_speedtrap/Makefile" ;; "utils/sc_tbitblind/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_tbitblind/Makefile" ;; "utils/sc_tracediff/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_tracediff/Makefile" ;; "utils/sc_uptime/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_uptime/Makefile" ;; "utils/sc_warts2csv/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2csv/Makefile" ;; "utils/sc_warts2json/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2json/Makefile" ;; "utils/sc_warts2pcap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2pcap/Makefile" ;; "utils/sc_warts2text/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2text/Makefile" ;; "utils/sc_wartscat/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartscat/Makefile" ;; "utils/sc_wartsdump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartsdump/Makefile" ;; "utils/sc_wartsfix/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartsfix/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi scamper-cvs-20171204/autom4te.cache/requests000644 001751 000000 00000063300 13211200072 020503 0ustar00mjlwheel000000 000000 # This file was generated. # It contains the lists of macros which have been traced. # It can be safely removed. @request = ( bless( [ '0', 1, [ '/usr/local/share/autoconf-2.69' ], [ '/usr/local/share/autoconf-2.69/autoconf/autoconf.m4f', '-', '/usr/local/share/aclocal-1.15/internal/ac-config-macro-dirs.m4', '/usr/local/share/aclocal/libtool.m4', '/usr/local/share/aclocal/ltargz.m4', '/usr/local/share/aclocal/ltdl.m4', '/usr/local/share/aclocal/ltoptions.m4', '/usr/local/share/aclocal/ltsugar.m4', '/usr/local/share/aclocal/ltversion.m4', '/usr/local/share/aclocal/lt~obsolete.m4', '/usr/local/share/aclocal-1.15/amversion.m4', '/usr/local/share/aclocal-1.15/auxdir.m4', '/usr/local/share/aclocal-1.15/cond.m4', '/usr/local/share/aclocal-1.15/depend.m4', '/usr/local/share/aclocal-1.15/depout.m4', '/usr/local/share/aclocal-1.15/init.m4', '/usr/local/share/aclocal-1.15/install-sh.m4', '/usr/local/share/aclocal-1.15/lead-dot.m4', '/usr/local/share/aclocal-1.15/make.m4', '/usr/local/share/aclocal-1.15/missing.m4', '/usr/local/share/aclocal-1.15/options.m4', '/usr/local/share/aclocal-1.15/prog-cc-c-o.m4', '/usr/local/share/aclocal-1.15/runlog.m4', '/usr/local/share/aclocal-1.15/sanity.m4', '/usr/local/share/aclocal-1.15/silent.m4', '/usr/local/share/aclocal-1.15/strip.m4', '/usr/local/share/aclocal-1.15/substnot.m4', '/usr/local/share/aclocal-1.15/tar.m4', 'configure.ac' ], { '_AM_IF_OPTION' => 1, '_LT_DLL_DEF_P' => 1, 'AC_PROG_LD_GNU' => 1, '_AC_PROG_LIBTOOL' => 1, 'AC_DISABLE_FAST_INSTALL' => 1, 'LT_SYS_MODULE_PATH' => 1, 'LT_OUTPUT' => 1, 'AC_CHECK_LIBM' => 1, 'LT_LANG' => 1, '_LT_LINKER_BOILERPLATE' => 1, '_LT_COMPILER_BOILERPLATE' => 1, '_LT_CC_BASENAME' => 1, 'AC_LTDL_DLLIB' => 1, 'LT_WITH_LTDL' => 1, 'AC_LIBTOOL_DLOPEN' => 1, 'AC_LTDL_SHLIBPATH' => 1, 'AC_LIBTOOL_FC' => 1, '_LT_AC_TAGCONFIG' => 1, '_AM_DEPENDENCIES' => 1, 'AM_ENABLE_SHARED' => 1, 'AC_LIBTOOL_PROG_COMPILER_PIC' => 1, 'AM_DISABLE_SHARED' => 1, 'AC_LIBTOOL_GCJ' => 1, 'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1, '_LT_AC_TRY_DLOPEN_SELF' => 1, '_LT_AC_SYS_LIBPATH_AIX' => 1, 'AC_LIBLTDL_INSTALLABLE' => 1, 'LTOBSOLETE_VERSION' => 1, 'LT_SUPPORTED_TAG' => 1, '_AM_SET_OPTION' => 1, '_LTDL_SETUP' => 1, 'LT_AC_PROG_RC' => 1, 'm4_pattern_allow' => 1, 'AM_PROG_LIBTOOL' => 1, 'AC_DEFUN_ONCE' => 1, 'LTDL_INIT' => 1, 'LTVERSION_VERSION' => 1, 'AM_SET_LEADING_DOT' => 1, 'LT_PATH_NM' => 1, 'AC_LTDL_SHLIBEXT' => 1, 'AC_LTDL_PREOPEN' => 1, 'AC_PROG_NM' => 1, 'LT_PATH_LD' => 1, 'AC_LIBTOOL_OBJDIR' => 1, '_AM_MANGLE_OPTION' => 1, '_LT_AC_LANG_F77_CONFIG' => 1, 'AM_SET_DEPDIR' => 1, 'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1, 'AC_LIBTOOL_CXX' => 1, 'AC_DISABLE_STATIC' => 1, 'AM_DISABLE_STATIC' => 1, '_LT_PROG_F77' => 1, '_AM_PROG_CC_C_O' => 1, 'AM_PROG_INSTALL_SH' => 1, 'AC_PROG_EGREP' => 1, 'AC_LIBTOOL_CONFIG' => 1, 'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1, '_LT_AC_CHECK_DLFCN' => 1, '_LT_PROG_FC' => 1, 'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1, 'LT_SYS_SYMBOL_USCORE' => 1, 'AC_LTDL_ENABLE_INSTALL' => 1, 'LTSUGAR_VERSION' => 1, '_LT_AC_PROG_CXXCPP' => 1, 'LT_SYS_DLOPEN_DEPLIBS' => 1, 'AC_WITH_LTDL' => 1, '_m4_warn' => 1, 'AC_ENABLE_STATIC' => 1, 'AC_LTDL_SYSSEARCHPATH' => 1, 'AC_LIBTOOL_LANG_RC_CONFIG' => 1, 'AC_LIBTOOL_PROG_LD_SHLIBS' => 1, 'LT_SYS_DLOPEN_SELF' => 1, 'm4_pattern_forbid' => 1, 'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1, 'AC_ENABLE_SHARED' => 1, 'AC_LTDL_OBJDIR' => 1, 'AC_LIBTOOL_PROG_CC_C_O' => 1, 'AC_ENABLE_FAST_INSTALL' => 1, '_AM_SET_OPTIONS' => 1, 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, 'LT_AC_PROG_GCJ' => 1, '_LT_AC_FILE_LTDLL_C' => 1, '_AC_AM_CONFIG_HEADER_HOOK' => 1, '_LT_AC_LANG_CXX' => 1, 'LT_LIB_DLLOAD' => 1, '_LT_LIBOBJ' => 1, '_LT_AC_LOCK' => 1, 'LTOPTIONS_VERSION' => 1, 'include' => 1, 'AM_PROG_INSTALL_STRIP' => 1, 'LT_CMD_MAX_LEN' => 1, '_LT_PROG_ECHO_BACKSLASH' => 1, 'AC_LIBTOOL_LANG_C_CONFIG' => 1, '_LT_AC_LANG_C_CONFIG' => 1, 'AM_DEP_TRACK' => 1, '_LT_AC_LANG_RC_CONFIG' => 1, '_LT_AC_LANG_F77' => 1, '_LT_LINKER_OPTION' => 1, 'AC_LIBTOOL_COMPILER_OPTION' => 1, 'AM_SANITY_CHECK' => 1, 'AM_SUBST_NOTMAKE' => 1, 'AC_PATH_TOOL_PREFIX' => 1, 'AM_MISSING_HAS_RUN' => 1, 'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1, 'AC_LTDL_SYMBOL_USCORE' => 1, 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, 'AC_CONFIG_MACRO_DIR_TRACE' => 1, 'AC_PATH_MAGIC' => 1, 'AC_LIBTOOL_SYS_LIB_STRIP' => 1, '_LT_COMPILER_OPTION' => 1, 'AC_LIBTOOL_LANG_CXX_CONFIG' => 1, 'LT_FUNC_DLSYM_USCORE' => 1, 'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1, '_LT_PREPARE_SED_QUOTE_VARS' => 1, 'AC_LIBTOOL_DLOPEN_SELF' => 1, '_LT_AC_SYS_COMPILER' => 1, 'LTDL_INSTALLABLE' => 1, '_LT_REQUIRED_DARWIN_CHECKS' => 1, 'AC_PROG_LD' => 1, 'AM_SILENT_RULES' => 1, '_LT_AC_LANG_CXX_CONFIG' => 1, '_LT_PROG_CXX' => 1, 'AC_LIBTOOL_LINKER_OPTION' => 1, 'AC_LIBTOOL_WIN32_DLL' => 1, 'LT_CONFIG_LTDL_DIR' => 1, 'AM_AUTOMAKE_VERSION' => 1, '_AM_CONFIG_MACRO_DIRS' => 1, 'LT_AC_PROG_EGREP' => 1, '_LT_WITH_SYSROOT' => 1, '_AM_PROG_TAR' => 1, 'LT_PROG_GO' => 1, 'LT_SYS_MODULE_EXT' => 1, 'AC_LIBTOOL_POSTDEP_PREDEP' => 1, 'AC_LIBTOOL_F77' => 1, 'AC_LIBTOOL_PICMODE' => 1, '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AM_MAKE_INCLUDE' => 1, 'AM_AUX_DIR_EXPAND' => 1, '_LT_PROG_LTMAIN' => 1, '_LT_AC_TAGVAR' => 1, '_LT_AC_LANG_GCJ_CONFIG' => 1, 'LT_PROG_RC' => 1, 'm4_include' => 1, 'AM_PROG_NM' => 1, 'AC_PROG_LD_RELOAD_FLAG' => 1, 'AM_RUN_LOG' => 1, 'AC_LIBTOOL_RC' => 1, 'AC_DEPLIBS_CHECK_METHOD' => 1, 'AU_DEFUN' => 1, 'AC_LIBTOOL_SETUP' => 1, 'AC_LTDL_DLSYM_USCORE' => 1, 'AC_LIB_LTDL' => 1, '_LT_PATH_TOOL_PREFIX' => 1, 'LT_LIB_M' => 1, 'AM_MISSING_PROG' => 1, 'AM_ENABLE_STATIC' => 1, 'AC_LIBLTDL_CONVENIENCE' => 1, 'AM_PROG_LD' => 1, 'AC_DISABLE_SHARED' => 1, 'LT_PROG_GCJ' => 1, 'AM_PROG_CC_C_O' => 1, 'AC_PROG_LIBTOOL' => 1, 'AM_CONDITIONAL' => 1, 'AC_CONFIG_MACRO_DIR' => 1, 'LT_INIT' => 1, 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, 'LT_SYS_DLSEARCH_PATH' => 1, 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, 'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1, '_AM_AUTOCONF_VERSION' => 1, '_LT_AC_SHELL_INIT' => 1, '_LT_AC_PROG_ECHO_BACKSLASH' => 1, 'LT_AC_PROG_SED' => 1, 'AC_DEFUN' => 1, 'LTDL_CONVENIENCE' => 1, '_LT_AC_LANG_GCJ' => 1, '_AM_SUBST_NOTMAKE' => 1, 'LT_FUNC_ARGZ' => 1 } ], 'Autom4te::Request' ), bless( [ '1', 1, [ '/usr/local/share/autoconf-2.69' ], [ '/usr/local/share/autoconf-2.69/autoconf/autoconf.m4f', '-', '/usr/local/share/aclocal-1.15/internal/ac-config-macro-dirs.m4', '/usr/local/share/aclocal/libtool.m4', '/usr/local/share/aclocal/ltargz.m4', '/usr/local/share/aclocal/ltdl.m4', '/usr/local/share/aclocal/ltoptions.m4', '/usr/local/share/aclocal/ltsugar.m4', '/usr/local/share/aclocal/ltversion.m4', '/usr/local/share/aclocal/lt~obsolete.m4', '/usr/local/share/aclocal-1.15/amversion.m4', '/usr/local/share/aclocal-1.15/auxdir.m4', '/usr/local/share/aclocal-1.15/cond.m4', '/usr/local/share/aclocal-1.15/depend.m4', '/usr/local/share/aclocal-1.15/depout.m4', '/usr/local/share/aclocal-1.15/init.m4', '/usr/local/share/aclocal-1.15/install-sh.m4', '/usr/local/share/aclocal-1.15/lead-dot.m4', '/usr/local/share/aclocal-1.15/make.m4', '/usr/local/share/aclocal-1.15/missing.m4', '/usr/local/share/aclocal-1.15/options.m4', '/usr/local/share/aclocal-1.15/prog-cc-c-o.m4', '/usr/local/share/aclocal-1.15/runlog.m4', '/usr/local/share/aclocal-1.15/sanity.m4', '/usr/local/share/aclocal-1.15/silent.m4', '/usr/local/share/aclocal-1.15/strip.m4', '/usr/local/share/aclocal-1.15/substnot.m4', '/usr/local/share/aclocal-1.15/tar.m4', 'm4/ax_check_openssl.m4', 'm4/ax_gcc_builtin.m4', 'm4/ax_pthread.m4', 'configure.ac' ], { 'AC_LTDL_SHLIBEXT' => 1, 'LT_PATH_NM' => 1, 'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1, 'AC_LIBTOOL_CXX' => 1, 'AM_SET_DEPDIR' => 1, 'AC_DISABLE_STATIC' => 1, 'AC_PROG_NM' => 1, 'AC_LTDL_PREOPEN' => 1, '_LT_AC_LANG_F77_CONFIG' => 1, '_AM_MANGLE_OPTION' => 1, 'LT_PATH_LD' => 1, 'AC_LIBTOOL_OBJDIR' => 1, '_AM_SET_OPTION' => 1, 'LT_SUPPORTED_TAG' => 1, '_LTDL_SETUP' => 1, 'AC_LIBLTDL_INSTALLABLE' => 1, 'LTOBSOLETE_VERSION' => 1, 'LTVERSION_VERSION' => 1, 'AM_SET_LEADING_DOT' => 1, 'm4_pattern_allow' => 1, 'LT_AC_PROG_RC' => 1, 'AX_GCC_BUILTIN' => 1, 'AC_DEFUN_ONCE' => 1, 'AM_PROG_LIBTOOL' => 1, 'LTDL_INIT' => 1, 'AC_LIBTOOL_FC' => 1, '_LT_AC_TAGCONFIG' => 1, 'AC_LIBTOOL_PROG_COMPILER_PIC' => 1, 'AM_ENABLE_SHARED' => 1, '_AM_DEPENDENCIES' => 1, 'AC_LTDL_DLLIB' => 1, 'AC_LTDL_SHLIBPATH' => 1, 'AC_LIBTOOL_DLOPEN' => 1, 'LT_WITH_LTDL' => 1, '_LT_AC_TRY_DLOPEN_SELF' => 1, 'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1, '_LT_AC_SYS_LIBPATH_AIX' => 1, 'AM_DISABLE_SHARED' => 1, 'AC_LIBTOOL_GCJ' => 1, 'LT_SYS_MODULE_PATH' => 1, 'AC_DISABLE_FAST_INSTALL' => 1, '_AC_PROG_LIBTOOL' => 1, '_AM_IF_OPTION' => 1, '_LT_DLL_DEF_P' => 1, 'AC_PROG_LD_GNU' => 1, '_LT_CC_BASENAME' => 1, '_LT_COMPILER_BOILERPLATE' => 1, 'AC_CHECK_LIBM' => 1, 'LT_LANG' => 1, 'LT_OUTPUT' => 1, '_LT_LINKER_BOILERPLATE' => 1, 'AX_PTHREAD' => 1, 'LTOPTIONS_VERSION' => 1, '_LT_AC_LOCK' => 1, '_LT_LIBOBJ' => 1, '_AC_AM_CONFIG_HEADER_HOOK' => 1, '_LT_AC_LANG_CXX' => 1, 'LT_LIB_DLLOAD' => 1, '_LT_AC_LANG_C_CONFIG' => 1, 'AC_LIBTOOL_LANG_C_CONFIG' => 1, '_LT_PROG_ECHO_BACKSLASH' => 1, 'AM_DEP_TRACK' => 1, 'include' => 1, 'LT_CMD_MAX_LEN' => 1, 'AM_PROG_INSTALL_STRIP' => 1, 'AC_ENABLE_SHARED' => 1, 'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1, 'AC_LIBTOOL_PROG_LD_SHLIBS' => 1, 'AC_LIBTOOL_LANG_RC_CONFIG' => 1, 'AC_LTDL_SYSSEARCHPATH' => 1, 'AC_ENABLE_STATIC' => 1, 'm4_pattern_forbid' => 1, 'LT_SYS_DLOPEN_SELF' => 1, 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, '_AM_SET_OPTIONS' => 1, 'AC_ENABLE_FAST_INSTALL' => 1, '_LT_AC_FILE_LTDLL_C' => 1, 'LT_AC_PROG_GCJ' => 1, 'AC_LTDL_OBJDIR' => 1, 'AC_LIBTOOL_PROG_CC_C_O' => 1, 'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1, '_LT_PROG_FC' => 1, '_LT_AC_CHECK_DLFCN' => 1, 'AM_PROG_INSTALL_SH' => 1, 'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1, 'AC_LIBTOOL_CONFIG' => 1, 'AC_PROG_EGREP' => 1, '_LT_AC_PROG_CXXCPP' => 1, 'AC_WITH_LTDL' => 1, '_m4_warn' => 1, 'LT_SYS_DLOPEN_DEPLIBS' => 1, 'LT_SYS_SYMBOL_USCORE' => 1, 'LTSUGAR_VERSION' => 1, 'AC_LTDL_ENABLE_INSTALL' => 1, 'AM_DISABLE_STATIC' => 1, '_AM_PROG_CC_C_O' => 1, '_LT_PROG_F77' => 1, '_AM_CONFIG_MACRO_DIRS' => 1, '_LT_WITH_SYSROOT' => 1, '_AM_PROG_TAR' => 1, 'LT_AC_PROG_EGREP' => 1, 'LT_CONFIG_LTDL_DIR' => 1, 'AC_LIBTOOL_WIN32_DLL' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'LT_SYS_MODULE_EXT' => 1, 'AC_LIBTOOL_POSTDEP_PREDEP' => 1, 'AC_LIBTOOL_F77' => 1, 'LT_PROG_GO' => 1, 'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1, 'LT_FUNC_DLSYM_USCORE' => 1, '_LT_PREPARE_SED_QUOTE_VARS' => 1, 'AC_LIBTOOL_DLOPEN_SELF' => 1, 'AC_PATH_MAGIC' => 1, 'AC_LIBTOOL_LANG_CXX_CONFIG' => 1, '_LT_COMPILER_OPTION' => 1, 'AC_LIBTOOL_SYS_LIB_STRIP' => 1, '_LT_PROG_CXX' => 1, 'AM_SILENT_RULES' => 1, '_LT_AC_LANG_CXX_CONFIG' => 1, 'AC_LIBTOOL_LINKER_OPTION' => 1, '_LT_AC_SYS_COMPILER' => 1, 'LTDL_INSTALLABLE' => 1, '_LT_REQUIRED_DARWIN_CHECKS' => 1, 'AC_PROG_LD' => 1, 'AC_LTDL_SYMBOL_USCORE' => 1, 'AM_MISSING_HAS_RUN' => 1, 'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1, 'AC_CONFIG_MACRO_DIR_TRACE' => 1, 'CHECK_SSL' => 1, 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, '_LT_AC_LANG_RC_CONFIG' => 1, '_LT_AC_LANG_F77' => 1, 'AM_SUBST_NOTMAKE' => 1, 'AM_SANITY_CHECK' => 1, 'AC_PATH_TOOL_PREFIX' => 1, '_LT_LINKER_OPTION' => 1, 'AC_LIBTOOL_COMPILER_OPTION' => 1, '_LT_AC_PROG_ECHO_BACKSLASH' => 1, 'LT_AC_PROG_SED' => 1, '_AM_AUTOCONF_VERSION' => 1, '_LT_AC_SHELL_INIT' => 1, 'LTDL_CONVENIENCE' => 1, 'LT_FUNC_ARGZ' => 1, '_LT_AC_LANG_GCJ' => 1, '_AM_SUBST_NOTMAKE' => 1, 'AC_DEFUN' => 1, 'AM_PROG_LD' => 1, 'AC_LIBLTDL_CONVENIENCE' => 1, 'LT_PROG_GCJ' => 1, 'AC_PROG_LIBTOOL' => 1, 'AM_PROG_CC_C_O' => 1, 'AC_DISABLE_SHARED' => 1, 'AM_ENABLE_STATIC' => 1, 'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1, 'AC_CONFIG_MACRO_DIR' => 1, 'AM_CONDITIONAL' => 1, 'LT_INIT' => 1, 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, 'LT_SYS_DLSEARCH_PATH' => 1, 'AX_CHECK_OPENSSL' => 1, 'AC_PROG_LD_RELOAD_FLAG' => 1, 'AM_RUN_LOG' => 1, 'm4_include' => 1, 'LT_PROG_RC' => 1, '_LT_AC_LANG_GCJ_CONFIG' => 1, 'AM_PROG_NM' => 1, 'LT_LIB_M' => 1, 'AM_MISSING_PROG' => 1, 'AC_LIBTOOL_SETUP' => 1, 'AU_DEFUN' => 1, 'AC_LIBTOOL_RC' => 1, 'AC_DEPLIBS_CHECK_METHOD' => 1, 'AC_LIB_LTDL' => 1, '_LT_PATH_TOOL_PREFIX' => 1, 'AC_LTDL_DLSYM_USCORE' => 1, 'AM_INIT_AUTOMAKE' => 1, '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, 'AC_LIBTOOL_PICMODE' => 1, 'ACX_PTHREAD' => 1, '_LT_PROG_LTMAIN' => 1, 'AM_AUX_DIR_EXPAND' => 1, 'AM_MAKE_INCLUDE' => 1, '_LT_AC_TAGVAR' => 1 } ], 'Autom4te::Request' ), bless( [ '2', 1, [ '/usr/local/share/autoconf-2.69' ], [ '/usr/local/share/autoconf-2.69/autoconf/autoconf.m4f', 'aclocal.m4', 'configure.ac' ], { 'AH_OUTPUT' => 1, 'include' => 1, 'AC_SUBST' => 1, '_AM_COND_IF' => 1, 'AC_CANONICAL_SYSTEM' => 1, 'AC_SUBST_TRACE' => 1, 'AM_ENABLE_MULTILIB' => 1, '_AM_SUBST_NOTMAKE' => 1, 'AC_CONFIG_AUX_DIR' => 1, 'AC_CANONICAL_BUILD' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'LT_CONFIG_LTDL_DIR' => 1, 'AM_POT_TOOLS' => 1, 'AM_PATH_GUILE' => 1, 'm4_pattern_allow' => 1, 'LT_INIT' => 1, 'AC_CONFIG_FILES' => 1, 'AM_CONDITIONAL' => 1, 'AC_CONFIG_LINKS' => 1, 'AM_SILENT_RULES' => 1, 'sinclude' => 1, 'AC_FC_PP_DEFINE' => 1, 'AM_PROG_AR' => 1, 'AC_FC_PP_SRCEXT' => 1, 'AC_FC_SRCEXT' => 1, 'm4_pattern_forbid' => 1, 'AM_MAKEFILE_INCLUDE' => 1, 'LT_SUPPORTED_TAG' => 1, '_AM_MAKEFILE_INCLUDE' => 1, 'AM_PROG_CC_C_O' => 1, 'AC_PROG_LIBTOOL' => 1, 'AC_CONFIG_SUBDIRS' => 1, 'AM_PROG_MOC' => 1, 'AC_INIT' => 1, 'AM_XGETTEXT_OPTION' => 1, 'AM_EXTRA_RECURSIVE_TARGETS' => 1, 'AM_PROG_CXX_C_O' => 1, 'AC_CANONICAL_TARGET' => 1, 'AM_PROG_FC_C_O' => 1, '_AM_COND_ENDIF' => 1, '_m4_warn' => 1, '_AM_COND_ELSE' => 1, 'm4_include' => 1, 'AC_CONFIG_HEADERS' => 1, 'AC_CONFIG_LIBOBJ_DIR' => 1, '_LT_AC_TAGCONFIG' => 1, 'AM_PROG_MKDIR_P' => 1, 'AC_REQUIRE_AUX_FILE' => 1, 'AM_GNU_GETTEXT' => 1, 'AM_PROG_F77_C_O' => 1, 'AC_CANONICAL_HOST' => 1, 'm4_sinclude' => 1, 'AC_FC_FREEFORM' => 1, 'AM_NLS' => 1, 'AC_LIBSOURCE' => 1, 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AM_MAINTAINER_MODE' => 1 } ], 'Autom4te::Request' ) ); scamper-cvs-20171204/autom4te.cache/output.0000644 001751 000000 00001752246 13211200035 020344 0ustar00mjlwheel000000 000000 @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. @%:@ Generated by GNU Autoconf 2.69 for scamper 20171204. @%:@ @%:@ Report bugs to . @%:@ @%:@ @%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @%:@ @%:@ @%:@ This configure script is free software; the Free Software Foundation @%:@ gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in @%:@( *posix*) : set -o posix ;; @%:@( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in @%:@( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in @%:@(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in @%:@ (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in @%:@( *posix*) : set -o posix ;; @%:@( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in @%:@( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in @%:@ (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and mjl@luckie.org.nz $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: 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 @S|@? 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 "@S|@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 @S|@as_val. Take advantage of shells that can avoid forks. The arguments @%:@ must be portable across @S|@(()) 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 @S|@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'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIB@&t@OBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='scamper' PACKAGE_TARNAME='scamper' PACKAGE_VERSION='20171204' PACKAGE_STRING='scamper 20171204' PACKAGE_BUGREPORT='mjl@luckie.org.nz' PACKAGE_URL='' ac_unique_file="scamper/scamper.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIB@&t@OBJS WITH_SC_UPTIME_FALSE WITH_SC_UPTIME_TRUE privsep_dir_group privsep_dir_user privsep_dir privsep_user CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_shared enable_static with_pic enable_fast_install with_aix_soname enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_debug enable_privsep with_privsep_user with_privsep_dir with_privsep_dir_owner with_privsep_dir_group enable_debug_file with_dmalloc with_sc_uptime enable_threads ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures scamper 20171204 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 @<:@@S|@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/scamper@:>@ --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 scamper 20171204:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-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@:>@ --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug build with debugging symbols --disable-privsep disable privilege separation --disable-debug-file remove support for generating a debug file --disable-threads disable use of threads Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic@<:@=PKGS@:>@ try to use only PIC/non-PIC objects @<:@default=use both@:>@ --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=aix@:>@. --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ --with-sysroot@<:@=DIR@:>@ Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-privsep-user=USER sets user name for privsep process --with-privsep-dir=DIR sets chroot directory for privsep process --with-privsep-dir-user=USER sets chroot directory owner --with-privsep-dir-group=GROUP sets chroot directory group id --with-dmalloc enable support for dmalloc --with-sc_uptime enable support for sc_uptime 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 LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF scamper configure 20171204 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.@S|@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.@S|@ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_link @%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES @%:@ ------------------------------------------------------- @%:@ Tests whether HEADER exists and can be compiled using the include files in @%:@ INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @%:@include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_header_compile @%:@ ac_fn_c_try_cpp LINENO @%:@ ---------------------- @%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_cpp @%:@ ac_fn_c_try_run LINENO @%:@ ---------------------- @%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes @%:@ that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_run @%:@ ac_fn_c_check_func LINENO FUNC VAR @%:@ ---------------------------------- @%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_func @%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES @%:@ ------------------------------------------------------- @%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using @%:@ the include files in INCLUDES and setting the cache variable VAR @%:@ accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @%:@include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------- ## ## Report this to mjl@luckie.org.nz ## ## -------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_header_mongrel @%:@ ac_fn_c_find_intX_t LINENO BITS VAR @%:@ ----------------------------------- @%:@ Finds a signed integer type with width BITS, setting cache variable VAR @%:@ accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 $as_echo_n "checking for int$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array @<:@1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array @<:@1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else case $ac_type in @%:@( int$2_t) : eval "$3=yes" ;; @%:@( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_intX_t @%:@ 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_find_uintX_t LINENO BITS VAR @%:@ ------------------------------------ @%:@ Finds an unsigned integer type with width BITS, setting cache variable VAR @%:@ accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array @<:@1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in @%:@( uint$2_t) : eval "$3=yes" ;; @%:@( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_uintX_t @%:@ ac_fn_c_compute_int LINENO EXPR VAR INCLUDES @%:@ -------------------------------------------- @%:@ Tries to find the compile-time value of EXPR in a program that includes @%:@ INCLUDES, setting VAR accordingly. Returns whether the value could be @%:@ computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) >= 0)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) < 0)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) >= $ac_mid)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in @%:@(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } @%:@include @%:@include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_member 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 scamper $as_me 20171204, 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 am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in @%:@(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null @%:@ Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='scamper' VERSION='20171204' cat >>confdefs.h <<_ACEOF @%:@define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_config_headers="$ac_config_headers config.h" case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf @%:@ Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $@%:@ != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep @%:@ Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that 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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } @%:@ Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } @%:@ Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. 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 what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF @%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no @%:@ Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi @%:@ Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi @%:@ Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi @%:@ 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 shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } @%:@ Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF @%:@define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic@&t@ -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic@&t@ -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; 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 no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $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 yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; 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 relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; 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 yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi 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 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 # Whether all the debugging output should be spewed out @%:@ Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi if test "x$enable_debug" != "xyes"; then $as_echo "@%:@define NDEBUG 1" >>confdefs.h fi # No privilege separation @%:@ Check whether --enable-privsep was given. if test "${enable_privsep+set}" = set; then : enableval=$enable_privsep; fi if test "x$enable_privsep" = xno; then $as_echo "@%:@define WITHOUT_PRIVSEP 1" >>confdefs.h fi # privsep parameters @%:@ Check whether --with-privsep_user was given. if test "${with_privsep_user+set}" = set; then : withval=$with_privsep_user; privsep_user=$withval else privsep_user=nobody fi @%:@ Check whether --with-privsep_dir was given. if test "${with_privsep_dir+set}" = set; then : withval=$with_privsep_dir; privsep_dir=$withval else privsep_dir=/var/empty fi @%:@ Check whether --with-privsep_dir_owner was given. if test "${with_privsep_dir_owner+set}" = set; then : withval=$with_privsep_dir_owner; privsep_dir_user=$withval else privsep_dir_user=root fi @%:@ Check whether --with-privsep_dir_group was given. if test "${with_privsep_dir_group+set}" = set; then : withval=$with_privsep_dir_group; privsep_dir_group=$withval else privsep_dir_group=wheel fi cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_USER "$privsep_user" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_DIR "$privsep_dir" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_DIR_USER "$privsep_dir_user" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_DIR_GROUP "$privsep_dir_group" _ACEOF # Debug file support @%:@ Check whether --enable-debug-file was given. if test "${enable_debug_file+set}" = set; then : enableval=$enable_debug_file; fi if test "x$enable_debug_file" = xno; then $as_echo "@%:@define WITHOUT_DEBUGFILE 1" >>confdefs.h fi # dmalloc support @%:@ Check whether --with-dmalloc was given. if test "${with_dmalloc+set}" = set; then : withval=$with_dmalloc; fi if test "x$with_dmalloc" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_malloc in -ldmalloc" >&5 $as_echo_n "checking for dmalloc_malloc in -ldmalloc... " >&6; } if ${ac_cv_lib_dmalloc_dmalloc_malloc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $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 dmalloc_malloc (); int main () { return dmalloc_malloc (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dmalloc_dmalloc_malloc=yes else ac_cv_lib_dmalloc_dmalloc_malloc=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_dmalloc_dmalloc_malloc" >&5 $as_echo "$ac_cv_lib_dmalloc_dmalloc_malloc" >&6; } if test "x$ac_cv_lib_dmalloc_dmalloc_malloc" = xyes; then : CFLAGS="$CFLAGS -DDMALLOC" LDFLAGS="$LDFLAGS -ldmalloc" 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 $? "dmalloc test failed (remove --with-dmalloc) See \`config.log' for more details" "$LINENO" 5; } fi fi # sc_uptime prober support @%:@ Check whether --with-sc_uptime was given. if test "${with_sc_uptime+set}" = set; then : withval=$with_sc_uptime; with_sc_uptime=$withval else with_sc_uptime=no fi if test x$with_sc_uptime = xyes; then WITH_SC_UPTIME_TRUE= WITH_SC_UPTIME_FALSE='#' else WITH_SC_UPTIME_TRUE='#' WITH_SC_UPTIME_FALSE= fi # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GetIpNetTable in -liphlpapi" >&5 $as_echo_n "checking for GetIpNetTable in -liphlpapi... " >&6; } if ${ac_cv_lib_iphlpapi_GetIpNetTable+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liphlpapi $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 GetIpNetTable (); int main () { return GetIpNetTable (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iphlpapi_GetIpNetTable=yes else ac_cv_lib_iphlpapi_GetIpNetTable=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_iphlpapi_GetIpNetTable" >&5 $as_echo "$ac_cv_lib_iphlpapi_GetIpNetTable" >&6; } if test "x$ac_cv_lib_iphlpapi_GetIpNetTable" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBIPHLPAPI 1 _ACEOF LIBS="-liphlpapi $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WSAStartup in -lws2_32" >&5 $as_echo_n "checking for WSAStartup in -lws2_32... " >&6; } if ${ac_cv_lib_ws2_32_WSAStartup+:} 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 WSAStartup (); int main () { return WSAStartup (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ws2_32_WSAStartup=yes else ac_cv_lib_ws2_32_WSAStartup=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_WSAStartup" >&5 $as_echo "$ac_cv_lib_ws2_32_WSAStartup" >&6; } if test "x$ac_cv_lib_ws2_32_WSAStartup" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBWS2_32 1 _ACEOF LIBS="-lws2_32 $LIBS" fi # Checks for header files. { $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 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 { $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 for ac_header in arpa/inet.h do : ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" if test "x$ac_cv_header_arpa_inet_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ARPA_INET_H 1 _ACEOF fi done for ac_header in fcntl.h do : ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_fcntl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_FCNTL_H 1 _ACEOF fi done for ac_header in limits.h do : ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIMITS_H 1 _ACEOF fi done for ac_header in netdb.h do : ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" if test "x$ac_cv_header_netdb_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NETDB_H 1 _ACEOF fi done for ac_header in net/if_dl.h do : ac_fn_c_check_header_mongrel "$LINENO" "net/if_dl.h" "ac_cv_header_net_if_dl_h" "$ac_includes_default" if test "x$ac_cv_header_net_if_dl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NET_IF_DL_H 1 _ACEOF fi done for ac_header in net/if_types.h do : ac_fn_c_check_header_mongrel "$LINENO" "net/if_types.h" "ac_cv_header_net_if_types_h" "$ac_includes_default" if test "x$ac_cv_header_net_if_types_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NET_IF_TYPES_H 1 _ACEOF fi done for ac_header in netinet/in.h do : ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" if test "x$ac_cv_header_netinet_in_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NETINET_IN_H 1 _ACEOF fi done for ac_header in poll.h do : ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" if test "x$ac_cv_header_poll_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_POLL_H 1 _ACEOF fi done for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STDINT_H 1 _ACEOF fi done for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STDLIB_H 1 _ACEOF fi done for ac_header in string.h do : ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRING_H 1 _ACEOF fi done for ac_header in sys/epoll.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" if test "x$ac_cv_header_sys_epoll_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_EPOLL_H 1 _ACEOF fi done for ac_header in sys/event.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" if test "x$ac_cv_header_sys_event_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_EVENT_H 1 _ACEOF fi done for ac_header in sys/ioctl.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_IOCTL_H 1 _ACEOF fi done for ac_header in sys/param.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" if test "x$ac_cv_header_sys_param_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_PARAM_H 1 _ACEOF fi done for ac_header in sys/socket.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" if test "x$ac_cv_header_sys_socket_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_SOCKET_H 1 _ACEOF fi done for ac_header in sys/time.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_TIME_H 1 _ACEOF fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_UNISTD_H 1 _ACEOF fi done for ac_header in ifaddrs.h do : ac_fn_c_check_header_mongrel "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default" if test "x$ac_cv_header_ifaddrs_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_IFADDRS_H 1 _ACEOF fi done # sys/sysctl.h requires other headers on at least OpenBSD for ac_header in sys/sysctl.h do : ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" " #if HAVE_SYS_PARAM_H # include #endif " if test "x$ac_cv_header_sys_sysctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_SYSCTL_H 1 _ACEOF fi done for ac_header in netinet/ip_fw.h netinet6/ip6_fw.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" " #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif #if HAVE_NETINET_IN_H # include #endif #if HAVE_ARPA_INET_H # include #endif #include #include " 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 netinet/tcp_var.h do : ac_fn_c_check_header_compile "$LINENO" "netinet/tcp_var.h" "ac_cv_header_netinet_tcp_var_h" " #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif #if HAVE_NETINET_IN_H # include #endif #include #include " if test "x$ac_cv_header_netinet_tcp_var_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NETINET_TCP_VAR_H 1 _ACEOF fi done for ac_header in net/pfvar.h do : ac_fn_c_check_header_compile "$LINENO" "net/pfvar.h" "ac_cv_header_net_pfvar_h" " #include #include #include #include " if test "x$ac_cv_header_net_pfvar_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NET_PFVAR_H 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "@%:@define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 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 ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" case $ac_cv_c_int16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF @%:@define int16_t $ac_cv_c_int16_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF @%:@define int32_t $ac_cv_c_int32_t _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes; then : else cat >>confdefs.h <<_ACEOF @%:@define mode_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "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 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF @%:@define ssize_t int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "@%:@define TM_IN_SYS_TIME 1" >>confdefs.h fi ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF @%:@define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "@%:@define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF @%:@define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) $as_echo "@%:@define _UINT64_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF @%:@define uint64_t $ac_cv_c_uint64_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "@%:@define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF @%:@define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac # Checks for library functions. for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_UNISTD_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 $as_echo_n "checking for working chown... " >&6; } if ${ac_cv_func_chown_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_chown_works=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include int main () { char *f = "conftest.chown"; struct stat before, after; if (creat (f, 0600) < 0) return 1; if (stat (f, &before) < 0) return 1; if (chown (f, (uid_t) -1, (gid_t) -1) == -1) return 1; if (stat (f, &after) < 0) return 1; return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_chown_works=yes else ac_cv_func_chown_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f conftest.chown fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 $as_echo "$ac_cv_func_chown_works" >&6; } if test $ac_cv_func_chown_works = yes; then $as_echo "@%:@define HAVE_CHOWN 1" >>confdefs.h fi for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF @%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "@%:@define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "@%:@define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "@%:@define HAVE_WORKING_FORK 1" >>confdefs.h fi for ac_func in arc4random do : ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random" if test "x$ac_cv_func_arc4random" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ARC4RANDOM 1 _ACEOF fi done for ac_func in arc4random_uniform do : ac_fn_c_check_func "$LINENO" "arc4random_uniform" "ac_cv_func_arc4random_uniform" if test "x$ac_cv_func_arc4random_uniform" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ARC4RANDOM_UNIFORM 1 _ACEOF fi done for ac_func in atexit do : ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit" if test "x$ac_cv_func_atexit" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ATEXIT 1 _ACEOF fi done for ac_func in calloc do : ac_fn_c_check_func "$LINENO" "calloc" "ac_cv_func_calloc" if test "x$ac_cv_func_calloc" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_CALLOC 1 _ACEOF fi done for ac_func in daemon do : ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon" if test "x$ac_cv_func_daemon" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_DAEMON 1 _ACEOF fi done for ac_func in endpwent do : ac_fn_c_check_func "$LINENO" "endpwent" "ac_cv_func_endpwent" if test "x$ac_cv_func_endpwent" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ENDPWENT 1 _ACEOF fi done for ac_func in epoll_wait do : ac_fn_c_check_func "$LINENO" "epoll_wait" "ac_cv_func_epoll_wait" if test "x$ac_cv_func_epoll_wait" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_EPOLL_WAIT 1 _ACEOF fi done for ac_func in ftruncate do : ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" if test "x$ac_cv_func_ftruncate" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_FTRUNCATE 1 _ACEOF fi done for ac_func in getdtablesize do : ac_fn_c_check_func "$LINENO" "getdtablesize" "ac_cv_func_getdtablesize" if test "x$ac_cv_func_getdtablesize" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETDTABLESIZE 1 _ACEOF fi done for ac_func in gethostname do : ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname" if test "x$ac_cv_func_gethostname" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETHOSTNAME 1 _ACEOF fi done for ac_func in getifaddrs do : ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" if test "x$ac_cv_func_getifaddrs" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETIFADDRS 1 _ACEOF fi done for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" if test "x$ac_cv_func_getpagesize" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETPAGESIZE 1 _ACEOF fi done for ac_func in gettimeofday do : ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETTIMEOFDAY 1 _ACEOF fi done for ac_func in kqueue do : ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue" if test "x$ac_cv_func_kqueue" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_KQUEUE 1 _ACEOF fi done for ac_func in memmove do : ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" if test "x$ac_cv_func_memmove" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_MEMMOVE 1 _ACEOF fi done for ac_func in memset do : ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" if test "x$ac_cv_func_memset" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_MEMSET 1 _ACEOF fi done for ac_func in mkdir do : ac_fn_c_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" if test "x$ac_cv_func_mkdir" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_MKDIR 1 _ACEOF fi done for ac_func in poll do : ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" if test "x$ac_cv_func_poll" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_POLL 1 _ACEOF fi done for ac_func in rmdir do : ac_fn_c_check_func "$LINENO" "rmdir" "ac_cv_func_rmdir" if test "x$ac_cv_func_rmdir" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_RMDIR 1 _ACEOF fi done for ac_func in select do : ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" if test "x$ac_cv_func_select" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SELECT 1 _ACEOF fi done for ac_func in socket do : ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" if test "x$ac_cv_func_socket" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SOCKET 1 _ACEOF fi done for ac_func in snprintf do : ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SNPRINTF 1 _ACEOF fi done for ac_func in setproctitle do : ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle" if test "x$ac_cv_func_setproctitle" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SETPROCTITLE 1 _ACEOF fi done for ac_func in strcasecmp do : ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRCASECMP 1 _ACEOF fi done for ac_func in strcasestr do : ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" if test "x$ac_cv_func_strcasestr" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRCASESTR 1 _ACEOF fi done for ac_func in strdup do : ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRDUP 1 _ACEOF fi done for ac_func in strerror do : ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRERROR 1 _ACEOF fi done for ac_func in strncasecmp do : ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" if test "x$ac_cv_func_strncasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRNCASECMP 1 _ACEOF fi done for ac_func in strtol do : ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" if test "x$ac_cv_func_strtol" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRTOL 1 _ACEOF fi done for ac_func in uname do : ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" if test "x$ac_cv_func_uname" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_UNAME 1 _ACEOF fi done # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF @%:@define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include #include " if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_SOCKADDR_SA_LEN 1" >>confdefs.h else : fi if test "x$ac_cv_header_net_pfvar_h" == xyes; then ac_fn_c_check_member "$LINENO" "struct pfioc_trans_e" "type" "ac_cv_member_struct_pfioc_trans_e_type" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pfioc_trans_e_type" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PFIOC_TRANS_E_TYPE 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pfioc_trans_e" "rs_num" "ac_cv_member_struct_pfioc_trans_e_rs_num" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pfioc_trans_e_rs_num" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pf_rule" "nat" "ac_cv_member_struct_pf_rule_nat" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pf_rule_nat" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PF_RULE_NAT 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pf_rule" "rdr" "ac_cv_member_struct_pf_rule_rdr" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pf_rule_rdr" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PF_RULE_RDR 1" >>confdefs.h else : fi fi # Check for structs { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ip6_ext" >&5 $as_echo_n "checking for struct ip6_ext... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #include ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRUCT_IP6_EXT 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } #AC_DEFINE_UNQUOTED([HAVE_STRUCT_IP6_EXT], 0, [Define to 1 if you have the `ip6_ext' struct.]) fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # These libraries have to be explicitly linked in OpenSolaris { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 $as_echo_n "checking for library containing getaddrinfo... " >&6; } if ${ac_cv_search_getaddrinfo+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getaddrinfo (); int main () { return getaddrinfo (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib -lnsl $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getaddrinfo=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_getaddrinfo+:} false; then : break fi done if ${ac_cv_search_getaddrinfo+:} false; then : else ac_cv_search_getaddrinfo=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 $as_echo "$ac_cv_search_getaddrinfo" >&6; } ac_res=$ac_cv_search_getaddrinfo if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 $as_echo_n "checking for library containing inet_ntop... " >&6; } if ${ac_cv_search_inet_ntop+:} 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 inet_ntop (); int main () { return inet_ntop (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib -lsocket $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_ntop=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_ntop+:} false; then : break fi done if ${ac_cv_search_inet_ntop+:} false; then : else ac_cv_search_inet_ntop=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 $as_echo "$ac_cv_search_inet_ntop" >&6; } ac_res=$ac_cv_search_inet_ntop if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # Some systems need -lm to use sqrt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sqrt" >&5 $as_echo_n "checking for library containing sqrt... " >&6; } if ${ac_cv_search_sqrt+:} 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 sqrt (); int main () { return sqrt (); ; return 0; } _ACEOF for ac_lib in '' m; 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_sqrt=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_sqrt+:} false; then : break fi done if ${ac_cv_search_sqrt+:} false; then : else ac_cv_search_sqrt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sqrt" >&5 $as_echo "$ac_cv_search_sqrt" >&6; } ac_res=$ac_cv_search_sqrt if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi AX_CHECK_OPENSSL( AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have OpenSSL]) CFLAGS="$CFLAGS $OPENSSL_INCLUDES") AX_GCC_BUILTIN(__builtin_clz) # No thread support @%:@ Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then : enableval=$enable_threads; fi if test "x$enable_threads" != xno; then AX_PTHREAD( AC_DEFINE([HAVE_PTHREAD], [1], [Define to 1 if you have pthread])) fi ac_config_files="$ac_config_files Makefile scamper/Makefile utils/Makefile utils/sc_ally/Makefile utils/sc_analysis_dump/Makefile utils/sc_attach/Makefile utils/sc_bdrmap/Makefile utils/sc_filterpolicy/Makefile utils/sc_ipiddump/Makefile utils/sc_prefixscan/Makefile utils/sc_radargun/Makefile utils/sc_remoted/Makefile utils/sc_speedtrap/Makefile utils/sc_tbitblind/Makefile utils/sc_tracediff/Makefile" if test "x$with_sc_uptime" != xno; then ac_config_files="$ac_config_files utils/sc_uptime/Makefile" fi ac_config_files="$ac_config_files utils/sc_warts2csv/Makefile utils/sc_warts2json/Makefile utils/sc_warts2pcap/Makefile utils/sc_warts2text/Makefile utils/sc_wartscat/Makefile utils/sc_wartsdump/Makefile utils/sc_wartsfix/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIB@&t@OBJS; 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 LIB@&t@OBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_SC_UPTIME_TRUE}" && test -z "${WITH_SC_UPTIME_FALSE}"; then as_fn_error $? "conditional \"WITH_SC_UPTIME\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in @%:@( *posix*) : set -o posix ;; @%:@( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in @%:@( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in @%:@(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH @%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] @%:@ ---------------------------------------- @%:@ Output "`basename @S|@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 @S|@? 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 @S|@as_val. Take advantage of shells that can avoid forks. The arguments @%:@ must be portable across @S|@(()) 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 "@S|@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 scamper $as_me 20171204, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ scamper config.status 20171204 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX @%:@@%:@ Running $as_me. @%:@@%:@ _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "scamper/Makefile") CONFIG_FILES="$CONFIG_FILES scamper/Makefile" ;; "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "utils/sc_ally/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_ally/Makefile" ;; "utils/sc_analysis_dump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_analysis_dump/Makefile" ;; "utils/sc_attach/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_attach/Makefile" ;; "utils/sc_bdrmap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_bdrmap/Makefile" ;; "utils/sc_filterpolicy/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_filterpolicy/Makefile" ;; "utils/sc_ipiddump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_ipiddump/Makefile" ;; "utils/sc_prefixscan/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_prefixscan/Makefile" ;; "utils/sc_radargun/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_radargun/Makefile" ;; "utils/sc_remoted/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_remoted/Makefile" ;; "utils/sc_speedtrap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_speedtrap/Makefile" ;; "utils/sc_tbitblind/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_tbitblind/Makefile" ;; "utils/sc_tracediff/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_tracediff/Makefile" ;; "utils/sc_uptime/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_uptime/Makefile" ;; "utils/sc_warts2csv/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2csv/Makefile" ;; "utils/sc_warts2json/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2json/Makefile" ;; "utils/sc_warts2pcap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2pcap/Makefile" ;; "utils/sc_warts2text/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2text/Makefile" ;; "utils/sc_wartscat/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartscat/Makefile" ;; "utils/sc_wartsdump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartsdump/Makefile" ;; "utils/sc_wartsfix/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartsfix/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi scamper-cvs-20171204/autom4te.cache/traces.0000644 001751 000000 00000362222 13211200035 020253 0ustar00mjlwheel000000 000000 m4trace:/usr/local/share/aclocal/libtool.m4:61: -1- AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ]) m4trace:/usr/local/share/aclocal/libtool.m4:99: -1- AU_DEFUN([AC_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:99: -1- AC_DEFUN([AC_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:100: -1- AU_DEFUN([AM_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:100: -1- AC_DEFUN([AM_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:619: -1- AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ]) m4trace:/usr/local/share/aclocal/libtool.m4:812: -1- AC_DEFUN([LT_SUPPORTED_TAG], []) m4trace:/usr/local/share/aclocal/libtool.m4:823: -1- AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ]) m4trace:/usr/local/share/aclocal/libtool.m4:915: -1- AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) m4trace:/usr/local/share/aclocal/libtool.m4:915: -1- AC_DEFUN([AC_LIBTOOL_CXX], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_CXX' is obsolete. You should run autoupdate.])dnl LT_LANG(C++)]) m4trace:/usr/local/share/aclocal/libtool.m4:916: -1- AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) m4trace:/usr/local/share/aclocal/libtool.m4:916: -1- AC_DEFUN([AC_LIBTOOL_F77], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_F77' is obsolete. You should run autoupdate.])dnl LT_LANG(Fortran 77)]) m4trace:/usr/local/share/aclocal/libtool.m4:917: -1- AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) m4trace:/usr/local/share/aclocal/libtool.m4:917: -1- AC_DEFUN([AC_LIBTOOL_FC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_FC' is obsolete. You should run autoupdate.])dnl LT_LANG(Fortran)]) m4trace:/usr/local/share/aclocal/libtool.m4:918: -1- AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) m4trace:/usr/local/share/aclocal/libtool.m4:918: -1- AC_DEFUN([AC_LIBTOOL_GCJ], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_GCJ' is obsolete. You should run autoupdate.])dnl LT_LANG(Java)]) m4trace:/usr/local/share/aclocal/libtool.m4:919: -1- AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) m4trace:/usr/local/share/aclocal/libtool.m4:919: -1- AC_DEFUN([AC_LIBTOOL_RC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_RC' is obsolete. You should run autoupdate.])dnl LT_LANG(Windows Resource)]) m4trace:/usr/local/share/aclocal/libtool.m4:1247: -1- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) m4trace:/usr/local/share/aclocal/libtool.m4:1578: -1- AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ]) m4trace:/usr/local/share/aclocal/libtool.m4:1620: -1- AU_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1620: -1- AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_COMPILER_OPTION' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1629: -1- AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ]) m4trace:/usr/local/share/aclocal/libtool.m4:1664: -1- AU_DEFUN([AC_LIBTOOL_LINKER_OPTION], [m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1664: -1- AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_LINKER_OPTION' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1671: -1- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ]) m4trace:/usr/local/share/aclocal/libtool.m4:1810: -1- AU_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1810: -1- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_SYS_MAX_CMD_LEN' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1921: -1- AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ]) m4trace:/usr/local/share/aclocal/libtool.m4:2046: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:2046: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN_SELF' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3155: -1- AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ]) m4trace:/usr/local/share/aclocal/libtool.m4:3217: -1- AU_DEFUN([AC_PATH_TOOL_PREFIX], [m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3217: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_DIAGNOSE([obsolete], [The macro `AC_PATH_TOOL_PREFIX' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3240: -1- AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ]) m4trace:/usr/local/share/aclocal/libtool.m4:3754: -1- AU_DEFUN([AM_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3754: -1- AC_DEFUN([AM_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_NM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3755: -1- AU_DEFUN([AC_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3755: -1- AC_DEFUN([AC_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_NM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3826: -1- AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ]) m4trace:/usr/local/share/aclocal/libtool.m4:3840: -1- AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ]) m4trace:/usr/local/share/aclocal/libtool.m4:3859: -1- AU_DEFUN([AC_CHECK_LIBM], [m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3859: -1- AC_DEFUN([AC_CHECK_LIBM], [AC_DIAGNOSE([obsolete], [The macro `AC_CHECK_LIBM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8122: -1- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) m4trace:/usr/local/share/aclocal/libtool.m4:8131: -1- AU_DEFUN([LT_AC_PROG_GCJ], [m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8131: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_GCJ' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8138: -1- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) m4trace:/usr/local/share/aclocal/libtool.m4:8145: -1- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) m4trace:/usr/local/share/aclocal/libtool.m4:8150: -1- AU_DEFUN([LT_AC_PROG_RC], [m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8150: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_RC' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8270: -1- AU_DEFUN([LT_AC_PROG_SED], [m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8270: -1- AC_DEFUN([LT_AC_PROG_SED], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_SED' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) m4trace:/usr/local/share/aclocal/ltargz.m4:12: -1- AC_DEFUN([LT_FUNC_ARGZ], [ AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for 'error_t' if it is not otherwise available.]) AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h does not typedef error_t.])], [#if defined(HAVE_ARGZ_H) # include #endif]) LT_ARGZ_H= AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify], [], [LT_ARGZ_H=lt__argz.h; AC_LIBOBJ([lt__argz])]) dnl if have system argz functions, allow forced use of dnl libltdl-supplied implementation (and default to do so dnl on "known bad" systems). Could use a runtime check, but dnl (a) detecting malloc issues is notoriously unreliable dnl (b) only known system that declares argz functions, dnl provides them, yet they are broken, is cygwin dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) dnl So, it's more straightforward simply to special case dnl this for known bad systems. AS_IF([test -z "$LT_ARGZ_H"], [AC_CACHE_CHECK( [if argz actually works], [lt_cv_sys_argz_works], [[case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test no != "$cross_compiling"; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test 1 -lt "$lt_os_major" \ || { test 1 -eq "$lt_os_major" \ && { test 5 -lt "$lt_os_minor" \ || { test 5 -eq "$lt_os_minor" \ && test 24 -lt "$lt_os_micro"; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) AS_IF([test yes = "$lt_cv_sys_argz_works"], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [LT_ARGZ_H=lt__argz.h AC_LIBOBJ([lt__argz])])]) AC_SUBST([LT_ARGZ_H]) ]) m4trace:/usr/local/share/aclocal/ltdl.m4:16: -1- AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) _$0($*) ]) m4trace:/usr/local/share/aclocal/ltdl.m4:68: -1- AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ]) m4trace:/usr/local/share/aclocal/ltdl.m4:81: -1- AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) m4trace:/usr/local/share/aclocal/ltdl.m4:81: -1- AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBLTDL_CONVENIENCE' is obsolete. You should run autoupdate.])dnl _LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) m4trace:/usr/local/share/aclocal/ltdl.m4:124: -1- AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ]) m4trace:/usr/local/share/aclocal/ltdl.m4:137: -1- AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) m4trace:/usr/local/share/aclocal/ltdl.m4:137: -1- AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBLTDL_INSTALLABLE' is obsolete. You should run autoupdate.])dnl _LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) m4trace:/usr/local/share/aclocal/ltdl.m4:213: -1- AC_DEFUN([_LT_LIBOBJ], [ m4_pattern_allow([^_LT_LIBOBJS$]) _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" ]) m4trace:/usr/local/share/aclocal/ltdl.m4:226: -1- AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) dnl We need to keep our own list of libobjs separate from our parent project, dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while dnl we look for our own LIBOBJs. m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) m4_pushdef([AC_LIBSOURCES]) dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: m4_if(_LTDL_MODE, [], [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) AC_ARG_WITH([included_ltdl], [AS_HELP_STRING([--with-included-ltdl], [use the GNU ltdl sources included here])]) if test yes != "$with_included_ltdl"; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_DECL([lt_dlinterface_register], [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], [with_included_ltdl=no], [with_included_ltdl=yes])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT #include ])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT] ) fi dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE dnl was called yet, then for old times' sake, we assume libltdl is in an dnl eponymous directory: AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) AC_ARG_WITH([ltdl_include], [AS_HELP_STRING([--with-ltdl-include=DIR], [use the ltdl headers installed in DIR])]) if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else AC_MSG_ERROR([invalid ltdl include directory: '$with_ltdl_include']) fi else with_ltdl_include=no fi AC_ARG_WITH([ltdl_lib], [AS_HELP_STRING([--with-ltdl-lib=DIR], [use the libltdl.la installed in DIR])]) if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else AC_MSG_ERROR([invalid ltdl library directory: '$with_ltdl_lib']) fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) m4_case(m4_default(_LTDL_TYPE, [convenience]), [convenience], [_LTDL_CONVENIENCE], [installable], [_LTDL_INSTALLABLE], [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. AC_DEFINE([HAVE_LTDL], [1], [Define this if a modern libltdl is already installed]) LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) AC_MSG_ERROR(['--with-ltdl-include' and '--with-ltdl-lib' options must be used together]) ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL=-I$with_ltdl_include ;; esac INCLTDL=$LTDLINCL # Report our decision... AC_MSG_CHECKING([where to find libltdl headers]) AC_MSG_RESULT([$LTDLINCL]) AC_MSG_CHECKING([where to find libltdl library]) AC_MSG_RESULT([$LIBLTDL]) _LTDL_SETUP dnl restore autoconf definition. m4_popdef([AC_LIBOBJ]) m4_popdef([AC_LIBSOURCES]) AC_CONFIG_COMMANDS_PRE([ _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) ]) # Only expand once: m4_define([LTDL_INIT]) ]) m4trace:/usr/local/share/aclocal/ltdl.m4:352: -1- AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:352: -1- AC_DEFUN([AC_LIB_LTDL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIB_LTDL' is obsolete. You should run autoupdate.])dnl LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:353: -1- AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:353: -1- AC_DEFUN([AC_WITH_LTDL], [AC_DIAGNOSE([obsolete], [The macro `AC_WITH_LTDL' is obsolete. You should run autoupdate.])dnl LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:354: -1- AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:354: -1- AC_DEFUN([LT_WITH_LTDL], [AC_DIAGNOSE([obsolete], [The macro `LT_WITH_LTDL' is obsolete. You should run autoupdate.])dnl LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:367: -1- AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_SYS_MODULE_EXT])dnl AC_REQUIRE([LT_SYS_MODULE_PATH])dnl AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl AC_REQUIRE([LT_LIB_DLLOAD])dnl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl AC_REQUIRE([LT_FUNC_ARGZ])dnl m4_require([_LT_CHECK_OBJDIR])dnl m4_require([_LT_HEADER_DLFCN])dnl m4_require([_LT_CHECK_DLPREOPEN])dnl m4_require([_LT_DECL_SED])dnl dnl Don't require this, or it will be expanded earlier than the code dnl that sets the variables it relies on: _LT_ENABLE_INSTALL dnl _LTDL_MODE specific code must be called at least once: _LTDL_MODE_DISPATCH # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). AC_CONFIG_COMMANDS_PRE([dnl m4_pattern_allow([^LT_CONFIG_H$])dnl m4_ifset([AH_HEADER], [LT_CONFIG_H=AH_HEADER], [m4_ifset([AC_LIST_HEADERS], [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's|^[[ ]]*||;s|[[ :]].*$||'`], [])])]) AC_SUBST([LT_CONFIG_H]) AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) m4_pattern_allow([LT_LIBEXT])dnl AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) name= eval "lt_libprefix=\"$libname_spec\"" m4_pattern_allow([LT_LIBPREFIX])dnl AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) name=ltdl eval "LTDLOPEN=\"$libname_spec\"" AC_SUBST([LTDLOPEN]) ]) m4trace:/usr/local/share/aclocal/ltdl.m4:443: -1- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [lt_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this 'case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[[4-9]]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; bitrig*) lt_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 lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[[12345]]*|irix6.[[01]]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say 'no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to 'yes'. Without it, it would be 'no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say 'yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test yes != "$lt_cv_sys_dlopen_deplibs"; then AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], [Define if the OS needs help to load dependent libraries for dlopen().]) fi ]) m4trace:/usr/local/share/aclocal/ltdl.m4:545: -1- AU_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:545: -1- AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYS_DLOPEN_DEPLIBS' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:552: -1- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([what extension is used for runtime loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_MODULE_EXT])dnl AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for runtime loadable modules, say, ".so".]) fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_SHARED_EXT])dnl AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"], [Define to the shared library suffix, say, ".dylib".]) fi if test -n "$shared_archive_member_spec"; then m4_pattern_allow([LT_SHARED_LIB_MEMBER])dnl AC_DEFINE_UNQUOTED([LT_SHARED_LIB_MEMBER], ["($shared_archive_member_spec.o)"], [Define to the shared archive member specification, say "(shr.o)".]) fi ]) m4trace:/usr/local/share/aclocal/ltdl.m4:580: -1- AU_DEFUN([AC_LTDL_SHLIBEXT], [m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:580: -1- AC_DEFUN([AC_LTDL_SHLIBEXT], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBEXT' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:587: -1- AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([what variable specifies run-time module search path], [lt_cv_module_path_var], [lt_cv_module_path_var=$shlibpath_var]) if test -n "$lt_cv_module_path_var"; then m4_pattern_allow([LT_MODULE_PATH_VAR])dnl AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], [Define to the name of the environment variable that determines the run-time module search path.]) fi ]) m4trace:/usr/local/share/aclocal/ltdl.m4:599: -1- AU_DEFUN([AC_LTDL_SHLIBPATH], [m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:599: -1- AC_DEFUN([AC_LTDL_SHLIBPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBPATH' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:606: -1- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([for the default library search path], [lt_cv_sys_dlsearch_path], [lt_cv_sys_dlsearch_path=$sys_lib_dlsearch_path_spec]) if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path=$dir else sys_dlsearch_path=$sys_dlsearch_path$PATH_SEPARATOR$dir fi done m4_pattern_allow([LT_DLSEARCH_PATH])dnl AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], [Define to the system default library search path.]) fi ]) m4trace:/usr/local/share/aclocal/ltdl.m4:627: -1- AU_DEFUN([AC_LTDL_SYSSEARCHPATH], [m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:627: -1- AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYSSEARCHPATH' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:653: -1- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) AC_LANG_PUSH([C]) lt_dlload_save_LIBS=$LIBS LIBADD_DLOPEN= AC_SEARCH_LIBS([dlopen], [dl], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) if test "$ac_cv_search_dlopen" != "none required"; then LIBADD_DLOPEN=-ldl fi libltdl_cv_lib_dl_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H # include #endif ]], [[dlopen(0, 0);]])], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN=-lsvld libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen" then lt_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" AC_CHECK_FUNCS([dlerror]) LIBS=$lt_save_LIBS fi AC_SUBST([LIBADD_DLOPEN]) LIBADD_SHL_LOAD= AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD=-ldld])]) AC_SUBST([LIBADD_SHL_LOAD]) case $host_os in darwin[[1567]].*) # We only want this for pre-Mac OS X 10.4. AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | pw32*) AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) AC_SUBST([LIBADD_DLD_LINK]) m4_pattern_allow([^LT_DLPREOPEN$]) LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done AC_DEFINE([HAVE_LIBDLLOADER], [1], [Define if libdlloader will be built on this platform]) fi AC_SUBST([LT_DLPREOPEN]) dnl This isn't used anymore, but set it for backwards compatibility LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" AC_SUBST([LIBADD_DL]) LIBS=$lt_dlload_save_LIBS AC_LANG_POP ]) m4trace:/usr/local/share/aclocal/ltdl.m4:748: -1- AU_DEFUN([AC_LTDL_DLLIB], [m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:748: -1- AC_DEFUN([AC_LTDL_DLLIB], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLLIB' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:756: -1- AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([for _ prefix in compiled symbols], [lt_cv_sys_symbol_underscore], [lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.c >&AS_MESSAGE_LOG_FD fi rm -rf conftest* ]) sys_symbol_underscore=$lt_cv_sys_symbol_underscore AC_SUBST([sys_symbol_underscore]) ]) m4trace:/usr/local/share/aclocal/ltdl.m4:793: -1- AU_DEFUN([AC_LTDL_SYMBOL_USCORE], [m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:793: -1- AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYMBOL_USCORE' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:800: -1- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([_LT_COMPILER_PIC])dnl for lt_prog_compiler_wl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl for lt_cv_sys_symbol_underscore AC_REQUIRE([LT_SYS_MODULE_EXT])dnl for libltdl_cv_shlibext if test yes = "$lt_cv_sys_symbol_underscore"; then if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen"; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], [libltdl_cv_need_uscore], [libltdl_cv_need_uscore=unknown dlsym_uscore_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" libname=conftmod # stay within 8.3 filename limits! cat >$libname.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; }] _LT_EOF # ltfn_module_cmds module_cmds # Execute tilde-delimited MODULE_CMDS with environment primed for # $module_cmds or $archive_cmds type content. ltfn_module_cmds () {( # subshell avoids polluting parent global environment module_cmds_save_ifs=$IFS; IFS='~' for cmd in @S|@1; do IFS=$module_cmds_save_ifs libobjs=$libname.$ac_objext; lib=$libname$libltdl_cv_shlibext rpath=/not-exists; soname=$libname$libltdl_cv_shlibext; output_objdir=. major=; versuffix=; verstring=; deplibs= ECHO=echo; wl=$lt_prog_compiler_wl; allow_undefined_flag= eval $cmd done IFS=$module_cmds_save_ifs )} # Compile a loadable module using libtool macro expansion results. $CC $pic_flag -c $libname.$ac_ext ltfn_module_cmds "${module_cmds:-$archive_cmds}" # Try to fetch fnord with dlsym(). libltdl_dlunknown=0; libltdl_dlnouscore=1; libltdl_dluscore=2 cat >conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifndef RTLD_GLOBAL # ifdef DL_GLOBAL # define RTLD_GLOBAL DL_GLOBAL # else # define RTLD_GLOBAL 0 # endif #endif #ifndef RTLD_NOW # ifdef DL_NOW # define RTLD_NOW DL_NOW # else # define RTLD_NOW 0 # endif #endif int main () { void *handle = dlopen ("`pwd`/$libname$libltdl_cv_shlibext", RTLD_GLOBAL|RTLD_NOW); int status = $libltdl_dlunknown; if (handle) { if (dlsym (handle, "fnord")) status = $libltdl_dlnouscore; else { if (dlsym (handle, "_fnord")) status = $libltdl_dluscore; else puts (dlerror ()); } dlclose (handle); } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null libltdl_status=$? case x$libltdl_status in x$libltdl_dlnouscore) libltdl_cv_need_uscore=no ;; x$libltdl_dluscore) libltdl_cv_need_uscore=yes ;; x*) libltdl_cv_need_uscore=unknown ;; esac fi rm -rf conftest* $libname* LIBS=$dlsym_uscore_save_LIBS ]) fi fi if test yes = "$libltdl_cv_need_uscore"; then AC_DEFINE([NEED_USCORE], [1], [Define if dlsym() requires a leading underscore in symbol names.]) fi ]) m4trace:/usr/local/share/aclocal/ltdl.m4:907: -1- AU_DEFUN([AC_LTDL_DLSYM_USCORE], [m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:907: -1- AC_DEFUN([AC_LTDL_DLSYM_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLSYM_USCORE' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) m4trace:/usr/local/share/aclocal/ltoptions.m4:14: -1- AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) m4trace:/usr/local/share/aclocal/ltoptions.m4:113: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:113: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:148: -1- AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:148: -1- AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. You should run autoupdate.])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:197: -1- AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:201: -1- AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:205: -1- AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:205: -1- AC_DEFUN([AM_ENABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_SHARED' is obsolete. You should run autoupdate.])dnl AC_ENABLE_SHARED($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:206: -1- AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:206: -1- AC_DEFUN([AM_DISABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_SHARED' is obsolete. You should run autoupdate.])dnl AC_DISABLE_SHARED($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:251: -1- AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:255: -1- AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:259: -1- AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:259: -1- AC_DEFUN([AM_ENABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_STATIC' is obsolete. You should run autoupdate.])dnl AC_ENABLE_STATIC($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:260: -1- AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:260: -1- AC_DEFUN([AM_DISABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_STATIC' is obsolete. You should run autoupdate.])dnl AC_DISABLE_STATIC($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:305: -1- AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:305: -1- AC_DEFUN([AC_ENABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_ENABLE_FAST_INSTALL' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:312: -1- AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:312: -1- AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_DISABLE_FAST_INSTALL' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:411: -1- AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:411: -1- AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_PICMODE' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltsugar.m4:14: -1- AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) m4trace:/usr/local/share/aclocal/ltversion.m4:18: -1- AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:37: -1- AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:41: -1- AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:42: -1- AC_DEFUN([_LT_AC_SHELL_INIT]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:43: -1- AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:45: -1- AC_DEFUN([_LT_AC_TAGVAR]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:46: -1- AC_DEFUN([AC_LTDL_ENABLE_INSTALL]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:47: -1- AC_DEFUN([AC_LTDL_PREOPEN]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:48: -1- AC_DEFUN([_LT_AC_SYS_COMPILER]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:49: -1- AC_DEFUN([_LT_AC_LOCK]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:50: -1- AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:51: -1- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:52: -1- AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:53: -1- AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:54: -1- AC_DEFUN([AC_LIBTOOL_OBJDIR]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:55: -1- AC_DEFUN([AC_LTDL_OBJDIR]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:56: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:57: -1- AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:58: -1- AC_DEFUN([AC_PATH_MAGIC]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:59: -1- AC_DEFUN([AC_PROG_LD_GNU]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:60: -1- AC_DEFUN([AC_PROG_LD_RELOAD_FLAG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:61: -1- AC_DEFUN([AC_DEPLIBS_CHECK_METHOD]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:62: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:63: -1- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:64: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:65: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:66: -1- AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:67: -1- AC_DEFUN([LT_AC_PROG_EGREP]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:72: -1- AC_DEFUN([_AC_PROG_LIBTOOL]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:73: -1- AC_DEFUN([AC_LIBTOOL_SETUP]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:74: -1- AC_DEFUN([_LT_AC_CHECK_DLFCN]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:75: -1- AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:76: -1- AC_DEFUN([_LT_AC_TAGCONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:78: -1- AC_DEFUN([_LT_AC_LANG_CXX]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:79: -1- AC_DEFUN([_LT_AC_LANG_F77]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:80: -1- AC_DEFUN([_LT_AC_LANG_GCJ]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:81: -1- AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:82: -1- AC_DEFUN([_LT_AC_LANG_C_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:83: -1- AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:84: -1- AC_DEFUN([_LT_AC_LANG_CXX_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:85: -1- AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:86: -1- AC_DEFUN([_LT_AC_LANG_F77_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:87: -1- AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:88: -1- AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:89: -1- AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:90: -1- AC_DEFUN([_LT_AC_LANG_RC_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:91: -1- AC_DEFUN([AC_LIBTOOL_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:92: -1- AC_DEFUN([_LT_AC_FILE_LTDLL_C]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:94: -1- AC_DEFUN([_LT_AC_PROG_CXXCPP]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:97: -1- AC_DEFUN([_LT_PROG_F77]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:98: -1- AC_DEFUN([_LT_PROG_FC]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:99: -1- AC_DEFUN([_LT_PROG_CXX]) m4trace:/usr/local/share/aclocal-1.15/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' 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.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) m4trace:/usr/local/share/aclocal-1.15/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) m4trace:/usr/local/share/aclocal-1.15/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) m4trace:/usr/local/share/aclocal-1.15/cond.m4:12: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) m4trace:/usr/local/share/aclocal-1.15/depend.m4:26: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) m4trace:/usr/local/share/aclocal-1.15/depend.m4:163: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) m4trace:/usr/local/share/aclocal-1.15/depend.m4:171: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) m4trace:/usr/local/share/aclocal-1.15/depout.m4:12: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ]) m4trace:/usr/local/share/aclocal-1.15/depout.m4:71: -1- 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"]) ]) m4trace:/usr/local/share/aclocal-1.15/init.m4:29: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) m4trace:/usr/local/share/aclocal-1.15/init.m4:186: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) m4trace:/usr/local/share/aclocal-1.15/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) m4trace:/usr/local/share/aclocal-1.15/lead-dot.m4:10: -1- 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])]) m4trace:/usr/local/share/aclocal-1.15/make.m4:12: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) m4trace:/usr/local/share/aclocal-1.15/missing.m4:11: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) m4trace:/usr/local/share/aclocal-1.15/missing.m4:20: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) m4trace:/usr/local/share/aclocal-1.15/options.m4:11: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) m4trace:/usr/local/share/aclocal-1.15/options.m4:17: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) m4trace:/usr/local/share/aclocal-1.15/options.m4:23: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) m4trace:/usr/local/share/aclocal-1.15/options.m4:29: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) m4trace:/usr/local/share/aclocal-1.15/prog-cc-c-o.m4:12: -1- AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) m4trace:/usr/local/share/aclocal-1.15/prog-cc-c-o.m4:47: -1- AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) m4trace:/usr/local/share/aclocal-1.15/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) m4trace:/usr/local/share/aclocal-1.15/sanity.m4:11: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) m4trace:/usr/local/share/aclocal-1.15/silent.m4:12: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) m4trace:/usr/local/share/aclocal-1.15/strip.m4:17: -1- 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])]) m4trace:/usr/local/share/aclocal-1.15/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) m4trace:/usr/local/share/aclocal-1.15/substnot.m4:17: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) m4trace:/usr/local/share/aclocal-1.15/tar.m4:23: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:3: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) m4trace:configure.ac:3: -1- m4_pattern_allow([^AS_FLAGS$]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?AS_]) m4trace:configure.ac:3: -1- m4_pattern_allow([^SHELL$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PATH_SEPARATOR$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_URL$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^exec_prefix$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^prefix$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^program_transform_name$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^bindir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^sbindir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^libexecdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^datarootdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^datadir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^sysconfdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^sharedstatedir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^localstatedir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^includedir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^oldincludedir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^docdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^infodir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^htmldir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^dvidir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^pdfdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^psdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^libdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^localedir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^mandir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_URL$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^DEFS$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^ECHO_C$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^ECHO_N$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^ECHO_T$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^build_alias$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^host_alias$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^target_alias$]) m4trace:configure.ac:5: -1- AC_CONFIG_MACRO_DIR([m4]) m4trace:configure.ac:7: -1- AM_INIT_AUTOMAKE m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) m4trace:configure.ac:7: -1- AM_SET_CURRENT_AUTOMAKE_VERSION m4trace:configure.ac:7: -1- AM_AUTOMAKE_VERSION([1.15.1]) m4trace:configure.ac:7: -1- _AM_AUTOCONF_VERSION([2.69]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_DATA$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^am__isrc$]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__isrc]) m4trace:configure.ac:7: -1- m4_pattern_allow([^CYGPATH_W$]) m4trace:configure.ac:7: -1- _AM_SET_OPTIONS([]) m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])]) m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-define]) m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) m4trace:configure.ac:7: -1- AM_SANITY_CHECK m4trace:configure.ac:7: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) m4trace:configure.ac:7: -1- AM_MISSING_HAS_RUN m4trace:configure.ac:7: -1- AM_AUX_DIR_EXPAND m4trace:configure.ac:7: -1- m4_pattern_allow([^ACLOCAL$]) m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOCONF$]) m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOMAKE$]) m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOHEADER$]) m4trace:configure.ac:7: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) m4trace:configure.ac:7: -1- m4_pattern_allow([^MAKEINFO$]) m4trace:configure.ac:7: -1- AM_PROG_INSTALL_SH m4trace:configure.ac:7: -1- m4_pattern_allow([^install_sh$]) m4trace:configure.ac:7: -1- AM_PROG_INSTALL_STRIP m4trace:configure.ac:7: -1- m4_pattern_allow([^STRIP$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^MKDIR_P$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^mkdir_p$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AWK$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^SET_MAKE$]) m4trace:configure.ac:7: -1- AM_SET_LEADING_DOT m4trace:configure.ac:7: -1- m4_pattern_allow([^am__leading_dot$]) m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-ustar]) m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-pax]) m4trace:configure.ac:7: -1- _AM_PROG_TAR([v7]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AMTAR$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^am__tar$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^am__untar$]) m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-dependencies]) m4trace:configure.ac:7: -1- AM_SILENT_RULES m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_V$]) m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_V]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_V]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_V$]) m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_DEFAULT_V]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_BACKSLASH$]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) m4trace:configure.ac:10: -1- AC_PROG_LIBTOOL m4trace:configure.ac:10: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. You should run autoupdate.], [/usr/local/share/aclocal/libtool.m4:99: AC_PROG_LIBTOOL is expanded from... configure.ac:10: the top level]) m4trace:configure.ac:10: -1- LT_INIT m4trace:configure.ac:10: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) m4trace:configure.ac:10: -1- LTOPTIONS_VERSION m4trace:configure.ac:10: -1- LTSUGAR_VERSION m4trace:configure.ac:10: -1- LTVERSION_VERSION m4trace:configure.ac:10: -1- LTOBSOLETE_VERSION m4trace:configure.ac:10: -1- _LT_PROG_LTMAIN m4trace:configure.ac:10: -1- m4_pattern_allow([^LIBTOOL$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build_cpu$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build_vendor$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build_os$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host_cpu$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host_vendor$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host_os$]) m4trace:configure.ac:10: -1- _LT_PREPARE_SED_QUOTE_VARS m4trace:configure.ac:10: -1- _LT_PROG_ECHO_BACKSLASH m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CFLAGS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^ac_ct_CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^EXEEXT$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OBJEXT$]) m4trace:configure.ac:10: -1- _AM_PROG_CC_C_O m4trace:configure.ac:10: -1- AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) m4trace:configure.ac:10: -1- _AM_DEPENDENCIES([CC]) m4trace:configure.ac:10: -1- AM_SET_DEPDIR m4trace:configure.ac:10: -1- m4_pattern_allow([^DEPDIR$]) m4trace:configure.ac:10: -1- AM_OUTPUT_DEPENDENCY_COMMANDS m4trace:configure.ac:10: -1- AM_MAKE_INCLUDE m4trace:configure.ac:10: -1- m4_pattern_allow([^am__include$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__quote$]) m4trace:configure.ac:10: -1- AM_DEP_TRACK m4trace:configure.ac:10: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AMDEP_TRUE$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AMDEP_FALSE$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__nodep$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([am__nodep]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CCDEPMODE$]) m4trace:configure.ac:10: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) m4trace:configure.ac:10: -1- LT_PATH_LD m4trace:configure.ac:10: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:10: -1- AC_PROG_EGREP m4trace:configure.ac:10: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^EGREP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^FGREP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LD$]) m4trace:configure.ac:10: -1- LT_PATH_NM m4trace:configure.ac:10: -1- m4_pattern_allow([^DUMPBIN$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DUMPBIN$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^NM$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LN_S$]) m4trace:configure.ac:10: -1- LT_CMD_MAX_LEN m4trace:configure.ac:10: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AR$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^ac_ct_AR$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^STRIP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^RANLIB$]) m4trace:configure.ac:10: -1- _LT_WITH_SYSROOT m4trace:configure.ac:10: -1- m4_pattern_allow([LT_OBJDIR]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LT_OBJDIR$]) m4trace:configure.ac:10: -1- _LT_CC_BASENAME([$compiler]) m4trace:configure.ac:10: -1- _LT_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH]) m4trace:configure.ac:10: -1- _LT_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH]) m4trace:configure.ac:10: -1- LT_SUPPORTED_TAG([CC]) m4trace:configure.ac:10: -1- _LT_COMPILER_BOILERPLATE m4trace:configure.ac:10: -1- _LT_LINKER_BOILERPLATE m4trace:configure.ac:10: -1- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"]) m4trace:configure.ac:10: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, ) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, )], [$_LT_TAGVAR(lt_prog_compiler_pic, )@&t@m4_if([],[],[ -DPIC],[m4_if([],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, ) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, )=" $_LT_TAGVAR(lt_prog_compiler_pic, )" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, )= _LT_TAGVAR(lt_prog_compiler_can_build_shared, )=no]) m4trace:configure.ac:10: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, )=]) m4trace:configure.ac:10: -1- m4_pattern_allow([^MANIFEST_TOOL$]) m4trace:configure.ac:10: -1- _LT_DLL_DEF_P([$export_symbols]) m4trace:configure.ac:10: -1- _LT_DLL_DEF_P([$export_symbols]) m4trace:configure.ac:10: -1- _LT_REQUIRED_DARWIN_CHECKS m4trace:configure.ac:10: -1- m4_pattern_allow([^DSYMUTIL$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^NMEDIT$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LIPO$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OTOOL$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OTOOL64$]) m4trace:configure.ac:10: -1- _LT_LINKER_OPTION([if $CC understands -b], [lt_cv_prog_compiler__b], [-b], [_LT_TAGVAR(archive_cmds, )='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, )='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags']) m4trace:configure.ac:10: -1- m4_pattern_allow([^LT_SYS_LIBRARY_PATH$]) m4trace:configure.ac:10: -1- LT_SYS_DLOPEN_SELF m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^STDC_HEADERS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^HAVE_DLFCN_H$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CFLAGS$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^ac_ct_CC$]) m4trace:configure.ac:11: -1- _AM_PROG_CC_C_O m4trace:configure.ac:11: -1- AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) m4trace:configure.ac:11: -1- _AM_DEPENDENCIES([CC]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CCDEPMODE$]) m4trace:configure.ac:11: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:11: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) m4trace:configure.ac:22: -1- m4_pattern_allow([^NDEBUG$]) m4trace:configure.ac:30: -1- m4_pattern_allow([^WITHOUT_PRIVSEP$]) m4trace:configure.ac:34: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:34: the top level]) m4trace:configure.ac:39: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:39: the top level]) m4trace:configure.ac:44: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:44: the top level]) m4trace:configure.ac:49: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:49: the top level]) m4trace:configure.ac:54: -1- m4_pattern_allow([^privsep_user$]) m4trace:configure.ac:55: -1- m4_pattern_allow([^privsep_dir$]) m4trace:configure.ac:56: -1- m4_pattern_allow([^privsep_dir_user$]) m4trace:configure.ac:57: -1- m4_pattern_allow([^privsep_dir_group$]) m4trace:configure.ac:58: -1- m4_pattern_allow([^PRIVSEP_USER$]) m4trace:configure.ac:61: -1- m4_pattern_allow([^PRIVSEP_DIR$]) m4trace:configure.ac:64: -1- m4_pattern_allow([^PRIVSEP_DIR_USER$]) m4trace:configure.ac:67: -1- m4_pattern_allow([^PRIVSEP_DIR_GROUP$]) m4trace:configure.ac:77: -1- m4_pattern_allow([^WITHOUT_DEBUGFILE$]) m4trace:configure.ac:102: -1- AM_CONDITIONAL([WITH_SC_UPTIME], [test x$with_sc_uptime = xyes]) m4trace:configure.ac:102: -1- m4_pattern_allow([^WITH_SC_UPTIME_TRUE$]) m4trace:configure.ac:102: -1- m4_pattern_allow([^WITH_SC_UPTIME_FALSE$]) m4trace:configure.ac:102: -1- _AM_SUBST_NOTMAKE([WITH_SC_UPTIME_TRUE]) m4trace:configure.ac:102: -1- _AM_SUBST_NOTMAKE([WITH_SC_UPTIME_FALSE]) m4trace:configure.ac:105: -1- m4_pattern_allow([^HAVE_LIBIPHLPAPI$]) m4trace:configure.ac:106: -1- m4_pattern_allow([^HAVE_LIBWS2_32$]) m4trace:configure.ac:109: -1- m4_pattern_allow([^STDC_HEADERS$]) m4trace:configure.ac:110: -1- m4_pattern_allow([^HAVE_SYS_WAIT_H$]) m4trace:configure.ac:111: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) m4trace:configure.ac:112: -1- m4_pattern_allow([^HAVE_ARPA_INET_H$]) m4trace:configure.ac:113: -1- m4_pattern_allow([^HAVE_FCNTL_H$]) m4trace:configure.ac:114: -1- m4_pattern_allow([^HAVE_LIMITS_H$]) m4trace:configure.ac:115: -1- m4_pattern_allow([^HAVE_NETDB_H$]) m4trace:configure.ac:116: -1- m4_pattern_allow([^HAVE_NET_IF_DL_H$]) m4trace:configure.ac:117: -1- m4_pattern_allow([^HAVE_NET_IF_TYPES_H$]) m4trace:configure.ac:118: -1- m4_pattern_allow([^HAVE_NETINET_IN_H$]) m4trace:configure.ac:119: -1- m4_pattern_allow([^HAVE_POLL_H$]) m4trace:configure.ac:120: -1- m4_pattern_allow([^HAVE_STDINT_H$]) m4trace:configure.ac:121: -1- m4_pattern_allow([^HAVE_STDLIB_H$]) m4trace:configure.ac:122: -1- m4_pattern_allow([^HAVE_STRING_H$]) m4trace:configure.ac:123: -1- m4_pattern_allow([^HAVE_SYS_EPOLL_H$]) m4trace:configure.ac:124: -1- m4_pattern_allow([^HAVE_SYS_EVENT_H$]) m4trace:configure.ac:125: -1- m4_pattern_allow([^HAVE_SYS_IOCTL_H$]) m4trace:configure.ac:126: -1- m4_pattern_allow([^HAVE_SYS_PARAM_H$]) m4trace:configure.ac:127: -1- m4_pattern_allow([^HAVE_SYS_SOCKET_H$]) m4trace:configure.ac:128: -1- m4_pattern_allow([^HAVE_SYS_TIME_H$]) m4trace:configure.ac:129: -1- m4_pattern_allow([^HAVE_UNISTD_H$]) m4trace:configure.ac:130: -1- m4_pattern_allow([^HAVE_IFADDRS_H$]) m4trace:configure.ac:133: -1- m4_pattern_allow([^HAVE_SYS_SYSCTL_H$]) m4trace:configure.ac:158: -1- m4_pattern_allow([^HAVE_NETINET_TCP_VAR_H$]) m4trace:configure.ac:173: -1- m4_pattern_allow([^HAVE_NET_PFVAR_H$]) m4trace:configure.ac:182: -1- m4_pattern_allow([^const$]) m4trace:configure.ac:183: -1- m4_pattern_allow([^uid_t$]) m4trace:configure.ac:183: -1- m4_pattern_allow([^gid_t$]) m4trace:configure.ac:184: -1- m4_pattern_allow([^int16_t$]) m4trace:configure.ac:185: -1- m4_pattern_allow([^int32_t$]) m4trace:configure.ac:186: -1- m4_pattern_allow([^mode_t$]) m4trace:configure.ac:187: -1- m4_pattern_allow([^off_t$]) m4trace:configure.ac:188: -1- m4_pattern_allow([^pid_t$]) m4trace:configure.ac:189: -1- m4_pattern_allow([^size_t$]) m4trace:configure.ac:190: -1- m4_pattern_allow([^ssize_t$]) m4trace:configure.ac:191: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) m4trace:configure.ac:192: -1- m4_pattern_allow([^uint16_t$]) m4trace:configure.ac:193: -1- m4_pattern_allow([^_UINT32_T$]) m4trace:configure.ac:193: -1- m4_pattern_allow([^uint32_t$]) m4trace:configure.ac:194: -1- m4_pattern_allow([^_UINT64_T$]) m4trace:configure.ac:194: -1- m4_pattern_allow([^uint64_t$]) m4trace:configure.ac:195: -1- m4_pattern_allow([^_UINT8_T$]) m4trace:configure.ac:195: -1- m4_pattern_allow([^uint8_t$]) m4trace:configure.ac:198: -1- m4_pattern_allow([^HAVE_UNISTD_H$]) m4trace:configure.ac:198: -1- m4_pattern_allow([^HAVE_CHOWN$]) m4trace:configure.ac:199: -1- m4_pattern_allow([^HAVE_VFORK_H$]) m4trace:configure.ac:199: -1- m4_pattern_allow([^HAVE_WORKING_VFORK$]) m4trace:configure.ac:199: -1- m4_pattern_allow([^vfork$]) m4trace:configure.ac:199: -1- m4_pattern_allow([^HAVE_WORKING_FORK$]) m4trace:configure.ac:200: -1- m4_pattern_allow([^HAVE_ARC4RANDOM$]) m4trace:configure.ac:201: -1- m4_pattern_allow([^HAVE_ARC4RANDOM_UNIFORM$]) m4trace:configure.ac:202: -1- m4_pattern_allow([^HAVE_ATEXIT$]) m4trace:configure.ac:203: -1- m4_pattern_allow([^HAVE_CALLOC$]) m4trace:configure.ac:204: -1- m4_pattern_allow([^HAVE_DAEMON$]) m4trace:configure.ac:205: -1- m4_pattern_allow([^HAVE_ENDPWENT$]) m4trace:configure.ac:206: -1- m4_pattern_allow([^HAVE_EPOLL_WAIT$]) m4trace:configure.ac:207: -1- m4_pattern_allow([^HAVE_FTRUNCATE$]) m4trace:configure.ac:208: -1- m4_pattern_allow([^HAVE_GETDTABLESIZE$]) m4trace:configure.ac:209: -1- m4_pattern_allow([^HAVE_GETHOSTNAME$]) m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_GETIFADDRS$]) m4trace:configure.ac:211: -1- m4_pattern_allow([^HAVE_GETPAGESIZE$]) m4trace:configure.ac:212: -1- m4_pattern_allow([^HAVE_GETTIMEOFDAY$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^HAVE_KQUEUE$]) m4trace:configure.ac:214: -1- m4_pattern_allow([^HAVE_MEMMOVE$]) m4trace:configure.ac:215: -1- m4_pattern_allow([^HAVE_MEMSET$]) m4trace:configure.ac:216: -1- m4_pattern_allow([^HAVE_MKDIR$]) m4trace:configure.ac:217: -1- m4_pattern_allow([^HAVE_POLL$]) m4trace:configure.ac:218: -1- m4_pattern_allow([^HAVE_RMDIR$]) m4trace:configure.ac:219: -1- m4_pattern_allow([^HAVE_SELECT$]) m4trace:configure.ac:220: -1- m4_pattern_allow([^HAVE_SOCKET$]) m4trace:configure.ac:221: -1- m4_pattern_allow([^HAVE_SNPRINTF$]) m4trace:configure.ac:222: -1- m4_pattern_allow([^HAVE_SETPROCTITLE$]) m4trace:configure.ac:223: -1- m4_pattern_allow([^HAVE_STRCASECMP$]) m4trace:configure.ac:224: -1- m4_pattern_allow([^HAVE_STRCASESTR$]) m4trace:configure.ac:225: -1- m4_pattern_allow([^HAVE_STRDUP$]) m4trace:configure.ac:226: -1- m4_pattern_allow([^HAVE_STRERROR$]) m4trace:configure.ac:227: -1- m4_pattern_allow([^HAVE_STRNCASECMP$]) m4trace:configure.ac:228: -1- m4_pattern_allow([^HAVE_STRTOL$]) m4trace:configure.ac:229: -1- m4_pattern_allow([^HAVE_UNAME$]) m4trace:configure.ac:231: -1- m4_pattern_allow([^SIZEOF_LONG$]) m4trace:configure.ac:233: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_SA_LEN$]) m4trace:configure.ac:240: -1- m4_pattern_allow([^HAVE_STRUCT_PFIOC_TRANS_E_TYPE$]) m4trace:configure.ac:248: -1- m4_pattern_allow([^HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM$]) m4trace:configure.ac:256: -1- m4_pattern_allow([^HAVE_STRUCT_PF_RULE_NAT$]) m4trace:configure.ac:264: -1- m4_pattern_allow([^HAVE_STRUCT_PF_RULE_RDR$]) m4trace:configure.ac:276: -1- m4_pattern_allow([^HAVE_STRUCT_IP6_EXT$]) m4trace:configure.ac:346: -1- m4_pattern_allow([^LIB@&t@OBJS$]) m4trace:configure.ac:346: -1- m4_pattern_allow([^LTLIBOBJS$]) m4trace:configure.ac:346: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) m4trace:configure.ac:346: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) m4trace:configure.ac:346: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) m4trace:configure.ac:346: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) m4trace:configure.ac:346: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) m4trace:configure.ac:346: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) m4trace:configure.ac:346: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS m4trace:configure.ac:346: -1- _LT_PROG_LTMAIN scamper-cvs-20171204/autom4te.cache/output.1000644 001751 000000 00002043763 13211200045 020344 0ustar00mjlwheel000000 000000 @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. @%:@ Generated by GNU Autoconf 2.69 for scamper 20171204. @%:@ @%:@ Report bugs to . @%:@ @%:@ @%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @%:@ @%:@ @%:@ This configure script is free software; the Free Software Foundation @%:@ gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in @%:@( *posix*) : set -o posix ;; @%:@( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in @%:@( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in @%:@(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in @%:@ (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in @%:@( *posix*) : set -o posix ;; @%:@( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in @%:@( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in @%:@ (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and mjl@luckie.org.nz $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: 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 @S|@? 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 "@S|@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 @S|@as_val. Take advantage of shells that can avoid forks. The arguments @%:@ must be portable across @S|@(()) 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 @S|@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'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIB@&t@OBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='scamper' PACKAGE_TARNAME='scamper' PACKAGE_VERSION='20171204' PACKAGE_STRING='scamper 20171204' PACKAGE_BUGREPORT='mjl@luckie.org.nz' PACKAGE_URL='' ac_unique_file="scamper/scamper.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIB@&t@OBJS PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC ax_pthread_config OPENSSL_LDFLAGS OPENSSL_LIBS OPENSSL_INCLUDES PKG_CONFIG WITH_SC_UPTIME_FALSE WITH_SC_UPTIME_TRUE privsep_dir_group privsep_dir_user privsep_dir privsep_user CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_shared enable_static with_pic enable_fast_install with_aix_soname enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_debug enable_privsep with_privsep_user with_privsep_dir with_privsep_dir_owner with_privsep_dir_group enable_debug_file with_dmalloc with_sc_uptime with_openssl enable_threads ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures scamper 20171204 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 @<:@@S|@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/scamper@:>@ --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 scamper 20171204:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-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@:>@ --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug build with debugging symbols --disable-privsep disable privilege separation --disable-debug-file remove support for generating a debug file --disable-threads disable use of threads Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic@<:@=PKGS@:>@ try to use only PIC/non-PIC objects @<:@default=use both@:>@ --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=aix@:>@. --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ --with-sysroot@<:@=DIR@:>@ Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-privsep-user=USER sets user name for privsep process --with-privsep-dir=DIR sets chroot directory for privsep process --with-privsep-dir-user=USER sets chroot directory owner --with-privsep-dir-group=GROUP sets chroot directory group id --with-dmalloc enable support for dmalloc --with-sc_uptime enable support for sc_uptime --with-openssl=DIR root of the OpenSSL directory 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 LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF scamper configure 20171204 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.@S|@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.@S|@ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_link @%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES @%:@ ------------------------------------------------------- @%:@ Tests whether HEADER exists and can be compiled using the include files in @%:@ INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @%:@include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_header_compile @%:@ ac_fn_c_try_cpp LINENO @%:@ ---------------------- @%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_cpp @%:@ ac_fn_c_try_run LINENO @%:@ ---------------------- @%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes @%:@ that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_run @%:@ ac_fn_c_check_func LINENO FUNC VAR @%:@ ---------------------------------- @%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_func @%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES @%:@ ------------------------------------------------------- @%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using @%:@ the include files in INCLUDES and setting the cache variable VAR @%:@ accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @%:@include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------- ## ## Report this to mjl@luckie.org.nz ## ## -------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_header_mongrel @%:@ ac_fn_c_find_intX_t LINENO BITS VAR @%:@ ----------------------------------- @%:@ Finds a signed integer type with width BITS, setting cache variable VAR @%:@ accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 $as_echo_n "checking for int$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array @<:@1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array @<:@1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else case $ac_type in @%:@( int$2_t) : eval "$3=yes" ;; @%:@( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_intX_t @%:@ 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_find_uintX_t LINENO BITS VAR @%:@ ------------------------------------ @%:@ Finds an unsigned integer type with width BITS, setting cache variable VAR @%:@ accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array @<:@1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in @%:@( uint$2_t) : eval "$3=yes" ;; @%:@( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_uintX_t @%:@ ac_fn_c_compute_int LINENO EXPR VAR INCLUDES @%:@ -------------------------------------------- @%:@ Tries to find the compile-time value of EXPR in a program that includes @%:@ INCLUDES, setting VAR accordingly. Returns whether the value could be @%:@ computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) >= 0)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) < 0)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) >= $ac_mid)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in @%:@(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } @%:@include @%:@include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_member 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 scamper $as_me 20171204, 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 am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in @%:@(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null @%:@ Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='scamper' VERSION='20171204' cat >>confdefs.h <<_ACEOF @%:@define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_config_headers="$ac_config_headers config.h" case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf @%:@ Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $@%:@ != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep @%:@ Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that 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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } @%:@ Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } @%:@ Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. 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 what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF @%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no @%:@ Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi @%:@ Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi @%:@ Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi @%:@ 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 shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } @%:@ Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF @%:@define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic@&t@ -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic@&t@ -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; 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 no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $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 yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; 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 relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; 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 yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi 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 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 # Whether all the debugging output should be spewed out @%:@ Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi if test "x$enable_debug" != "xyes"; then $as_echo "@%:@define NDEBUG 1" >>confdefs.h fi # No privilege separation @%:@ Check whether --enable-privsep was given. if test "${enable_privsep+set}" = set; then : enableval=$enable_privsep; fi if test "x$enable_privsep" = xno; then $as_echo "@%:@define WITHOUT_PRIVSEP 1" >>confdefs.h fi # privsep parameters @%:@ Check whether --with-privsep_user was given. if test "${with_privsep_user+set}" = set; then : withval=$with_privsep_user; privsep_user=$withval else privsep_user=nobody fi @%:@ Check whether --with-privsep_dir was given. if test "${with_privsep_dir+set}" = set; then : withval=$with_privsep_dir; privsep_dir=$withval else privsep_dir=/var/empty fi @%:@ Check whether --with-privsep_dir_owner was given. if test "${with_privsep_dir_owner+set}" = set; then : withval=$with_privsep_dir_owner; privsep_dir_user=$withval else privsep_dir_user=root fi @%:@ Check whether --with-privsep_dir_group was given. if test "${with_privsep_dir_group+set}" = set; then : withval=$with_privsep_dir_group; privsep_dir_group=$withval else privsep_dir_group=wheel fi cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_USER "$privsep_user" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_DIR "$privsep_dir" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_DIR_USER "$privsep_dir_user" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_DIR_GROUP "$privsep_dir_group" _ACEOF # Debug file support @%:@ Check whether --enable-debug-file was given. if test "${enable_debug_file+set}" = set; then : enableval=$enable_debug_file; fi if test "x$enable_debug_file" = xno; then $as_echo "@%:@define WITHOUT_DEBUGFILE 1" >>confdefs.h fi # dmalloc support @%:@ Check whether --with-dmalloc was given. if test "${with_dmalloc+set}" = set; then : withval=$with_dmalloc; fi if test "x$with_dmalloc" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_malloc in -ldmalloc" >&5 $as_echo_n "checking for dmalloc_malloc in -ldmalloc... " >&6; } if ${ac_cv_lib_dmalloc_dmalloc_malloc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $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 dmalloc_malloc (); int main () { return dmalloc_malloc (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dmalloc_dmalloc_malloc=yes else ac_cv_lib_dmalloc_dmalloc_malloc=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_dmalloc_dmalloc_malloc" >&5 $as_echo "$ac_cv_lib_dmalloc_dmalloc_malloc" >&6; } if test "x$ac_cv_lib_dmalloc_dmalloc_malloc" = xyes; then : CFLAGS="$CFLAGS -DDMALLOC" LDFLAGS="$LDFLAGS -ldmalloc" 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 $? "dmalloc test failed (remove --with-dmalloc) See \`config.log' for more details" "$LINENO" 5; } fi fi # sc_uptime prober support @%:@ Check whether --with-sc_uptime was given. if test "${with_sc_uptime+set}" = set; then : withval=$with_sc_uptime; with_sc_uptime=$withval else with_sc_uptime=no fi if test x$with_sc_uptime = xyes; then WITH_SC_UPTIME_TRUE= WITH_SC_UPTIME_FALSE='#' else WITH_SC_UPTIME_TRUE='#' WITH_SC_UPTIME_FALSE= fi # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GetIpNetTable in -liphlpapi" >&5 $as_echo_n "checking for GetIpNetTable in -liphlpapi... " >&6; } if ${ac_cv_lib_iphlpapi_GetIpNetTable+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liphlpapi $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 GetIpNetTable (); int main () { return GetIpNetTable (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iphlpapi_GetIpNetTable=yes else ac_cv_lib_iphlpapi_GetIpNetTable=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_iphlpapi_GetIpNetTable" >&5 $as_echo "$ac_cv_lib_iphlpapi_GetIpNetTable" >&6; } if test "x$ac_cv_lib_iphlpapi_GetIpNetTable" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBIPHLPAPI 1 _ACEOF LIBS="-liphlpapi $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WSAStartup in -lws2_32" >&5 $as_echo_n "checking for WSAStartup in -lws2_32... " >&6; } if ${ac_cv_lib_ws2_32_WSAStartup+:} 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 WSAStartup (); int main () { return WSAStartup (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ws2_32_WSAStartup=yes else ac_cv_lib_ws2_32_WSAStartup=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_WSAStartup" >&5 $as_echo "$ac_cv_lib_ws2_32_WSAStartup" >&6; } if test "x$ac_cv_lib_ws2_32_WSAStartup" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBWS2_32 1 _ACEOF LIBS="-lws2_32 $LIBS" fi # Checks for header files. { $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 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 { $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 for ac_header in arpa/inet.h do : ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" if test "x$ac_cv_header_arpa_inet_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ARPA_INET_H 1 _ACEOF fi done for ac_header in fcntl.h do : ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_fcntl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_FCNTL_H 1 _ACEOF fi done for ac_header in limits.h do : ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIMITS_H 1 _ACEOF fi done for ac_header in netdb.h do : ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" if test "x$ac_cv_header_netdb_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NETDB_H 1 _ACEOF fi done for ac_header in net/if_dl.h do : ac_fn_c_check_header_mongrel "$LINENO" "net/if_dl.h" "ac_cv_header_net_if_dl_h" "$ac_includes_default" if test "x$ac_cv_header_net_if_dl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NET_IF_DL_H 1 _ACEOF fi done for ac_header in net/if_types.h do : ac_fn_c_check_header_mongrel "$LINENO" "net/if_types.h" "ac_cv_header_net_if_types_h" "$ac_includes_default" if test "x$ac_cv_header_net_if_types_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NET_IF_TYPES_H 1 _ACEOF fi done for ac_header in netinet/in.h do : ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" if test "x$ac_cv_header_netinet_in_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NETINET_IN_H 1 _ACEOF fi done for ac_header in poll.h do : ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" if test "x$ac_cv_header_poll_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_POLL_H 1 _ACEOF fi done for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STDINT_H 1 _ACEOF fi done for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STDLIB_H 1 _ACEOF fi done for ac_header in string.h do : ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRING_H 1 _ACEOF fi done for ac_header in sys/epoll.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" if test "x$ac_cv_header_sys_epoll_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_EPOLL_H 1 _ACEOF fi done for ac_header in sys/event.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" if test "x$ac_cv_header_sys_event_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_EVENT_H 1 _ACEOF fi done for ac_header in sys/ioctl.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_IOCTL_H 1 _ACEOF fi done for ac_header in sys/param.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" if test "x$ac_cv_header_sys_param_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_PARAM_H 1 _ACEOF fi done for ac_header in sys/socket.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" if test "x$ac_cv_header_sys_socket_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_SOCKET_H 1 _ACEOF fi done for ac_header in sys/time.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_TIME_H 1 _ACEOF fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_UNISTD_H 1 _ACEOF fi done for ac_header in ifaddrs.h do : ac_fn_c_check_header_mongrel "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default" if test "x$ac_cv_header_ifaddrs_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_IFADDRS_H 1 _ACEOF fi done # sys/sysctl.h requires other headers on at least OpenBSD for ac_header in sys/sysctl.h do : ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" " #if HAVE_SYS_PARAM_H # include #endif " if test "x$ac_cv_header_sys_sysctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_SYSCTL_H 1 _ACEOF fi done for ac_header in netinet/ip_fw.h netinet6/ip6_fw.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" " #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif #if HAVE_NETINET_IN_H # include #endif #if HAVE_ARPA_INET_H # include #endif #include #include " 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 netinet/tcp_var.h do : ac_fn_c_check_header_compile "$LINENO" "netinet/tcp_var.h" "ac_cv_header_netinet_tcp_var_h" " #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif #if HAVE_NETINET_IN_H # include #endif #include #include " if test "x$ac_cv_header_netinet_tcp_var_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NETINET_TCP_VAR_H 1 _ACEOF fi done for ac_header in net/pfvar.h do : ac_fn_c_check_header_compile "$LINENO" "net/pfvar.h" "ac_cv_header_net_pfvar_h" " #include #include #include #include " if test "x$ac_cv_header_net_pfvar_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NET_PFVAR_H 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "@%:@define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 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 ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" case $ac_cv_c_int16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF @%:@define int16_t $ac_cv_c_int16_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF @%:@define int32_t $ac_cv_c_int32_t _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes; then : else cat >>confdefs.h <<_ACEOF @%:@define mode_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "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 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF @%:@define ssize_t int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "@%:@define TM_IN_SYS_TIME 1" >>confdefs.h fi ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF @%:@define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "@%:@define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF @%:@define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) $as_echo "@%:@define _UINT64_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF @%:@define uint64_t $ac_cv_c_uint64_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "@%:@define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF @%:@define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac # Checks for library functions. for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_UNISTD_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 $as_echo_n "checking for working chown... " >&6; } if ${ac_cv_func_chown_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_chown_works=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include int main () { char *f = "conftest.chown"; struct stat before, after; if (creat (f, 0600) < 0) return 1; if (stat (f, &before) < 0) return 1; if (chown (f, (uid_t) -1, (gid_t) -1) == -1) return 1; if (stat (f, &after) < 0) return 1; return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_chown_works=yes else ac_cv_func_chown_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f conftest.chown fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 $as_echo "$ac_cv_func_chown_works" >&6; } if test $ac_cv_func_chown_works = yes; then $as_echo "@%:@define HAVE_CHOWN 1" >>confdefs.h fi for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF @%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "@%:@define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "@%:@define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "@%:@define HAVE_WORKING_FORK 1" >>confdefs.h fi for ac_func in arc4random do : ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random" if test "x$ac_cv_func_arc4random" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ARC4RANDOM 1 _ACEOF fi done for ac_func in arc4random_uniform do : ac_fn_c_check_func "$LINENO" "arc4random_uniform" "ac_cv_func_arc4random_uniform" if test "x$ac_cv_func_arc4random_uniform" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ARC4RANDOM_UNIFORM 1 _ACEOF fi done for ac_func in atexit do : ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit" if test "x$ac_cv_func_atexit" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ATEXIT 1 _ACEOF fi done for ac_func in calloc do : ac_fn_c_check_func "$LINENO" "calloc" "ac_cv_func_calloc" if test "x$ac_cv_func_calloc" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_CALLOC 1 _ACEOF fi done for ac_func in daemon do : ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon" if test "x$ac_cv_func_daemon" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_DAEMON 1 _ACEOF fi done for ac_func in endpwent do : ac_fn_c_check_func "$LINENO" "endpwent" "ac_cv_func_endpwent" if test "x$ac_cv_func_endpwent" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ENDPWENT 1 _ACEOF fi done for ac_func in epoll_wait do : ac_fn_c_check_func "$LINENO" "epoll_wait" "ac_cv_func_epoll_wait" if test "x$ac_cv_func_epoll_wait" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_EPOLL_WAIT 1 _ACEOF fi done for ac_func in ftruncate do : ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" if test "x$ac_cv_func_ftruncate" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_FTRUNCATE 1 _ACEOF fi done for ac_func in getdtablesize do : ac_fn_c_check_func "$LINENO" "getdtablesize" "ac_cv_func_getdtablesize" if test "x$ac_cv_func_getdtablesize" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETDTABLESIZE 1 _ACEOF fi done for ac_func in gethostname do : ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname" if test "x$ac_cv_func_gethostname" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETHOSTNAME 1 _ACEOF fi done for ac_func in getifaddrs do : ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" if test "x$ac_cv_func_getifaddrs" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETIFADDRS 1 _ACEOF fi done for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" if test "x$ac_cv_func_getpagesize" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETPAGESIZE 1 _ACEOF fi done for ac_func in gettimeofday do : ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETTIMEOFDAY 1 _ACEOF fi done for ac_func in kqueue do : ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue" if test "x$ac_cv_func_kqueue" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_KQUEUE 1 _ACEOF fi done for ac_func in memmove do : ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" if test "x$ac_cv_func_memmove" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_MEMMOVE 1 _ACEOF fi done for ac_func in memset do : ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" if test "x$ac_cv_func_memset" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_MEMSET 1 _ACEOF fi done for ac_func in mkdir do : ac_fn_c_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" if test "x$ac_cv_func_mkdir" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_MKDIR 1 _ACEOF fi done for ac_func in poll do : ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" if test "x$ac_cv_func_poll" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_POLL 1 _ACEOF fi done for ac_func in rmdir do : ac_fn_c_check_func "$LINENO" "rmdir" "ac_cv_func_rmdir" if test "x$ac_cv_func_rmdir" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_RMDIR 1 _ACEOF fi done for ac_func in select do : ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" if test "x$ac_cv_func_select" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SELECT 1 _ACEOF fi done for ac_func in socket do : ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" if test "x$ac_cv_func_socket" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SOCKET 1 _ACEOF fi done for ac_func in snprintf do : ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SNPRINTF 1 _ACEOF fi done for ac_func in setproctitle do : ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle" if test "x$ac_cv_func_setproctitle" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SETPROCTITLE 1 _ACEOF fi done for ac_func in strcasecmp do : ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRCASECMP 1 _ACEOF fi done for ac_func in strcasestr do : ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" if test "x$ac_cv_func_strcasestr" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRCASESTR 1 _ACEOF fi done for ac_func in strdup do : ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRDUP 1 _ACEOF fi done for ac_func in strerror do : ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRERROR 1 _ACEOF fi done for ac_func in strncasecmp do : ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" if test "x$ac_cv_func_strncasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRNCASECMP 1 _ACEOF fi done for ac_func in strtol do : ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" if test "x$ac_cv_func_strtol" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRTOL 1 _ACEOF fi done for ac_func in uname do : ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" if test "x$ac_cv_func_uname" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_UNAME 1 _ACEOF fi done # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF @%:@define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include #include " if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_SOCKADDR_SA_LEN 1" >>confdefs.h else : fi if test "x$ac_cv_header_net_pfvar_h" == xyes; then ac_fn_c_check_member "$LINENO" "struct pfioc_trans_e" "type" "ac_cv_member_struct_pfioc_trans_e_type" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pfioc_trans_e_type" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PFIOC_TRANS_E_TYPE 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pfioc_trans_e" "rs_num" "ac_cv_member_struct_pfioc_trans_e_rs_num" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pfioc_trans_e_rs_num" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pf_rule" "nat" "ac_cv_member_struct_pf_rule_nat" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pf_rule_nat" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PF_RULE_NAT 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pf_rule" "rdr" "ac_cv_member_struct_pf_rule_rdr" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pf_rule_rdr" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PF_RULE_RDR 1" >>confdefs.h else : fi fi # Check for structs { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ip6_ext" >&5 $as_echo_n "checking for struct ip6_ext... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #include ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRUCT_IP6_EXT 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } #AC_DEFINE_UNQUOTED([HAVE_STRUCT_IP6_EXT], 0, [Define to 1 if you have the `ip6_ext' struct.]) fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # These libraries have to be explicitly linked in OpenSolaris { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 $as_echo_n "checking for library containing getaddrinfo... " >&6; } if ${ac_cv_search_getaddrinfo+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getaddrinfo (); int main () { return getaddrinfo (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib -lnsl $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getaddrinfo=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_getaddrinfo+:} false; then : break fi done if ${ac_cv_search_getaddrinfo+:} false; then : else ac_cv_search_getaddrinfo=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 $as_echo "$ac_cv_search_getaddrinfo" >&6; } ac_res=$ac_cv_search_getaddrinfo if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 $as_echo_n "checking for library containing inet_ntop... " >&6; } if ${ac_cv_search_inet_ntop+:} 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 inet_ntop (); int main () { return inet_ntop (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib -lsocket $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_ntop=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_ntop+:} false; then : break fi done if ${ac_cv_search_inet_ntop+:} false; then : else ac_cv_search_inet_ntop=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 $as_echo "$ac_cv_search_inet_ntop" >&6; } ac_res=$ac_cv_search_inet_ntop if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # Some systems need -lm to use sqrt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sqrt" >&5 $as_echo_n "checking for library containing sqrt... " >&6; } if ${ac_cv_search_sqrt+:} 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 sqrt (); int main () { return sqrt (); ; return 0; } _ACEOF for ac_lib in '' m; 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_sqrt=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_sqrt+:} false; then : break fi done if ${ac_cv_search_sqrt+:} false; then : else ac_cv_search_sqrt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sqrt" >&5 $as_echo "$ac_cv_search_sqrt" >&6; } ac_res=$ac_cv_search_sqrt if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi found=false @%:@ Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; case "$withval" in "" | y | ye | yes | n | no) as_fn_error $? "Invalid --with-openssl value" "$LINENO" 5 ;; *) ssldirs="$withval" ;; esac else # if pkg-config is installed and openssl has installed a .pc file, # then use that information and don't search ssldirs if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PKG_CONFIG"; then ac_cv_prog_PKG_CONFIG="$PKG_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config" $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 PKG_CONFIG=$ac_cv_prog_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_PKG_CONFIG"; then ac_ct_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_PKG_CONFIG"; then ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config" $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_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG if test -n "$ac_ct_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5 $as_echo "$ac_ct_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_ct_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_prog_PKG_CONFIG" fi if test x"$PKG_CONFIG" != x""; then OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` if test $? = 0; then OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` found=true fi fi # no such luck; use some default ssldirs if ! $found; then ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" fi fi # note that we #include , so the OpenSSL headers have to be in # an 'openssl' subdirectory if ! $found; then OPENSSL_INCLUDES= for ssldir in $ssldirs; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h in $ssldir" >&5 $as_echo_n "checking for openssl/ssl.h in $ssldir... " >&6; } if test -f "$ssldir/include/openssl/ssl.h"; then OPENSSL_INCLUDES="-I$ssldir/include" OPENSSL_LDFLAGS="-L$ssldir/lib" OPENSSL_LIBS="-lssl -lcrypto" found=true { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } break else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi done # if the file wasn't found, well, go ahead and try the link anyway -- maybe # it will just work! fi # try the preprocessor and linker with our new flags, # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling and linking against OpenSSL works" >&5 $as_echo_n "checking whether compiling and linking against OpenSSL works... " >&6; } echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&5 save_LIBS="$LIBS" save_LDFLAGS="$LDFLAGS" save_CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" LIBS="$OPENSSL_LIBS $LIBS" CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { SSL_new(NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "@%:@define HAVE_OPENSSL 1" >>confdefs.h CFLAGS="$CFLAGS $OPENSSL_INCLUDES" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_clz" >&5 $as_echo_n "checking for __builtin_clz... " >&6; } if ${ax_cv_have___builtin_clz+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { __builtin_clz(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have___builtin_clz=yes else ax_cv_have___builtin_clz=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have___builtin_clz" >&5 $as_echo "$ax_cv_have___builtin_clz" >&6; } if test yes = $ax_cv_have___builtin_clz; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE___BUILTIN_CLZ 1 _ACEOF fi # No thread support @%:@ Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then : enableval=$enable_threads; fi if test "x$enable_threads" != 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 ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then ax_pthread_save_CC="$CC" ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" if test "x$PTHREAD_CC" != "x"; then : CC="$PTHREAD_CC" fi CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 $as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } 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_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi CC="$ax_pthread_save_CC" CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 # (Note: HP C rejects this with "bad form for `-t' option") # -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads and # -D_REENTRANT too), HP C (must be checked before -lpthread, which # is present but should not be used directly; and before -mthreads, # because the compiler interprets this as "-mt" + "-hreads") # -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case $host_os in freebsd*) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) ax_pthread_flags="-kthread lthread $ax_pthread_flags" ;; hpux*) # From the cc(1) man page: "[-mt] Sets various -D flags to enable # multi-threading and also sets -lpthread." ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" ;; openedition*) # IBM z/OS requires a feature-test macro to be defined in order to # enable POSIX threads at all, so give the user a hint if this is # not set. (We don't define these ourselves, as they can affect # other portions of the system API in unpredictable ways.) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) AX_PTHREAD_ZOS_MISSING # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 $as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} fi rm -f conftest* ;; solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (N.B.: The stubs are missing # pthread_cleanup_push, or rather a function called by this macro, # so we could check for that, but who knows whether they'll stub # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" ;; esac # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) if test "x$GCC" = "xyes"; then : ax_pthread_flags="-pthread -pthreads $ax_pthread_flags" fi # The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled case $host_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; aix*) ax_pthread_check_macro="_THREAD_SAFE" ;; *) ax_pthread_check_macro="--" ;; esac if test "x$ax_pthread_check_macro" = "x--"; then : ax_pthread_check_cond=0 else ax_pthread_check_cond="!defined($ax_pthread_check_macro)" fi # Are we compiling with Clang? { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 $as_echo_n "checking whether $CC is Clang... " >&6; } if ${ax_cv_PTHREAD_CLANG+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Note: Clang 2.7 lacks __clang_[a-z]+__ */ # if defined(__clang__) && defined(__llvm__) AX_PTHREAD_CC_IS_CLANG # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then : ax_cv_PTHREAD_CLANG=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 $as_echo "$ax_cv_PTHREAD_CLANG" >&6; } ax_pthread_clang="$ax_cv_PTHREAD_CLANG" ax_pthread_clang_warning=no # Clang needs special handling, because older versions handle the -pthread # option in a rather... idiosyncratic way if test "x$ax_pthread_clang" = "xyes"; then # Clang takes -pthread; it has never supported any other flag # (Note 1: This will need to be revisited if a system that Clang # supports has POSIX threads in a separate library. This tends not # to be the way of modern systems, but it's conceivable.) # (Note 2: On some systems, notably Darwin, -pthread is not needed # to get POSIX threads support; the API is always present and # active. We could reasonably leave PTHREAD_CFLAGS empty. But # -pthread does define _REENTRANT, and while the Darwin headers # ignore this macro, third-party headers might not.) PTHREAD_CFLAGS="-pthread" PTHREAD_LIBS= ax_pthread_ok=yes # However, older versions of Clang make a point of warning the user # that, in an invocation where only linking and no compilation is # taking place, the -pthread option has no effect ("argument unused # during compilation"). They expect -pthread to be passed in only # when source code is being compiled. # # Problem is, this is at odds with the way Automake and most other # C build frameworks function, which is that the same flags used in # compilation (CFLAGS) are also used in linking. Many systems # supported by AX_PTHREAD require exactly this for POSIX threads # support, and in fact it is often not straightforward to specify a # flag that is used only in the compilation phase and not in # linking. Such a scenario is extremely rare in practice. # # Even though use of the -pthread flag in linking would only print # a warning, this can be a nuisance for well-run software projects # that build with -Werror. So if the active version of Clang has # this misfeature, we search for an option to squash it. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 $as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second # step ax_pthread_save_ac_link="$ac_link" ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do if test "x$ax_pthread_try" = "xunknown"; then : break fi CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" ac_link="$ax_pthread_save_ac_link" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void){return 0;} _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_link="$ax_pthread_2step_ac_link" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void){return 0;} _ACEOF if ac_fn_c_try_link "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done ac_link="$ax_pthread_save_ac_link" CFLAGS="$ax_pthread_save_CFLAGS" if test "x$ax_pthread_try" = "x"; then : ax_pthread_try=no fi ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 $as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in no | unknown) ;; *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; esac fi # $ax_pthread_clang = yes if test "x$ax_pthread_ok" = "xno"; then for ax_pthread_try_flag in $ax_pthread_flags; do case $ax_pthread_try_flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -mt,pthread) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5 $as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; } PTHREAD_CFLAGS="-mt" PTHREAD_LIBS="-lpthread" ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 $as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ax_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ax_pthread_config="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_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" fi fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 $as_echo "$ax_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ax_pthread_config" = "xno"; then : continue fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 $as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; } int main () { pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xyes"; then : break fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = "xyes"; then ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr = $ax_pthread_attr; return attr /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 $as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ test "x$ax_pthread_joinable_attr_defined" != "xyes"; then : cat >>confdefs.h <<_ACEOF @%:@define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR _ACEOF ax_pthread_joinable_attr_defined=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 $as_echo_n "checking whether more special flags are required for pthreads... " >&6; } if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 $as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ test "x$ax_pthread_special_flags_added" != "xyes"; then : PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" ax_pthread_special_flags_added=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int i = PTHREAD_PRIO_INHERIT; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_PTHREAD_PRIO_INHERIT=yes else ax_cv_PTHREAD_PRIO_INHERIT=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ test "x$ax_pthread_prio_inherit_defined" != "xyes"; then : $as_echo "@%:@define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h ax_pthread_prio_inherit_defined=yes fi CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then case $host_os in aix*) case "x/$CC" in @%:@( x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : #handle absolute path differently from PATH based program lookup case "x$CC" in @%:@( x/*) : if as_fn_executable_p ${CC}_r; then : PTHREAD_CC="${CC}_r" fi ;; @%:@( *) : for ac_prog in ${CC}_r 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_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_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_PTHREAD_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 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" ;; esac ;; @%:@( *) : ;; esac ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then $as_echo "@%:@define HAVE_PTHREAD 1" >>confdefs.h : else ax_pthread_ok=no 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 fi ac_config_files="$ac_config_files Makefile scamper/Makefile utils/Makefile utils/sc_ally/Makefile utils/sc_analysis_dump/Makefile utils/sc_attach/Makefile utils/sc_bdrmap/Makefile utils/sc_filterpolicy/Makefile utils/sc_ipiddump/Makefile utils/sc_prefixscan/Makefile utils/sc_radargun/Makefile utils/sc_remoted/Makefile utils/sc_speedtrap/Makefile utils/sc_tbitblind/Makefile utils/sc_tracediff/Makefile" if test "x$with_sc_uptime" != xno; then ac_config_files="$ac_config_files utils/sc_uptime/Makefile" fi ac_config_files="$ac_config_files utils/sc_warts2csv/Makefile utils/sc_warts2json/Makefile utils/sc_warts2pcap/Makefile utils/sc_warts2text/Makefile utils/sc_wartscat/Makefile utils/sc_wartsdump/Makefile utils/sc_wartsfix/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIB@&t@OBJS; 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 LIB@&t@OBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_SC_UPTIME_TRUE}" && test -z "${WITH_SC_UPTIME_FALSE}"; then as_fn_error $? "conditional \"WITH_SC_UPTIME\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in @%:@( *posix*) : set -o posix ;; @%:@( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in @%:@( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in @%:@(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH @%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] @%:@ ---------------------------------------- @%:@ Output "`basename @S|@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 @S|@? 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 @S|@as_val. Take advantage of shells that can avoid forks. The arguments @%:@ must be portable across @S|@(()) 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 "@S|@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 scamper $as_me 20171204, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ scamper config.status 20171204 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX @%:@@%:@ Running $as_me. @%:@@%:@ _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "scamper/Makefile") CONFIG_FILES="$CONFIG_FILES scamper/Makefile" ;; "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "utils/sc_ally/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_ally/Makefile" ;; "utils/sc_analysis_dump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_analysis_dump/Makefile" ;; "utils/sc_attach/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_attach/Makefile" ;; "utils/sc_bdrmap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_bdrmap/Makefile" ;; "utils/sc_filterpolicy/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_filterpolicy/Makefile" ;; "utils/sc_ipiddump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_ipiddump/Makefile" ;; "utils/sc_prefixscan/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_prefixscan/Makefile" ;; "utils/sc_radargun/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_radargun/Makefile" ;; "utils/sc_remoted/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_remoted/Makefile" ;; "utils/sc_speedtrap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_speedtrap/Makefile" ;; "utils/sc_tbitblind/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_tbitblind/Makefile" ;; "utils/sc_tracediff/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_tracediff/Makefile" ;; "utils/sc_uptime/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_uptime/Makefile" ;; "utils/sc_warts2csv/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2csv/Makefile" ;; "utils/sc_warts2json/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2json/Makefile" ;; "utils/sc_warts2pcap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2pcap/Makefile" ;; "utils/sc_warts2text/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2text/Makefile" ;; "utils/sc_wartscat/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartscat/Makefile" ;; "utils/sc_wartsdump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartsdump/Makefile" ;; "utils/sc_wartsfix/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartsfix/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi scamper-cvs-20171204/autom4te.cache/traces.1000644 001751 000000 00000442625 13211200045 020263 0ustar00mjlwheel000000 000000 m4trace:/usr/local/share/aclocal/libtool.m4:61: -1- AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ]) m4trace:/usr/local/share/aclocal/libtool.m4:99: -1- AU_DEFUN([AC_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:99: -1- AC_DEFUN([AC_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:100: -1- AU_DEFUN([AM_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:100: -1- AC_DEFUN([AM_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:619: -1- AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ]) m4trace:/usr/local/share/aclocal/libtool.m4:812: -1- AC_DEFUN([LT_SUPPORTED_TAG], []) m4trace:/usr/local/share/aclocal/libtool.m4:823: -1- AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ]) m4trace:/usr/local/share/aclocal/libtool.m4:915: -1- AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) m4trace:/usr/local/share/aclocal/libtool.m4:915: -1- AC_DEFUN([AC_LIBTOOL_CXX], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_CXX' is obsolete. You should run autoupdate.])dnl LT_LANG(C++)]) m4trace:/usr/local/share/aclocal/libtool.m4:916: -1- AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) m4trace:/usr/local/share/aclocal/libtool.m4:916: -1- AC_DEFUN([AC_LIBTOOL_F77], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_F77' is obsolete. You should run autoupdate.])dnl LT_LANG(Fortran 77)]) m4trace:/usr/local/share/aclocal/libtool.m4:917: -1- AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) m4trace:/usr/local/share/aclocal/libtool.m4:917: -1- AC_DEFUN([AC_LIBTOOL_FC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_FC' is obsolete. You should run autoupdate.])dnl LT_LANG(Fortran)]) m4trace:/usr/local/share/aclocal/libtool.m4:918: -1- AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) m4trace:/usr/local/share/aclocal/libtool.m4:918: -1- AC_DEFUN([AC_LIBTOOL_GCJ], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_GCJ' is obsolete. You should run autoupdate.])dnl LT_LANG(Java)]) m4trace:/usr/local/share/aclocal/libtool.m4:919: -1- AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) m4trace:/usr/local/share/aclocal/libtool.m4:919: -1- AC_DEFUN([AC_LIBTOOL_RC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_RC' is obsolete. You should run autoupdate.])dnl LT_LANG(Windows Resource)]) m4trace:/usr/local/share/aclocal/libtool.m4:1247: -1- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) m4trace:/usr/local/share/aclocal/libtool.m4:1578: -1- AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ]) m4trace:/usr/local/share/aclocal/libtool.m4:1620: -1- AU_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1620: -1- AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_COMPILER_OPTION' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1629: -1- AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ]) m4trace:/usr/local/share/aclocal/libtool.m4:1664: -1- AU_DEFUN([AC_LIBTOOL_LINKER_OPTION], [m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1664: -1- AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_LINKER_OPTION' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1671: -1- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ]) m4trace:/usr/local/share/aclocal/libtool.m4:1810: -1- AU_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1810: -1- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_SYS_MAX_CMD_LEN' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:1921: -1- AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ]) m4trace:/usr/local/share/aclocal/libtool.m4:2046: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:2046: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN_SELF' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3155: -1- AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ]) m4trace:/usr/local/share/aclocal/libtool.m4:3217: -1- AU_DEFUN([AC_PATH_TOOL_PREFIX], [m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3217: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_DIAGNOSE([obsolete], [The macro `AC_PATH_TOOL_PREFIX' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3240: -1- AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ]) m4trace:/usr/local/share/aclocal/libtool.m4:3754: -1- AU_DEFUN([AM_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3754: -1- AC_DEFUN([AM_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_NM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3755: -1- AU_DEFUN([AC_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3755: -1- AC_DEFUN([AC_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_NM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3826: -1- AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ]) m4trace:/usr/local/share/aclocal/libtool.m4:3840: -1- AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ]) m4trace:/usr/local/share/aclocal/libtool.m4:3859: -1- AU_DEFUN([AC_CHECK_LIBM], [m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:3859: -1- AC_DEFUN([AC_CHECK_LIBM], [AC_DIAGNOSE([obsolete], [The macro `AC_CHECK_LIBM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8122: -1- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) m4trace:/usr/local/share/aclocal/libtool.m4:8131: -1- AU_DEFUN([LT_AC_PROG_GCJ], [m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8131: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_GCJ' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8138: -1- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) m4trace:/usr/local/share/aclocal/libtool.m4:8145: -1- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) m4trace:/usr/local/share/aclocal/libtool.m4:8150: -1- AU_DEFUN([LT_AC_PROG_RC], [m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8150: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_RC' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8270: -1- AU_DEFUN([LT_AC_PROG_SED], [m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) m4trace:/usr/local/share/aclocal/libtool.m4:8270: -1- AC_DEFUN([LT_AC_PROG_SED], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_SED' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) m4trace:/usr/local/share/aclocal/ltargz.m4:12: -1- AC_DEFUN([LT_FUNC_ARGZ], [ AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for 'error_t' if it is not otherwise available.]) AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h does not typedef error_t.])], [#if defined(HAVE_ARGZ_H) # include #endif]) LT_ARGZ_H= AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify], [], [LT_ARGZ_H=lt__argz.h; AC_LIBOBJ([lt__argz])]) dnl if have system argz functions, allow forced use of dnl libltdl-supplied implementation (and default to do so dnl on "known bad" systems). Could use a runtime check, but dnl (a) detecting malloc issues is notoriously unreliable dnl (b) only known system that declares argz functions, dnl provides them, yet they are broken, is cygwin dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) dnl So, it's more straightforward simply to special case dnl this for known bad systems. AS_IF([test -z "$LT_ARGZ_H"], [AC_CACHE_CHECK( [if argz actually works], [lt_cv_sys_argz_works], [[case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test no != "$cross_compiling"; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test 1 -lt "$lt_os_major" \ || { test 1 -eq "$lt_os_major" \ && { test 5 -lt "$lt_os_minor" \ || { test 5 -eq "$lt_os_minor" \ && test 24 -lt "$lt_os_micro"; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) AS_IF([test yes = "$lt_cv_sys_argz_works"], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [LT_ARGZ_H=lt__argz.h AC_LIBOBJ([lt__argz])])]) AC_SUBST([LT_ARGZ_H]) ]) m4trace:/usr/local/share/aclocal/ltdl.m4:16: -1- AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) _$0($*) ]) m4trace:/usr/local/share/aclocal/ltdl.m4:68: -1- AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ]) m4trace:/usr/local/share/aclocal/ltdl.m4:81: -1- AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) m4trace:/usr/local/share/aclocal/ltdl.m4:81: -1- AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBLTDL_CONVENIENCE' is obsolete. You should run autoupdate.])dnl _LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) m4trace:/usr/local/share/aclocal/ltdl.m4:124: -1- AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ]) m4trace:/usr/local/share/aclocal/ltdl.m4:137: -1- AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) m4trace:/usr/local/share/aclocal/ltdl.m4:137: -1- AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBLTDL_INSTALLABLE' is obsolete. You should run autoupdate.])dnl _LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) m4trace:/usr/local/share/aclocal/ltdl.m4:213: -1- AC_DEFUN([_LT_LIBOBJ], [ m4_pattern_allow([^_LT_LIBOBJS$]) _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" ]) m4trace:/usr/local/share/aclocal/ltdl.m4:226: -1- AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) dnl We need to keep our own list of libobjs separate from our parent project, dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while dnl we look for our own LIBOBJs. m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) m4_pushdef([AC_LIBSOURCES]) dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: m4_if(_LTDL_MODE, [], [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) AC_ARG_WITH([included_ltdl], [AS_HELP_STRING([--with-included-ltdl], [use the GNU ltdl sources included here])]) if test yes != "$with_included_ltdl"; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_DECL([lt_dlinterface_register], [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], [with_included_ltdl=no], [with_included_ltdl=yes])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT #include ])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT] ) fi dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE dnl was called yet, then for old times' sake, we assume libltdl is in an dnl eponymous directory: AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) AC_ARG_WITH([ltdl_include], [AS_HELP_STRING([--with-ltdl-include=DIR], [use the ltdl headers installed in DIR])]) if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else AC_MSG_ERROR([invalid ltdl include directory: '$with_ltdl_include']) fi else with_ltdl_include=no fi AC_ARG_WITH([ltdl_lib], [AS_HELP_STRING([--with-ltdl-lib=DIR], [use the libltdl.la installed in DIR])]) if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else AC_MSG_ERROR([invalid ltdl library directory: '$with_ltdl_lib']) fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) m4_case(m4_default(_LTDL_TYPE, [convenience]), [convenience], [_LTDL_CONVENIENCE], [installable], [_LTDL_INSTALLABLE], [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. AC_DEFINE([HAVE_LTDL], [1], [Define this if a modern libltdl is already installed]) LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) AC_MSG_ERROR(['--with-ltdl-include' and '--with-ltdl-lib' options must be used together]) ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL=-I$with_ltdl_include ;; esac INCLTDL=$LTDLINCL # Report our decision... AC_MSG_CHECKING([where to find libltdl headers]) AC_MSG_RESULT([$LTDLINCL]) AC_MSG_CHECKING([where to find libltdl library]) AC_MSG_RESULT([$LIBLTDL]) _LTDL_SETUP dnl restore autoconf definition. m4_popdef([AC_LIBOBJ]) m4_popdef([AC_LIBSOURCES]) AC_CONFIG_COMMANDS_PRE([ _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) ]) # Only expand once: m4_define([LTDL_INIT]) ]) m4trace:/usr/local/share/aclocal/ltdl.m4:352: -1- AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:352: -1- AC_DEFUN([AC_LIB_LTDL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIB_LTDL' is obsolete. You should run autoupdate.])dnl LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:353: -1- AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:353: -1- AC_DEFUN([AC_WITH_LTDL], [AC_DIAGNOSE([obsolete], [The macro `AC_WITH_LTDL' is obsolete. You should run autoupdate.])dnl LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:354: -1- AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:354: -1- AC_DEFUN([LT_WITH_LTDL], [AC_DIAGNOSE([obsolete], [The macro `LT_WITH_LTDL' is obsolete. You should run autoupdate.])dnl LTDL_INIT($@)]) m4trace:/usr/local/share/aclocal/ltdl.m4:367: -1- AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_SYS_MODULE_EXT])dnl AC_REQUIRE([LT_SYS_MODULE_PATH])dnl AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl AC_REQUIRE([LT_LIB_DLLOAD])dnl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl AC_REQUIRE([LT_FUNC_ARGZ])dnl m4_require([_LT_CHECK_OBJDIR])dnl m4_require([_LT_HEADER_DLFCN])dnl m4_require([_LT_CHECK_DLPREOPEN])dnl m4_require([_LT_DECL_SED])dnl dnl Don't require this, or it will be expanded earlier than the code dnl that sets the variables it relies on: _LT_ENABLE_INSTALL dnl _LTDL_MODE specific code must be called at least once: _LTDL_MODE_DISPATCH # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). AC_CONFIG_COMMANDS_PRE([dnl m4_pattern_allow([^LT_CONFIG_H$])dnl m4_ifset([AH_HEADER], [LT_CONFIG_H=AH_HEADER], [m4_ifset([AC_LIST_HEADERS], [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's|^[[ ]]*||;s|[[ :]].*$||'`], [])])]) AC_SUBST([LT_CONFIG_H]) AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) m4_pattern_allow([LT_LIBEXT])dnl AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) name= eval "lt_libprefix=\"$libname_spec\"" m4_pattern_allow([LT_LIBPREFIX])dnl AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) name=ltdl eval "LTDLOPEN=\"$libname_spec\"" AC_SUBST([LTDLOPEN]) ]) m4trace:/usr/local/share/aclocal/ltdl.m4:443: -1- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [lt_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this 'case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[[4-9]]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; bitrig*) lt_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 lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[[12345]]*|irix6.[[01]]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say 'no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to 'yes'. Without it, it would be 'no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say 'yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test yes != "$lt_cv_sys_dlopen_deplibs"; then AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], [Define if the OS needs help to load dependent libraries for dlopen().]) fi ]) m4trace:/usr/local/share/aclocal/ltdl.m4:545: -1- AU_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:545: -1- AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYS_DLOPEN_DEPLIBS' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:552: -1- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([what extension is used for runtime loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_MODULE_EXT])dnl AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for runtime loadable modules, say, ".so".]) fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_SHARED_EXT])dnl AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"], [Define to the shared library suffix, say, ".dylib".]) fi if test -n "$shared_archive_member_spec"; then m4_pattern_allow([LT_SHARED_LIB_MEMBER])dnl AC_DEFINE_UNQUOTED([LT_SHARED_LIB_MEMBER], ["($shared_archive_member_spec.o)"], [Define to the shared archive member specification, say "(shr.o)".]) fi ]) m4trace:/usr/local/share/aclocal/ltdl.m4:580: -1- AU_DEFUN([AC_LTDL_SHLIBEXT], [m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:580: -1- AC_DEFUN([AC_LTDL_SHLIBEXT], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBEXT' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:587: -1- AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([what variable specifies run-time module search path], [lt_cv_module_path_var], [lt_cv_module_path_var=$shlibpath_var]) if test -n "$lt_cv_module_path_var"; then m4_pattern_allow([LT_MODULE_PATH_VAR])dnl AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], [Define to the name of the environment variable that determines the run-time module search path.]) fi ]) m4trace:/usr/local/share/aclocal/ltdl.m4:599: -1- AU_DEFUN([AC_LTDL_SHLIBPATH], [m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:599: -1- AC_DEFUN([AC_LTDL_SHLIBPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBPATH' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:606: -1- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([for the default library search path], [lt_cv_sys_dlsearch_path], [lt_cv_sys_dlsearch_path=$sys_lib_dlsearch_path_spec]) if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path=$dir else sys_dlsearch_path=$sys_dlsearch_path$PATH_SEPARATOR$dir fi done m4_pattern_allow([LT_DLSEARCH_PATH])dnl AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], [Define to the system default library search path.]) fi ]) m4trace:/usr/local/share/aclocal/ltdl.m4:627: -1- AU_DEFUN([AC_LTDL_SYSSEARCHPATH], [m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:627: -1- AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYSSEARCHPATH' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:653: -1- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) AC_LANG_PUSH([C]) lt_dlload_save_LIBS=$LIBS LIBADD_DLOPEN= AC_SEARCH_LIBS([dlopen], [dl], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) if test "$ac_cv_search_dlopen" != "none required"; then LIBADD_DLOPEN=-ldl fi libltdl_cv_lib_dl_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H # include #endif ]], [[dlopen(0, 0);]])], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN=-lsvld libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen" then lt_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" AC_CHECK_FUNCS([dlerror]) LIBS=$lt_save_LIBS fi AC_SUBST([LIBADD_DLOPEN]) LIBADD_SHL_LOAD= AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD=-ldld])]) AC_SUBST([LIBADD_SHL_LOAD]) case $host_os in darwin[[1567]].*) # We only want this for pre-Mac OS X 10.4. AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | pw32*) AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) AC_SUBST([LIBADD_DLD_LINK]) m4_pattern_allow([^LT_DLPREOPEN$]) LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done AC_DEFINE([HAVE_LIBDLLOADER], [1], [Define if libdlloader will be built on this platform]) fi AC_SUBST([LT_DLPREOPEN]) dnl This isn't used anymore, but set it for backwards compatibility LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" AC_SUBST([LIBADD_DL]) LIBS=$lt_dlload_save_LIBS AC_LANG_POP ]) m4trace:/usr/local/share/aclocal/ltdl.m4:748: -1- AU_DEFUN([AC_LTDL_DLLIB], [m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:748: -1- AC_DEFUN([AC_LTDL_DLLIB], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLLIB' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:756: -1- AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([for _ prefix in compiled symbols], [lt_cv_sys_symbol_underscore], [lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.c >&AS_MESSAGE_LOG_FD fi rm -rf conftest* ]) sys_symbol_underscore=$lt_cv_sys_symbol_underscore AC_SUBST([sys_symbol_underscore]) ]) m4trace:/usr/local/share/aclocal/ltdl.m4:793: -1- AU_DEFUN([AC_LTDL_SYMBOL_USCORE], [m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:793: -1- AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYMBOL_USCORE' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:800: -1- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([_LT_COMPILER_PIC])dnl for lt_prog_compiler_wl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl for lt_cv_sys_symbol_underscore AC_REQUIRE([LT_SYS_MODULE_EXT])dnl for libltdl_cv_shlibext if test yes = "$lt_cv_sys_symbol_underscore"; then if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen"; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], [libltdl_cv_need_uscore], [libltdl_cv_need_uscore=unknown dlsym_uscore_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" libname=conftmod # stay within 8.3 filename limits! cat >$libname.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; }] _LT_EOF # ltfn_module_cmds module_cmds # Execute tilde-delimited MODULE_CMDS with environment primed for # $module_cmds or $archive_cmds type content. ltfn_module_cmds () {( # subshell avoids polluting parent global environment module_cmds_save_ifs=$IFS; IFS='~' for cmd in @S|@1; do IFS=$module_cmds_save_ifs libobjs=$libname.$ac_objext; lib=$libname$libltdl_cv_shlibext rpath=/not-exists; soname=$libname$libltdl_cv_shlibext; output_objdir=. major=; versuffix=; verstring=; deplibs= ECHO=echo; wl=$lt_prog_compiler_wl; allow_undefined_flag= eval $cmd done IFS=$module_cmds_save_ifs )} # Compile a loadable module using libtool macro expansion results. $CC $pic_flag -c $libname.$ac_ext ltfn_module_cmds "${module_cmds:-$archive_cmds}" # Try to fetch fnord with dlsym(). libltdl_dlunknown=0; libltdl_dlnouscore=1; libltdl_dluscore=2 cat >conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifndef RTLD_GLOBAL # ifdef DL_GLOBAL # define RTLD_GLOBAL DL_GLOBAL # else # define RTLD_GLOBAL 0 # endif #endif #ifndef RTLD_NOW # ifdef DL_NOW # define RTLD_NOW DL_NOW # else # define RTLD_NOW 0 # endif #endif int main () { void *handle = dlopen ("`pwd`/$libname$libltdl_cv_shlibext", RTLD_GLOBAL|RTLD_NOW); int status = $libltdl_dlunknown; if (handle) { if (dlsym (handle, "fnord")) status = $libltdl_dlnouscore; else { if (dlsym (handle, "_fnord")) status = $libltdl_dluscore; else puts (dlerror ()); } dlclose (handle); } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null libltdl_status=$? case x$libltdl_status in x$libltdl_dlnouscore) libltdl_cv_need_uscore=no ;; x$libltdl_dluscore) libltdl_cv_need_uscore=yes ;; x*) libltdl_cv_need_uscore=unknown ;; esac fi rm -rf conftest* $libname* LIBS=$dlsym_uscore_save_LIBS ]) fi fi if test yes = "$libltdl_cv_need_uscore"; then AC_DEFINE([NEED_USCORE], [1], [Define if dlsym() requires a leading underscore in symbol names.]) fi ]) m4trace:/usr/local/share/aclocal/ltdl.m4:907: -1- AU_DEFUN([AC_LTDL_DLSYM_USCORE], [m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) m4trace:/usr/local/share/aclocal/ltdl.m4:907: -1- AC_DEFUN([AC_LTDL_DLSYM_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLSYM_USCORE' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) m4trace:/usr/local/share/aclocal/ltoptions.m4:14: -1- AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) m4trace:/usr/local/share/aclocal/ltoptions.m4:113: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:113: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:148: -1- AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:148: -1- AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. You should run autoupdate.])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:197: -1- AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:201: -1- AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:205: -1- AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:205: -1- AC_DEFUN([AM_ENABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_SHARED' is obsolete. You should run autoupdate.])dnl AC_ENABLE_SHARED($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:206: -1- AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:206: -1- AC_DEFUN([AM_DISABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_SHARED' is obsolete. You should run autoupdate.])dnl AC_DISABLE_SHARED($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:251: -1- AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:255: -1- AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:259: -1- AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:259: -1- AC_DEFUN([AM_ENABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_STATIC' is obsolete. You should run autoupdate.])dnl AC_ENABLE_STATIC($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:260: -1- AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:260: -1- AC_DEFUN([AM_DISABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_STATIC' is obsolete. You should run autoupdate.])dnl AC_DISABLE_STATIC($@)]) m4trace:/usr/local/share/aclocal/ltoptions.m4:305: -1- AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:305: -1- AC_DEFUN([AC_ENABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_ENABLE_FAST_INSTALL' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:312: -1- AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:312: -1- AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_DISABLE_FAST_INSTALL' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:411: -1- AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltoptions.m4:411: -1- AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_PICMODE' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) m4trace:/usr/local/share/aclocal/ltsugar.m4:14: -1- AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) m4trace:/usr/local/share/aclocal/ltversion.m4:18: -1- AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:37: -1- AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:41: -1- AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:42: -1- AC_DEFUN([_LT_AC_SHELL_INIT]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:43: -1- AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:45: -1- AC_DEFUN([_LT_AC_TAGVAR]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:46: -1- AC_DEFUN([AC_LTDL_ENABLE_INSTALL]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:47: -1- AC_DEFUN([AC_LTDL_PREOPEN]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:48: -1- AC_DEFUN([_LT_AC_SYS_COMPILER]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:49: -1- AC_DEFUN([_LT_AC_LOCK]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:50: -1- AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:51: -1- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:52: -1- AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:53: -1- AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:54: -1- AC_DEFUN([AC_LIBTOOL_OBJDIR]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:55: -1- AC_DEFUN([AC_LTDL_OBJDIR]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:56: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:57: -1- AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:58: -1- AC_DEFUN([AC_PATH_MAGIC]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:59: -1- AC_DEFUN([AC_PROG_LD_GNU]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:60: -1- AC_DEFUN([AC_PROG_LD_RELOAD_FLAG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:61: -1- AC_DEFUN([AC_DEPLIBS_CHECK_METHOD]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:62: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:63: -1- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:64: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:65: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:66: -1- AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:67: -1- AC_DEFUN([LT_AC_PROG_EGREP]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:72: -1- AC_DEFUN([_AC_PROG_LIBTOOL]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:73: -1- AC_DEFUN([AC_LIBTOOL_SETUP]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:74: -1- AC_DEFUN([_LT_AC_CHECK_DLFCN]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:75: -1- AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:76: -1- AC_DEFUN([_LT_AC_TAGCONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:78: -1- AC_DEFUN([_LT_AC_LANG_CXX]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:79: -1- AC_DEFUN([_LT_AC_LANG_F77]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:80: -1- AC_DEFUN([_LT_AC_LANG_GCJ]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:81: -1- AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:82: -1- AC_DEFUN([_LT_AC_LANG_C_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:83: -1- AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:84: -1- AC_DEFUN([_LT_AC_LANG_CXX_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:85: -1- AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:86: -1- AC_DEFUN([_LT_AC_LANG_F77_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:87: -1- AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:88: -1- AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:89: -1- AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:90: -1- AC_DEFUN([_LT_AC_LANG_RC_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:91: -1- AC_DEFUN([AC_LIBTOOL_CONFIG]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:92: -1- AC_DEFUN([_LT_AC_FILE_LTDLL_C]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:94: -1- AC_DEFUN([_LT_AC_PROG_CXXCPP]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:97: -1- AC_DEFUN([_LT_PROG_F77]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:98: -1- AC_DEFUN([_LT_PROG_FC]) m4trace:/usr/local/share/aclocal/lt~obsolete.m4:99: -1- AC_DEFUN([_LT_PROG_CXX]) m4trace:/usr/local/share/aclocal-1.15/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' 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.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) m4trace:/usr/local/share/aclocal-1.15/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) m4trace:/usr/local/share/aclocal-1.15/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) m4trace:/usr/local/share/aclocal-1.15/cond.m4:12: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) m4trace:/usr/local/share/aclocal-1.15/depend.m4:26: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) m4trace:/usr/local/share/aclocal-1.15/depend.m4:163: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) m4trace:/usr/local/share/aclocal-1.15/depend.m4:171: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) m4trace:/usr/local/share/aclocal-1.15/depout.m4:12: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ]) m4trace:/usr/local/share/aclocal-1.15/depout.m4:71: -1- 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"]) ]) m4trace:/usr/local/share/aclocal-1.15/init.m4:29: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) m4trace:/usr/local/share/aclocal-1.15/init.m4:186: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) m4trace:/usr/local/share/aclocal-1.15/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) m4trace:/usr/local/share/aclocal-1.15/lead-dot.m4:10: -1- 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])]) m4trace:/usr/local/share/aclocal-1.15/make.m4:12: -1- AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) m4trace:/usr/local/share/aclocal-1.15/missing.m4:11: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) m4trace:/usr/local/share/aclocal-1.15/missing.m4:20: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) m4trace:/usr/local/share/aclocal-1.15/options.m4:11: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) m4trace:/usr/local/share/aclocal-1.15/options.m4:17: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) m4trace:/usr/local/share/aclocal-1.15/options.m4:23: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) m4trace:/usr/local/share/aclocal-1.15/options.m4:29: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) m4trace:/usr/local/share/aclocal-1.15/prog-cc-c-o.m4:12: -1- AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) m4trace:/usr/local/share/aclocal-1.15/prog-cc-c-o.m4:47: -1- AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) m4trace:/usr/local/share/aclocal-1.15/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) m4trace:/usr/local/share/aclocal-1.15/sanity.m4:11: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) m4trace:/usr/local/share/aclocal-1.15/silent.m4:12: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) m4trace:/usr/local/share/aclocal-1.15/strip.m4:17: -1- 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])]) m4trace:/usr/local/share/aclocal-1.15/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) m4trace:/usr/local/share/aclocal-1.15/substnot.m4:17: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) m4trace:/usr/local/share/aclocal-1.15/tar.m4:23: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) m4trace:m4/ax_check_openssl.m4:37: -1- AU_DEFUN([CHECK_SSL], [m4_if($#, 0, [AX_CHECK_OPENSSL], [AX_CHECK_OPENSSL($@)])]) m4trace:m4/ax_check_openssl.m4:37: -1- AC_DEFUN([CHECK_SSL], [AC_DIAGNOSE([obsolete], [The macro `CHECK_SSL' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [AX_CHECK_OPENSSL], [AX_CHECK_OPENSSL($@)])]) m4trace:m4/ax_check_openssl.m4:38: -1- AC_DEFUN([AX_CHECK_OPENSSL], [ found=false AC_ARG_WITH([openssl], [AS_HELP_STRING([--with-openssl=DIR], [root of the OpenSSL directory])], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([Invalid --with-openssl value]) ;; *) ssldirs="$withval" ;; esac ], [ # if pkg-config is installed and openssl has installed a .pc file, # then use that information and don't search ssldirs AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) if test x"$PKG_CONFIG" != x""; then OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` if test $? = 0; then OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` found=true fi fi # no such luck; use some default ssldirs if ! $found; then ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" fi ] ) # note that we #include , so the OpenSSL headers have to be in # an 'openssl' subdirectory if ! $found; then OPENSSL_INCLUDES= for ssldir in $ssldirs; do AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) if test -f "$ssldir/include/openssl/ssl.h"; then OPENSSL_INCLUDES="-I$ssldir/include" OPENSSL_LDFLAGS="-L$ssldir/lib" OPENSSL_LIBS="-lssl -lcrypto" found=true AC_MSG_RESULT([yes]) break else AC_MSG_RESULT([no]) fi done # if the file wasn't found, well, go ahead and try the link anyway -- maybe # it will just work! fi # try the preprocessor and linker with our new flags, # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD save_LIBS="$LIBS" save_LDFLAGS="$LDFLAGS" save_CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" LIBS="$OPENSSL_LIBS $LIBS" CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" AC_LINK_IFELSE( [AC_LANG_PROGRAM([#include ], [SSL_new(NULL)])], [ AC_MSG_RESULT([yes]) $1 ], [ AC_MSG_RESULT([no]) $2 ]) CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" AC_SUBST([OPENSSL_INCLUDES]) AC_SUBST([OPENSSL_LIBS]) AC_SUBST([OPENSSL_LDFLAGS]) ]) m4trace:m4/ax_gcc_builtin.m4:96: -1- AC_DEFUN([AX_GCC_BUILTIN], [ AS_VAR_PUSHDEF([ac_var], [ax_cv_have_$1]) AC_CACHE_CHECK([for $1], [ac_var], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [ m4_case([$1], [__builtin_assume_aligned], [$1("", 0)], [__builtin_bswap16], [$1(0)], [__builtin_bswap32], [$1(0)], [__builtin_bswap64], [$1(0)], [__builtin_choose_expr], [$1(0, 0, 0)], [__builtin___clear_cache], [$1("", "")], [__builtin_clrsb], [$1(0)], [__builtin_clrsbl], [$1(0)], [__builtin_clrsbll], [$1(0)], [__builtin_clz], [$1(0)], [__builtin_clzl], [$1(0)], [__builtin_clzll], [$1(0)], [__builtin_complex], [$1(0.0, 0.0)], [__builtin_constant_p], [$1(0)], [__builtin_ctz], [$1(0)], [__builtin_ctzl], [$1(0)], [__builtin_ctzll], [$1(0)], [__builtin_expect], [$1(0, 0)], [__builtin_ffs], [$1(0)], [__builtin_ffsl], [$1(0)], [__builtin_ffsll], [$1(0)], [__builtin_fpclassify], [$1(0, 1, 2, 3, 4, 0.0)], [__builtin_huge_val], [$1()], [__builtin_huge_valf], [$1()], [__builtin_huge_vall], [$1()], [__builtin_inf], [$1()], [__builtin_infd128], [$1()], [__builtin_infd32], [$1()], [__builtin_infd64], [$1()], [__builtin_inff], [$1()], [__builtin_infl], [$1()], [__builtin_isinf_sign], [$1(0.0)], [__builtin_nan], [$1("")], [__builtin_nand128], [$1("")], [__builtin_nand32], [$1("")], [__builtin_nand64], [$1("")], [__builtin_nanf], [$1("")], [__builtin_nanl], [$1("")], [__builtin_nans], [$1("")], [__builtin_nansf], [$1("")], [__builtin_nansl], [$1("")], [__builtin_object_size], [$1("", 0)], [__builtin_parity], [$1(0)], [__builtin_parityl], [$1(0)], [__builtin_parityll], [$1(0)], [__builtin_popcount], [$1(0)], [__builtin_popcountl], [$1(0)], [__builtin_popcountll], [$1(0)], [__builtin_powi], [$1(0, 0)], [__builtin_powif], [$1(0, 0)], [__builtin_powil], [$1(0, 0)], [__builtin_prefetch], [$1("")], [__builtin_trap], [$1()], [__builtin_types_compatible_p], [$1(int, int)], [__builtin_unreachable], [$1()], [m4_warn([syntax], [Unsupported built-in $1, the test may fail]) $1()] ) ])], [AS_VAR_SET([ac_var], [yes])], [AS_VAR_SET([ac_var], [no])]) ]) AS_IF([test yes = AS_VAR_GET([ac_var])], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1, [Define to 1 if the system has the `$1' built-in function])], []) AS_VAR_POPDEF([ac_var]) ]) m4trace:m4/ax_pthread.m4:87: -1- AU_DEFUN([ACX_PTHREAD], [m4_if($#, 0, [AX_PTHREAD], [AX_PTHREAD($@)])]) m4trace:m4/ax_pthread.m4:87: -1- AC_DEFUN([ACX_PTHREAD], [AC_DIAGNOSE([obsolete], [The macro `ACX_PTHREAD' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [AX_PTHREAD], [AX_PTHREAD($@)])]) m4trace:m4/ax_pthread.m4:88: -1- AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_SED]) AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then ax_pthread_save_CC="$CC" ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) AC_MSG_RESULT([$ax_pthread_ok]) if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi CC="$ax_pthread_save_CC" CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 # (Note: HP C rejects this with "bad form for `-t' option") # -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads and # -D_REENTRANT too), HP C (must be checked before -lpthread, which # is present but should not be used directly; and before -mthreads, # because the compiler interprets this as "-mt" + "-hreads") # -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case $host_os in freebsd*) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) ax_pthread_flags="-kthread lthread $ax_pthread_flags" ;; hpux*) # From the cc(1) man page: "[-mt] Sets various -D flags to enable # multi-threading and also sets -lpthread." ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" ;; openedition*) # IBM z/OS requires a feature-test macro to be defined in order to # enable POSIX threads at all, so give the user a hint if this is # not set. (We don't define these ourselves, as they can affect # other portions of the system API in unpredictable ways.) AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], [ # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) AX_PTHREAD_ZOS_MISSING # endif ], [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) ;; solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (N.B.: The stubs are missing # pthread_cleanup_push, or rather a function called by this macro, # so we could check for that, but who knows whether they'll stub # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" ;; esac # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) AS_IF([test "x$GCC" = "xyes"], [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"]) # The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled case $host_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; aix*) ax_pthread_check_macro="_THREAD_SAFE" ;; *) ax_pthread_check_macro="--" ;; esac AS_IF([test "x$ax_pthread_check_macro" = "x--"], [ax_pthread_check_cond=0], [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) # Are we compiling with Clang? AC_CACHE_CHECK([whether $CC is Clang], [ax_cv_PTHREAD_CLANG], [ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ # if defined(__clang__) && defined(__llvm__) AX_PTHREAD_CC_IS_CLANG # endif ], [ax_cv_PTHREAD_CLANG=yes]) fi ]) ax_pthread_clang="$ax_cv_PTHREAD_CLANG" ax_pthread_clang_warning=no # Clang needs special handling, because older versions handle the -pthread # option in a rather... idiosyncratic way if test "x$ax_pthread_clang" = "xyes"; then # Clang takes -pthread; it has never supported any other flag # (Note 1: This will need to be revisited if a system that Clang # supports has POSIX threads in a separate library. This tends not # to be the way of modern systems, but it's conceivable.) # (Note 2: On some systems, notably Darwin, -pthread is not needed # to get POSIX threads support; the API is always present and # active. We could reasonably leave PTHREAD_CFLAGS empty. But # -pthread does define _REENTRANT, and while the Darwin headers # ignore this macro, third-party headers might not.) PTHREAD_CFLAGS="-pthread" PTHREAD_LIBS= ax_pthread_ok=yes # However, older versions of Clang make a point of warning the user # that, in an invocation where only linking and no compilation is # taking place, the -pthread option has no effect ("argument unused # during compilation"). They expect -pthread to be passed in only # when source code is being compiled. # # Problem is, this is at odds with the way Automake and most other # C build frameworks function, which is that the same flags used in # compilation (CFLAGS) are also used in linking. Many systems # supported by AX_PTHREAD require exactly this for POSIX threads # support, and in fact it is often not straightforward to specify a # flag that is used only in the compilation phase and not in # linking. Such a scenario is extremely rare in practice. # # Even though use of the -pthread flag in linking would only print # a warning, this can be a nuisance for well-run software projects # that build with -Werror. So if the active version of Clang has # this misfeature, we search for an option to squash it. AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second # step ax_pthread_save_ac_link="$ac_link" ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" ac_link="$ax_pthread_save_ac_link" AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], [ac_link="$ax_pthread_2step_ac_link" AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], [break]) ]) done ac_link="$ax_pthread_save_ac_link" CFLAGS="$ax_pthread_save_CFLAGS" AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" ]) case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in no | unknown) ;; *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; esac fi # $ax_pthread_clang = yes if test "x$ax_pthread_ok" = "xno"; then for ax_pthread_try_flag in $ax_pthread_flags; do case $ax_pthread_try_flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -mt,pthread) AC_MSG_CHECKING([whether pthreads work with -mt -lpthread]) PTHREAD_CFLAGS="-mt" PTHREAD_LIBS="-lpthread" ;; -*) AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_LINK_IFELSE([AC_LANG_PROGRAM([#include # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */])], [ax_pthread_ok=yes], []) CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" AC_MSG_RESULT([$ax_pthread_ok]) AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = "xyes"; then ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_CACHE_CHECK([for joinable pthread attribute], [ax_cv_PTHREAD_JOINABLE_ATTR], [ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [int attr = $ax_pthread_attr; return attr /* ; */])], [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], []) done ]) AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ test "x$ax_pthread_joinable_attr_defined" != "xyes"], [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$ax_cv_PTHREAD_JOINABLE_ATTR], [Define to necessary symbol if this constant uses a non-standard name on your system.]) ax_pthread_joinable_attr_defined=yes ]) AC_CACHE_CHECK([whether more special flags are required for pthreads], [ax_cv_PTHREAD_SPECIAL_FLAGS], [ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac ]) AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ test "x$ax_pthread_special_flags_added" != "xyes"], [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" ax_pthread_special_flags_added=yes]) AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], [ax_cv_PTHREAD_PRIO_INHERIT], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int i = PTHREAD_PRIO_INHERIT;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ test "x$ax_pthread_prio_inherit_defined" != "xyes"], [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) ax_pthread_prio_inherit_defined=yes ]) CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then case $host_os in aix*) AS_CASE(["x/$CC"], [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], [#handle absolute path differently from PATH based program lookup AS_CASE(["x$CC"], [x/*], [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CC]) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) : else ax_pthread_ok=no $2 fi AC_LANG_POP ]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:3: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) m4trace:configure.ac:3: -1- m4_pattern_allow([^AS_FLAGS$]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?AS_]) m4trace:configure.ac:3: -1- m4_pattern_allow([^SHELL$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PATH_SEPARATOR$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_URL$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^exec_prefix$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^prefix$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^program_transform_name$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^bindir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^sbindir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^libexecdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^datarootdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^datadir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^sysconfdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^sharedstatedir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^localstatedir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^includedir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^oldincludedir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^docdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^infodir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^htmldir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^dvidir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^pdfdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^psdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^libdir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^localedir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^mandir$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_URL$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^DEFS$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^ECHO_C$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^ECHO_N$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^ECHO_T$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^build_alias$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^host_alias$]) m4trace:configure.ac:3: -1- m4_pattern_allow([^target_alias$]) m4trace:configure.ac:5: -1- AC_CONFIG_MACRO_DIR([m4]) m4trace:configure.ac:7: -1- AM_INIT_AUTOMAKE m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) m4trace:configure.ac:7: -1- AM_SET_CURRENT_AUTOMAKE_VERSION m4trace:configure.ac:7: -1- AM_AUTOMAKE_VERSION([1.15.1]) m4trace:configure.ac:7: -1- _AM_AUTOCONF_VERSION([2.69]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_DATA$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^am__isrc$]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__isrc]) m4trace:configure.ac:7: -1- m4_pattern_allow([^CYGPATH_W$]) m4trace:configure.ac:7: -1- _AM_SET_OPTIONS([]) m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])]) m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-define]) m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) m4trace:configure.ac:7: -1- AM_SANITY_CHECK m4trace:configure.ac:7: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) m4trace:configure.ac:7: -1- AM_MISSING_HAS_RUN m4trace:configure.ac:7: -1- AM_AUX_DIR_EXPAND m4trace:configure.ac:7: -1- m4_pattern_allow([^ACLOCAL$]) m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOCONF$]) m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOMAKE$]) m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOHEADER$]) m4trace:configure.ac:7: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) m4trace:configure.ac:7: -1- m4_pattern_allow([^MAKEINFO$]) m4trace:configure.ac:7: -1- AM_PROG_INSTALL_SH m4trace:configure.ac:7: -1- m4_pattern_allow([^install_sh$]) m4trace:configure.ac:7: -1- AM_PROG_INSTALL_STRIP m4trace:configure.ac:7: -1- m4_pattern_allow([^STRIP$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^MKDIR_P$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^mkdir_p$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AWK$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^SET_MAKE$]) m4trace:configure.ac:7: -1- AM_SET_LEADING_DOT m4trace:configure.ac:7: -1- m4_pattern_allow([^am__leading_dot$]) m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-ustar]) m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-pax]) m4trace:configure.ac:7: -1- _AM_PROG_TAR([v7]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AMTAR$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^am__tar$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^am__untar$]) m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-dependencies]) m4trace:configure.ac:7: -1- AM_SILENT_RULES m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_V$]) m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_V]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_V]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_V$]) m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_DEFAULT_V]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_BACKSLASH$]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) m4trace:configure.ac:10: -1- AC_PROG_LIBTOOL m4trace:configure.ac:10: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. You should run autoupdate.], [/usr/local/share/aclocal/libtool.m4:99: AC_PROG_LIBTOOL is expanded from... configure.ac:10: the top level]) m4trace:configure.ac:10: -1- LT_INIT m4trace:configure.ac:10: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) m4trace:configure.ac:10: -1- LTOPTIONS_VERSION m4trace:configure.ac:10: -1- LTSUGAR_VERSION m4trace:configure.ac:10: -1- LTVERSION_VERSION m4trace:configure.ac:10: -1- LTOBSOLETE_VERSION m4trace:configure.ac:10: -1- _LT_PROG_LTMAIN m4trace:configure.ac:10: -1- m4_pattern_allow([^LIBTOOL$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build_cpu$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build_vendor$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build_os$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host_cpu$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host_vendor$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host_os$]) m4trace:configure.ac:10: -1- _LT_PREPARE_SED_QUOTE_VARS m4trace:configure.ac:10: -1- _LT_PROG_ECHO_BACKSLASH m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CFLAGS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^ac_ct_CC$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^EXEEXT$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OBJEXT$]) m4trace:configure.ac:10: -1- _AM_PROG_CC_C_O m4trace:configure.ac:10: -1- AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) m4trace:configure.ac:10: -1- _AM_DEPENDENCIES([CC]) m4trace:configure.ac:10: -1- AM_SET_DEPDIR m4trace:configure.ac:10: -1- m4_pattern_allow([^DEPDIR$]) m4trace:configure.ac:10: -1- AM_OUTPUT_DEPENDENCY_COMMANDS m4trace:configure.ac:10: -1- AM_MAKE_INCLUDE m4trace:configure.ac:10: -1- m4_pattern_allow([^am__include$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__quote$]) m4trace:configure.ac:10: -1- AM_DEP_TRACK m4trace:configure.ac:10: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AMDEP_TRUE$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AMDEP_FALSE$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__nodep$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([am__nodep]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CCDEPMODE$]) m4trace:configure.ac:10: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) m4trace:configure.ac:10: -1- LT_PATH_LD m4trace:configure.ac:10: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:10: -1- AC_PROG_EGREP m4trace:configure.ac:10: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^EGREP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^FGREP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LD$]) m4trace:configure.ac:10: -1- LT_PATH_NM m4trace:configure.ac:10: -1- m4_pattern_allow([^DUMPBIN$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DUMPBIN$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^NM$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LN_S$]) m4trace:configure.ac:10: -1- LT_CMD_MAX_LEN m4trace:configure.ac:10: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AR$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^ac_ct_AR$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^STRIP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^RANLIB$]) m4trace:configure.ac:10: -1- _LT_WITH_SYSROOT m4trace:configure.ac:10: -1- m4_pattern_allow([LT_OBJDIR]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LT_OBJDIR$]) m4trace:configure.ac:10: -1- _LT_CC_BASENAME([$compiler]) m4trace:configure.ac:10: -1- _LT_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH]) m4trace:configure.ac:10: -1- _LT_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH]) m4trace:configure.ac:10: -1- LT_SUPPORTED_TAG([CC]) m4trace:configure.ac:10: -1- _LT_COMPILER_BOILERPLATE m4trace:configure.ac:10: -1- _LT_LINKER_BOILERPLATE m4trace:configure.ac:10: -1- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"]) m4trace:configure.ac:10: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, ) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, )], [$_LT_TAGVAR(lt_prog_compiler_pic, )@&t@m4_if([],[],[ -DPIC],[m4_if([],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, ) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, )=" $_LT_TAGVAR(lt_prog_compiler_pic, )" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, )= _LT_TAGVAR(lt_prog_compiler_can_build_shared, )=no]) m4trace:configure.ac:10: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, )=]) m4trace:configure.ac:10: -1- m4_pattern_allow([^MANIFEST_TOOL$]) m4trace:configure.ac:10: -1- _LT_DLL_DEF_P([$export_symbols]) m4trace:configure.ac:10: -1- _LT_DLL_DEF_P([$export_symbols]) m4trace:configure.ac:10: -1- _LT_REQUIRED_DARWIN_CHECKS m4trace:configure.ac:10: -1- m4_pattern_allow([^DSYMUTIL$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^NMEDIT$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LIPO$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OTOOL$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OTOOL64$]) m4trace:configure.ac:10: -1- _LT_LINKER_OPTION([if $CC understands -b], [lt_cv_prog_compiler__b], [-b], [_LT_TAGVAR(archive_cmds, )='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, )='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags']) m4trace:configure.ac:10: -1- m4_pattern_allow([^LT_SYS_LIBRARY_PATH$]) m4trace:configure.ac:10: -1- LT_SYS_DLOPEN_SELF m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^STDC_HEADERS$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^HAVE_DLFCN_H$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CFLAGS$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^ac_ct_CC$]) m4trace:configure.ac:11: -1- _AM_PROG_CC_C_O m4trace:configure.ac:11: -1- AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) m4trace:configure.ac:11: -1- _AM_DEPENDENCIES([CC]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CCDEPMODE$]) m4trace:configure.ac:11: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:11: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) m4trace:configure.ac:11: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) m4trace:configure.ac:22: -1- m4_pattern_allow([^NDEBUG$]) m4trace:configure.ac:30: -1- m4_pattern_allow([^WITHOUT_PRIVSEP$]) m4trace:configure.ac:34: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:34: the top level]) m4trace:configure.ac:39: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:39: the top level]) m4trace:configure.ac:44: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:44: the top level]) m4trace:configure.ac:49: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:49: the top level]) m4trace:configure.ac:54: -1- m4_pattern_allow([^privsep_user$]) m4trace:configure.ac:55: -1- m4_pattern_allow([^privsep_dir$]) m4trace:configure.ac:56: -1- m4_pattern_allow([^privsep_dir_user$]) m4trace:configure.ac:57: -1- m4_pattern_allow([^privsep_dir_group$]) m4trace:configure.ac:58: -1- m4_pattern_allow([^PRIVSEP_USER$]) m4trace:configure.ac:61: -1- m4_pattern_allow([^PRIVSEP_DIR$]) m4trace:configure.ac:64: -1- m4_pattern_allow([^PRIVSEP_DIR_USER$]) m4trace:configure.ac:67: -1- m4_pattern_allow([^PRIVSEP_DIR_GROUP$]) m4trace:configure.ac:77: -1- m4_pattern_allow([^WITHOUT_DEBUGFILE$]) m4trace:configure.ac:102: -1- AM_CONDITIONAL([WITH_SC_UPTIME], [test x$with_sc_uptime = xyes]) m4trace:configure.ac:102: -1- m4_pattern_allow([^WITH_SC_UPTIME_TRUE$]) m4trace:configure.ac:102: -1- m4_pattern_allow([^WITH_SC_UPTIME_FALSE$]) m4trace:configure.ac:102: -1- _AM_SUBST_NOTMAKE([WITH_SC_UPTIME_TRUE]) m4trace:configure.ac:102: -1- _AM_SUBST_NOTMAKE([WITH_SC_UPTIME_FALSE]) m4trace:configure.ac:105: -1- m4_pattern_allow([^HAVE_LIBIPHLPAPI$]) m4trace:configure.ac:106: -1- m4_pattern_allow([^HAVE_LIBWS2_32$]) m4trace:configure.ac:109: -1- m4_pattern_allow([^STDC_HEADERS$]) m4trace:configure.ac:110: -1- m4_pattern_allow([^HAVE_SYS_WAIT_H$]) m4trace:configure.ac:111: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) m4trace:configure.ac:112: -1- m4_pattern_allow([^HAVE_ARPA_INET_H$]) m4trace:configure.ac:113: -1- m4_pattern_allow([^HAVE_FCNTL_H$]) m4trace:configure.ac:114: -1- m4_pattern_allow([^HAVE_LIMITS_H$]) m4trace:configure.ac:115: -1- m4_pattern_allow([^HAVE_NETDB_H$]) m4trace:configure.ac:116: -1- m4_pattern_allow([^HAVE_NET_IF_DL_H$]) m4trace:configure.ac:117: -1- m4_pattern_allow([^HAVE_NET_IF_TYPES_H$]) m4trace:configure.ac:118: -1- m4_pattern_allow([^HAVE_NETINET_IN_H$]) m4trace:configure.ac:119: -1- m4_pattern_allow([^HAVE_POLL_H$]) m4trace:configure.ac:120: -1- m4_pattern_allow([^HAVE_STDINT_H$]) m4trace:configure.ac:121: -1- m4_pattern_allow([^HAVE_STDLIB_H$]) m4trace:configure.ac:122: -1- m4_pattern_allow([^HAVE_STRING_H$]) m4trace:configure.ac:123: -1- m4_pattern_allow([^HAVE_SYS_EPOLL_H$]) m4trace:configure.ac:124: -1- m4_pattern_allow([^HAVE_SYS_EVENT_H$]) m4trace:configure.ac:125: -1- m4_pattern_allow([^HAVE_SYS_IOCTL_H$]) m4trace:configure.ac:126: -1- m4_pattern_allow([^HAVE_SYS_PARAM_H$]) m4trace:configure.ac:127: -1- m4_pattern_allow([^HAVE_SYS_SOCKET_H$]) m4trace:configure.ac:128: -1- m4_pattern_allow([^HAVE_SYS_TIME_H$]) m4trace:configure.ac:129: -1- m4_pattern_allow([^HAVE_UNISTD_H$]) m4trace:configure.ac:130: -1- m4_pattern_allow([^HAVE_IFADDRS_H$]) m4trace:configure.ac:133: -1- m4_pattern_allow([^HAVE_SYS_SYSCTL_H$]) m4trace:configure.ac:158: -1- m4_pattern_allow([^HAVE_NETINET_TCP_VAR_H$]) m4trace:configure.ac:173: -1- m4_pattern_allow([^HAVE_NET_PFVAR_H$]) m4trace:configure.ac:182: -1- m4_pattern_allow([^const$]) m4trace:configure.ac:183: -1- m4_pattern_allow([^uid_t$]) m4trace:configure.ac:183: -1- m4_pattern_allow([^gid_t$]) m4trace:configure.ac:184: -1- m4_pattern_allow([^int16_t$]) m4trace:configure.ac:185: -1- m4_pattern_allow([^int32_t$]) m4trace:configure.ac:186: -1- m4_pattern_allow([^mode_t$]) m4trace:configure.ac:187: -1- m4_pattern_allow([^off_t$]) m4trace:configure.ac:188: -1- m4_pattern_allow([^pid_t$]) m4trace:configure.ac:189: -1- m4_pattern_allow([^size_t$]) m4trace:configure.ac:190: -1- m4_pattern_allow([^ssize_t$]) m4trace:configure.ac:191: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) m4trace:configure.ac:192: -1- m4_pattern_allow([^uint16_t$]) m4trace:configure.ac:193: -1- m4_pattern_allow([^_UINT32_T$]) m4trace:configure.ac:193: -1- m4_pattern_allow([^uint32_t$]) m4trace:configure.ac:194: -1- m4_pattern_allow([^_UINT64_T$]) m4trace:configure.ac:194: -1- m4_pattern_allow([^uint64_t$]) m4trace:configure.ac:195: -1- m4_pattern_allow([^_UINT8_T$]) m4trace:configure.ac:195: -1- m4_pattern_allow([^uint8_t$]) m4trace:configure.ac:198: -1- m4_pattern_allow([^HAVE_UNISTD_H$]) m4trace:configure.ac:198: -1- m4_pattern_allow([^HAVE_CHOWN$]) m4trace:configure.ac:199: -1- m4_pattern_allow([^HAVE_VFORK_H$]) m4trace:configure.ac:199: -1- m4_pattern_allow([^HAVE_WORKING_VFORK$]) m4trace:configure.ac:199: -1- m4_pattern_allow([^vfork$]) m4trace:configure.ac:199: -1- m4_pattern_allow([^HAVE_WORKING_FORK$]) m4trace:configure.ac:200: -1- m4_pattern_allow([^HAVE_ARC4RANDOM$]) m4trace:configure.ac:201: -1- m4_pattern_allow([^HAVE_ARC4RANDOM_UNIFORM$]) m4trace:configure.ac:202: -1- m4_pattern_allow([^HAVE_ATEXIT$]) m4trace:configure.ac:203: -1- m4_pattern_allow([^HAVE_CALLOC$]) m4trace:configure.ac:204: -1- m4_pattern_allow([^HAVE_DAEMON$]) m4trace:configure.ac:205: -1- m4_pattern_allow([^HAVE_ENDPWENT$]) m4trace:configure.ac:206: -1- m4_pattern_allow([^HAVE_EPOLL_WAIT$]) m4trace:configure.ac:207: -1- m4_pattern_allow([^HAVE_FTRUNCATE$]) m4trace:configure.ac:208: -1- m4_pattern_allow([^HAVE_GETDTABLESIZE$]) m4trace:configure.ac:209: -1- m4_pattern_allow([^HAVE_GETHOSTNAME$]) m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_GETIFADDRS$]) m4trace:configure.ac:211: -1- m4_pattern_allow([^HAVE_GETPAGESIZE$]) m4trace:configure.ac:212: -1- m4_pattern_allow([^HAVE_GETTIMEOFDAY$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^HAVE_KQUEUE$]) m4trace:configure.ac:214: -1- m4_pattern_allow([^HAVE_MEMMOVE$]) m4trace:configure.ac:215: -1- m4_pattern_allow([^HAVE_MEMSET$]) m4trace:configure.ac:216: -1- m4_pattern_allow([^HAVE_MKDIR$]) m4trace:configure.ac:217: -1- m4_pattern_allow([^HAVE_POLL$]) m4trace:configure.ac:218: -1- m4_pattern_allow([^HAVE_RMDIR$]) m4trace:configure.ac:219: -1- m4_pattern_allow([^HAVE_SELECT$]) m4trace:configure.ac:220: -1- m4_pattern_allow([^HAVE_SOCKET$]) m4trace:configure.ac:221: -1- m4_pattern_allow([^HAVE_SNPRINTF$]) m4trace:configure.ac:222: -1- m4_pattern_allow([^HAVE_SETPROCTITLE$]) m4trace:configure.ac:223: -1- m4_pattern_allow([^HAVE_STRCASECMP$]) m4trace:configure.ac:224: -1- m4_pattern_allow([^HAVE_STRCASESTR$]) m4trace:configure.ac:225: -1- m4_pattern_allow([^HAVE_STRDUP$]) m4trace:configure.ac:226: -1- m4_pattern_allow([^HAVE_STRERROR$]) m4trace:configure.ac:227: -1- m4_pattern_allow([^HAVE_STRNCASECMP$]) m4trace:configure.ac:228: -1- m4_pattern_allow([^HAVE_STRTOL$]) m4trace:configure.ac:229: -1- m4_pattern_allow([^HAVE_UNAME$]) m4trace:configure.ac:231: -1- m4_pattern_allow([^SIZEOF_LONG$]) m4trace:configure.ac:233: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_SA_LEN$]) m4trace:configure.ac:240: -1- m4_pattern_allow([^HAVE_STRUCT_PFIOC_TRANS_E_TYPE$]) m4trace:configure.ac:248: -1- m4_pattern_allow([^HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM$]) m4trace:configure.ac:256: -1- m4_pattern_allow([^HAVE_STRUCT_PF_RULE_NAT$]) m4trace:configure.ac:264: -1- m4_pattern_allow([^HAVE_STRUCT_PF_RULE_RDR$]) m4trace:configure.ac:276: -1- m4_pattern_allow([^HAVE_STRUCT_IP6_EXT$]) m4trace:configure.ac:297: -1- AX_CHECK_OPENSSL([AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have OpenSSL]) CFLAGS="$CFLAGS $OPENSSL_INCLUDES"]) m4trace:configure.ac:297: -1- m4_pattern_allow([^PKG_CONFIG$]) m4trace:configure.ac:297: -1- m4_pattern_allow([^HAVE_OPENSSL$]) m4trace:configure.ac:297: -1- m4_pattern_allow([^OPENSSL_INCLUDES$]) m4trace:configure.ac:297: -1- m4_pattern_allow([^OPENSSL_LIBS$]) m4trace:configure.ac:297: -1- m4_pattern_allow([^OPENSSL_LDFLAGS$]) m4trace:configure.ac:301: -1- AX_GCC_BUILTIN([__builtin_clz]) m4trace:configure.ac:301: -1- m4_pattern_allow([^HAVE___BUILTIN_CLZ$]) m4trace:configure.ac:308: -1- AX_PTHREAD([AC_DEFINE([HAVE_PTHREAD], [1], [Define to 1 if you have pthread])]) m4trace:configure.ac:308: -1- m4_pattern_allow([^ax_pthread_config$]) m4trace:configure.ac:308: -1- m4_pattern_allow([^PTHREAD_CREATE_JOINABLE$]) m4trace:configure.ac:308: -1- m4_pattern_allow([^HAVE_PTHREAD_PRIO_INHERIT$]) m4trace:configure.ac:308: -1- m4_pattern_allow([^PTHREAD_CC$]) m4trace:configure.ac:308: -1- m4_pattern_allow([^PTHREAD_LIBS$]) m4trace:configure.ac:308: -1- m4_pattern_allow([^PTHREAD_CFLAGS$]) m4trace:configure.ac:308: -1- m4_pattern_allow([^PTHREAD_CC$]) m4trace:configure.ac:308: -1- m4_pattern_allow([^HAVE_PTHREAD$]) m4trace:configure.ac:346: -1- m4_pattern_allow([^LIB@&t@OBJS$]) m4trace:configure.ac:346: -1- m4_pattern_allow([^LTLIBOBJS$]) m4trace:configure.ac:346: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) m4trace:configure.ac:346: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) m4trace:configure.ac:346: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) m4trace:configure.ac:346: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) m4trace:configure.ac:346: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) m4trace:configure.ac:346: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) m4trace:configure.ac:346: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS m4trace:configure.ac:346: -1- _LT_PROG_LTMAIN scamper-cvs-20171204/autom4te.cache/output.2000644 001751 000000 00002043465 13211200056 020346 0ustar00mjlwheel000000 000000 @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. @%:@ Generated by GNU Autoconf 2.69 for scamper 20171204. @%:@ @%:@ Report bugs to . @%:@ @%:@ @%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @%:@ @%:@ @%:@ This configure script is free software; the Free Software Foundation @%:@ gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in @%:@( *posix*) : set -o posix ;; @%:@( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in @%:@( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in @%:@(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in @%:@ (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in @%:@( *posix*) : set -o posix ;; @%:@( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in @%:@( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in @%:@ (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and mjl@luckie.org.nz $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: 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 @S|@? 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 "@S|@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 @S|@as_val. Take advantage of shells that can avoid forks. The arguments @%:@ must be portable across @S|@(()) 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 @S|@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'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIB@&t@OBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='scamper' PACKAGE_TARNAME='scamper' PACKAGE_VERSION='20171204' PACKAGE_STRING='scamper 20171204' PACKAGE_BUGREPORT='mjl@luckie.org.nz' PACKAGE_URL='' ac_unique_file="scamper/scamper.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIB@&t@OBJS PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC ax_pthread_config OPENSSL_LDFLAGS OPENSSL_LIBS OPENSSL_INCLUDES PKG_CONFIG WITH_SC_UPTIME_FALSE WITH_SC_UPTIME_TRUE privsep_dir_group privsep_dir_user privsep_dir privsep_user CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_shared enable_static with_pic enable_fast_install with_aix_soname enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_debug enable_privsep with_privsep_user with_privsep_dir with_privsep_dir_owner with_privsep_dir_group enable_debug_file with_dmalloc with_sc_uptime with_openssl enable_threads ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures scamper 20171204 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 @<:@@S|@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/scamper@:>@ --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 scamper 20171204:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-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@:>@ --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug build with debugging symbols --disable-privsep disable privilege separation --disable-debug-file remove support for generating a debug file --disable-threads disable use of threads Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic@<:@=PKGS@:>@ try to use only PIC/non-PIC objects @<:@default=use both@:>@ --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=aix@:>@. --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ --with-sysroot@<:@=DIR@:>@ Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-privsep-user=USER sets user name for privsep process --with-privsep-dir=DIR sets chroot directory for privsep process --with-privsep-dir-user=USER sets chroot directory owner --with-privsep-dir-group=GROUP sets chroot directory group id --with-dmalloc enable support for dmalloc --with-sc_uptime enable support for sc_uptime --with-openssl=DIR root of the OpenSSL directory 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 LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF scamper configure 20171204 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.@S|@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.@S|@ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_link @%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES @%:@ ------------------------------------------------------- @%:@ Tests whether HEADER exists and can be compiled using the include files in @%:@ INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @%:@include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_header_compile @%:@ ac_fn_c_try_cpp LINENO @%:@ ---------------------- @%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_cpp @%:@ ac_fn_c_try_run LINENO @%:@ ---------------------- @%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes @%:@ that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_run @%:@ ac_fn_c_check_func LINENO FUNC VAR @%:@ ---------------------------------- @%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_func @%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES @%:@ ------------------------------------------------------- @%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using @%:@ the include files in INCLUDES and setting the cache variable VAR @%:@ accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @%:@include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------- ## ## Report this to mjl@luckie.org.nz ## ## -------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_header_mongrel @%:@ ac_fn_c_find_intX_t LINENO BITS VAR @%:@ ----------------------------------- @%:@ Finds a signed integer type with width BITS, setting cache variable VAR @%:@ accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 $as_echo_n "checking for int$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array @<:@1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array @<:@1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else case $ac_type in @%:@( int$2_t) : eval "$3=yes" ;; @%:@( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_intX_t @%:@ 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_find_uintX_t LINENO BITS VAR @%:@ ------------------------------------ @%:@ Finds an unsigned integer type with width BITS, setting cache variable VAR @%:@ accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array @<:@1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in @%:@( uint$2_t) : eval "$3=yes" ;; @%:@( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_uintX_t @%:@ ac_fn_c_compute_int LINENO EXPR VAR INCLUDES @%:@ -------------------------------------------- @%:@ Tries to find the compile-time value of EXPR in a program that includes @%:@ INCLUDES, setting VAR accordingly. Returns whether the value could be @%:@ computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) >= 0)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) < 0)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) >= $ac_mid)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array @<:@1 - 2 * !(($2) <= $ac_mid)@:>@; test_array @<:@0@:>@ = 0; return test_array @<:@0@:>@; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in @%:@(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } @%:@include @%:@include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } @%:@ ac_fn_c_check_member 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 scamper $as_me 20171204, 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 am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in @%:@(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null @%:@ Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='scamper' VERSION='20171204' cat >>confdefs.h <<_ACEOF @%:@define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_config_headers="$ac_config_headers config.h" case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf @%:@ Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $@%:@ != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep @%:@ Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that 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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } @%:@ Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } @%:@ Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. 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 what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @%:@include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF @%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no @%:@ Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi @%:@ Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi @%:@ Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi @%:@ 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 shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } @%:@ Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF @%:@define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic@&t@ -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic@&t@ -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; 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 no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $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 yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; 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 relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; 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 yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi 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 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 # Whether all the debugging output should be spewed out @%:@ Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi if test "x$enable_debug" != "xyes"; then $as_echo "@%:@define NDEBUG 1" >>confdefs.h fi # No privilege separation @%:@ Check whether --enable-privsep was given. if test "${enable_privsep+set}" = set; then : enableval=$enable_privsep; fi if test "x$enable_privsep" = xno; then $as_echo "@%:@define WITHOUT_PRIVSEP 1" >>confdefs.h fi # privsep parameters @%:@ Check whether --with-privsep_user was given. if test "${with_privsep_user+set}" = set; then : withval=$with_privsep_user; privsep_user=$withval else privsep_user=nobody fi @%:@ Check whether --with-privsep_dir was given. if test "${with_privsep_dir+set}" = set; then : withval=$with_privsep_dir; privsep_dir=$withval else privsep_dir=/var/empty fi @%:@ Check whether --with-privsep_dir_owner was given. if test "${with_privsep_dir_owner+set}" = set; then : withval=$with_privsep_dir_owner; privsep_dir_user=$withval else privsep_dir_user=root fi @%:@ Check whether --with-privsep_dir_group was given. if test "${with_privsep_dir_group+set}" = set; then : withval=$with_privsep_dir_group; privsep_dir_group=$withval else privsep_dir_group=wheel fi cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_USER "$privsep_user" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_DIR "$privsep_dir" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_DIR_USER "$privsep_dir_user" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PRIVSEP_DIR_GROUP "$privsep_dir_group" _ACEOF # Debug file support @%:@ Check whether --enable-debug-file was given. if test "${enable_debug_file+set}" = set; then : enableval=$enable_debug_file; fi if test "x$enable_debug_file" = xno; then $as_echo "@%:@define WITHOUT_DEBUGFILE 1" >>confdefs.h fi # dmalloc support @%:@ Check whether --with-dmalloc was given. if test "${with_dmalloc+set}" = set; then : withval=$with_dmalloc; fi if test "x$with_dmalloc" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_malloc in -ldmalloc" >&5 $as_echo_n "checking for dmalloc_malloc in -ldmalloc... " >&6; } if ${ac_cv_lib_dmalloc_dmalloc_malloc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $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 dmalloc_malloc (); int main () { return dmalloc_malloc (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dmalloc_dmalloc_malloc=yes else ac_cv_lib_dmalloc_dmalloc_malloc=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_dmalloc_dmalloc_malloc" >&5 $as_echo "$ac_cv_lib_dmalloc_dmalloc_malloc" >&6; } if test "x$ac_cv_lib_dmalloc_dmalloc_malloc" = xyes; then : CFLAGS="$CFLAGS -DDMALLOC" LDFLAGS="$LDFLAGS -ldmalloc" 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 $? "dmalloc test failed (remove --with-dmalloc) See \`config.log' for more details" "$LINENO" 5; } fi fi # sc_uptime prober support @%:@ Check whether --with-sc_uptime was given. if test "${with_sc_uptime+set}" = set; then : withval=$with_sc_uptime; with_sc_uptime=$withval else with_sc_uptime=no fi if test x$with_sc_uptime = xyes; then WITH_SC_UPTIME_TRUE= WITH_SC_UPTIME_FALSE='#' else WITH_SC_UPTIME_TRUE='#' WITH_SC_UPTIME_FALSE= fi # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GetIpNetTable in -liphlpapi" >&5 $as_echo_n "checking for GetIpNetTable in -liphlpapi... " >&6; } if ${ac_cv_lib_iphlpapi_GetIpNetTable+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liphlpapi $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 GetIpNetTable (); int main () { return GetIpNetTable (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iphlpapi_GetIpNetTable=yes else ac_cv_lib_iphlpapi_GetIpNetTable=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_iphlpapi_GetIpNetTable" >&5 $as_echo "$ac_cv_lib_iphlpapi_GetIpNetTable" >&6; } if test "x$ac_cv_lib_iphlpapi_GetIpNetTable" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBIPHLPAPI 1 _ACEOF LIBS="-liphlpapi $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WSAStartup in -lws2_32" >&5 $as_echo_n "checking for WSAStartup in -lws2_32... " >&6; } if ${ac_cv_lib_ws2_32_WSAStartup+:} 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 WSAStartup (); int main () { return WSAStartup (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ws2_32_WSAStartup=yes else ac_cv_lib_ws2_32_WSAStartup=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_WSAStartup" >&5 $as_echo "$ac_cv_lib_ws2_32_WSAStartup" >&6; } if test "x$ac_cv_lib_ws2_32_WSAStartup" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBWS2_32 1 _ACEOF LIBS="-lws2_32 $LIBS" fi # Checks for header files. { $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 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 { $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 for ac_header in arpa/inet.h do : ac_fn_c_check_header_mongrel "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "$ac_includes_default" if test "x$ac_cv_header_arpa_inet_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ARPA_INET_H 1 _ACEOF fi done for ac_header in fcntl.h do : ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_fcntl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_FCNTL_H 1 _ACEOF fi done for ac_header in limits.h do : ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIMITS_H 1 _ACEOF fi done for ac_header in netdb.h do : ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" if test "x$ac_cv_header_netdb_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NETDB_H 1 _ACEOF fi done for ac_header in net/if_dl.h do : ac_fn_c_check_header_mongrel "$LINENO" "net/if_dl.h" "ac_cv_header_net_if_dl_h" "$ac_includes_default" if test "x$ac_cv_header_net_if_dl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NET_IF_DL_H 1 _ACEOF fi done for ac_header in net/if_types.h do : ac_fn_c_check_header_mongrel "$LINENO" "net/if_types.h" "ac_cv_header_net_if_types_h" "$ac_includes_default" if test "x$ac_cv_header_net_if_types_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NET_IF_TYPES_H 1 _ACEOF fi done for ac_header in netinet/in.h do : ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" if test "x$ac_cv_header_netinet_in_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NETINET_IN_H 1 _ACEOF fi done for ac_header in poll.h do : ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" if test "x$ac_cv_header_poll_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_POLL_H 1 _ACEOF fi done for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STDINT_H 1 _ACEOF fi done for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STDLIB_H 1 _ACEOF fi done for ac_header in string.h do : ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRING_H 1 _ACEOF fi done for ac_header in sys/epoll.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" if test "x$ac_cv_header_sys_epoll_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_EPOLL_H 1 _ACEOF fi done for ac_header in sys/event.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" if test "x$ac_cv_header_sys_event_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_EVENT_H 1 _ACEOF fi done for ac_header in sys/ioctl.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_IOCTL_H 1 _ACEOF fi done for ac_header in sys/param.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" if test "x$ac_cv_header_sys_param_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_PARAM_H 1 _ACEOF fi done for ac_header in sys/socket.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" if test "x$ac_cv_header_sys_socket_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_SOCKET_H 1 _ACEOF fi done for ac_header in sys/time.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_TIME_H 1 _ACEOF fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_UNISTD_H 1 _ACEOF fi done for ac_header in ifaddrs.h do : ac_fn_c_check_header_mongrel "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default" if test "x$ac_cv_header_ifaddrs_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_IFADDRS_H 1 _ACEOF fi done # sys/sysctl.h requires other headers on at least OpenBSD for ac_header in sys/sysctl.h do : ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" " #if HAVE_SYS_PARAM_H # include #endif " if test "x$ac_cv_header_sys_sysctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SYS_SYSCTL_H 1 _ACEOF fi done for ac_header in netinet/ip_fw.h netinet6/ip6_fw.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" " #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif #if HAVE_NETINET_IN_H # include #endif #if HAVE_ARPA_INET_H # include #endif #include #include " 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 netinet/tcp_var.h do : ac_fn_c_check_header_compile "$LINENO" "netinet/tcp_var.h" "ac_cv_header_netinet_tcp_var_h" " #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif #if HAVE_NETINET_IN_H # include #endif #include #include " if test "x$ac_cv_header_netinet_tcp_var_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NETINET_TCP_VAR_H 1 _ACEOF fi done for ac_header in net/pfvar.h do : ac_fn_c_check_header_compile "$LINENO" "net/pfvar.h" "ac_cv_header_net_pfvar_h" " #include #include #include #include " if test "x$ac_cv_header_net_pfvar_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_NET_PFVAR_H 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "@%:@define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 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 ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" case $ac_cv_c_int16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF @%:@define int16_t $ac_cv_c_int16_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF @%:@define int32_t $ac_cv_c_int32_t _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes; then : else cat >>confdefs.h <<_ACEOF @%:@define mode_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "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 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF @%:@define ssize_t int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "@%:@define TM_IN_SYS_TIME 1" >>confdefs.h fi ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF @%:@define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "@%:@define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF @%:@define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) $as_echo "@%:@define _UINT64_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF @%:@define uint64_t $ac_cv_c_uint64_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "@%:@define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF @%:@define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac # Checks for library functions. for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_UNISTD_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 $as_echo_n "checking for working chown... " >&6; } if ${ac_cv_func_chown_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_chown_works=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include int main () { char *f = "conftest.chown"; struct stat before, after; if (creat (f, 0600) < 0) return 1; if (stat (f, &before) < 0) return 1; if (chown (f, (uid_t) -1, (gid_t) -1) == -1) return 1; if (stat (f, &after) < 0) return 1; return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_chown_works=yes else ac_cv_func_chown_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f conftest.chown fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 $as_echo "$ac_cv_func_chown_works" >&6; } if test $ac_cv_func_chown_works = yes; then $as_echo "@%:@define HAVE_CHOWN 1" >>confdefs.h fi for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF @%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "@%:@define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "@%:@define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "@%:@define HAVE_WORKING_FORK 1" >>confdefs.h fi for ac_func in arc4random do : ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random" if test "x$ac_cv_func_arc4random" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ARC4RANDOM 1 _ACEOF fi done for ac_func in arc4random_uniform do : ac_fn_c_check_func "$LINENO" "arc4random_uniform" "ac_cv_func_arc4random_uniform" if test "x$ac_cv_func_arc4random_uniform" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ARC4RANDOM_UNIFORM 1 _ACEOF fi done for ac_func in atexit do : ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit" if test "x$ac_cv_func_atexit" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ATEXIT 1 _ACEOF fi done for ac_func in calloc do : ac_fn_c_check_func "$LINENO" "calloc" "ac_cv_func_calloc" if test "x$ac_cv_func_calloc" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_CALLOC 1 _ACEOF fi done for ac_func in daemon do : ac_fn_c_check_func "$LINENO" "daemon" "ac_cv_func_daemon" if test "x$ac_cv_func_daemon" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_DAEMON 1 _ACEOF fi done for ac_func in endpwent do : ac_fn_c_check_func "$LINENO" "endpwent" "ac_cv_func_endpwent" if test "x$ac_cv_func_endpwent" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_ENDPWENT 1 _ACEOF fi done for ac_func in epoll_wait do : ac_fn_c_check_func "$LINENO" "epoll_wait" "ac_cv_func_epoll_wait" if test "x$ac_cv_func_epoll_wait" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_EPOLL_WAIT 1 _ACEOF fi done for ac_func in ftruncate do : ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" if test "x$ac_cv_func_ftruncate" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_FTRUNCATE 1 _ACEOF fi done for ac_func in getdtablesize do : ac_fn_c_check_func "$LINENO" "getdtablesize" "ac_cv_func_getdtablesize" if test "x$ac_cv_func_getdtablesize" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETDTABLESIZE 1 _ACEOF fi done for ac_func in gethostname do : ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname" if test "x$ac_cv_func_gethostname" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETHOSTNAME 1 _ACEOF fi done for ac_func in getifaddrs do : ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" if test "x$ac_cv_func_getifaddrs" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETIFADDRS 1 _ACEOF fi done for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" if test "x$ac_cv_func_getpagesize" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETPAGESIZE 1 _ACEOF fi done for ac_func in gettimeofday do : ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_GETTIMEOFDAY 1 _ACEOF fi done for ac_func in kqueue do : ac_fn_c_check_func "$LINENO" "kqueue" "ac_cv_func_kqueue" if test "x$ac_cv_func_kqueue" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_KQUEUE 1 _ACEOF fi done for ac_func in memmove do : ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" if test "x$ac_cv_func_memmove" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_MEMMOVE 1 _ACEOF fi done for ac_func in memset do : ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" if test "x$ac_cv_func_memset" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_MEMSET 1 _ACEOF fi done for ac_func in mkdir do : ac_fn_c_check_func "$LINENO" "mkdir" "ac_cv_func_mkdir" if test "x$ac_cv_func_mkdir" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_MKDIR 1 _ACEOF fi done for ac_func in poll do : ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" if test "x$ac_cv_func_poll" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_POLL 1 _ACEOF fi done for ac_func in rmdir do : ac_fn_c_check_func "$LINENO" "rmdir" "ac_cv_func_rmdir" if test "x$ac_cv_func_rmdir" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_RMDIR 1 _ACEOF fi done for ac_func in select do : ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" if test "x$ac_cv_func_select" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SELECT 1 _ACEOF fi done for ac_func in socket do : ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" if test "x$ac_cv_func_socket" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SOCKET 1 _ACEOF fi done for ac_func in snprintf do : ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SNPRINTF 1 _ACEOF fi done for ac_func in setproctitle do : ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle" if test "x$ac_cv_func_setproctitle" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_SETPROCTITLE 1 _ACEOF fi done for ac_func in strcasecmp do : ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRCASECMP 1 _ACEOF fi done for ac_func in strcasestr do : ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr" if test "x$ac_cv_func_strcasestr" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRCASESTR 1 _ACEOF fi done for ac_func in strdup do : ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRDUP 1 _ACEOF fi done for ac_func in strerror do : ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRERROR 1 _ACEOF fi done for ac_func in strncasecmp do : ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" if test "x$ac_cv_func_strncasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRNCASECMP 1 _ACEOF fi done for ac_func in strtol do : ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" if test "x$ac_cv_func_strtol" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRTOL 1 _ACEOF fi done for ac_func in uname do : ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" if test "x$ac_cv_func_uname" = xyes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_UNAME 1 _ACEOF fi done # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF @%:@define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include #include " if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_SOCKADDR_SA_LEN 1" >>confdefs.h else : fi if test "x$ac_cv_header_net_pfvar_h" == xyes; then ac_fn_c_check_member "$LINENO" "struct pfioc_trans_e" "type" "ac_cv_member_struct_pfioc_trans_e_type" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pfioc_trans_e_type" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PFIOC_TRANS_E_TYPE 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pfioc_trans_e" "rs_num" "ac_cv_member_struct_pfioc_trans_e_rs_num" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pfioc_trans_e_rs_num" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pf_rule" "nat" "ac_cv_member_struct_pf_rule_nat" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pf_rule_nat" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PF_RULE_NAT 1" >>confdefs.h else : fi ac_fn_c_check_member "$LINENO" "struct pf_rule" "rdr" "ac_cv_member_struct_pf_rule_rdr" "#include #include #include #include #include " if test "x$ac_cv_member_struct_pf_rule_rdr" = xyes; then : $as_echo "@%:@define HAVE_STRUCT_PF_RULE_RDR 1" >>confdefs.h else : fi fi # Check for structs { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ip6_ext" >&5 $as_echo_n "checking for struct ip6_ext... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #include ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRUCT_IP6_EXT 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } #AC_DEFINE_UNQUOTED([HAVE_STRUCT_IP6_EXT], 0, [Define to 1 if you have the `ip6_ext' struct.]) fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # These libraries have to be explicitly linked in OpenSolaris { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 $as_echo_n "checking for library containing getaddrinfo... " >&6; } if ${ac_cv_search_getaddrinfo+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getaddrinfo (); int main () { return getaddrinfo (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib -lnsl $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getaddrinfo=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_getaddrinfo+:} false; then : break fi done if ${ac_cv_search_getaddrinfo+:} false; then : else ac_cv_search_getaddrinfo=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 $as_echo "$ac_cv_search_getaddrinfo" >&6; } ac_res=$ac_cv_search_getaddrinfo if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5 $as_echo_n "checking for library containing inet_ntop... " >&6; } if ${ac_cv_search_inet_ntop+:} 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 inet_ntop (); int main () { return inet_ntop (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib -lsocket $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_ntop=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_ntop+:} false; then : break fi done if ${ac_cv_search_inet_ntop+:} false; then : else ac_cv_search_inet_ntop=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 $as_echo "$ac_cv_search_inet_ntop" >&6; } ac_res=$ac_cv_search_inet_ntop if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # Some systems need -lm to use sqrt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sqrt" >&5 $as_echo_n "checking for library containing sqrt... " >&6; } if ${ac_cv_search_sqrt+:} 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 sqrt (); int main () { return sqrt (); ; return 0; } _ACEOF for ac_lib in '' m; 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_sqrt=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_sqrt+:} false; then : break fi done if ${ac_cv_search_sqrt+:} false; then : else ac_cv_search_sqrt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sqrt" >&5 $as_echo "$ac_cv_search_sqrt" >&6; } ac_res=$ac_cv_search_sqrt if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi found=false @%:@ Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; case "$withval" in "" | y | ye | yes | n | no) as_fn_error $? "Invalid --with-openssl value" "$LINENO" 5 ;; *) ssldirs="$withval" ;; esac else # if pkg-config is installed and openssl has installed a .pc file, # then use that information and don't search ssldirs if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PKG_CONFIG"; then ac_cv_prog_PKG_CONFIG="$PKG_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config" $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 PKG_CONFIG=$ac_cv_prog_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_PKG_CONFIG"; then ac_ct_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_PKG_CONFIG"; then ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config" $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_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG if test -n "$ac_ct_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5 $as_echo "$ac_ct_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_ct_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_prog_PKG_CONFIG" fi if test x"$PKG_CONFIG" != x""; then OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` if test $? = 0; then OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` found=true fi fi # no such luck; use some default ssldirs if ! $found; then ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" fi fi # note that we #include , so the OpenSSL headers have to be in # an 'openssl' subdirectory if ! $found; then OPENSSL_INCLUDES= for ssldir in $ssldirs; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h in $ssldir" >&5 $as_echo_n "checking for openssl/ssl.h in $ssldir... " >&6; } if test -f "$ssldir/include/openssl/ssl.h"; then OPENSSL_INCLUDES="-I$ssldir/include" OPENSSL_LDFLAGS="-L$ssldir/lib" OPENSSL_LIBS="-lssl -lcrypto" found=true { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } break else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi done # if the file wasn't found, well, go ahead and try the link anyway -- maybe # it will just work! fi # try the preprocessor and linker with our new flags, # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling and linking against OpenSSL works" >&5 $as_echo_n "checking whether compiling and linking against OpenSSL works... " >&6; } echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&5 save_LIBS="$LIBS" save_LDFLAGS="$LDFLAGS" save_CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" LIBS="$OPENSSL_LIBS $LIBS" CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { SSL_new(NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "@%:@define HAVE_OPENSSL 1" >>confdefs.h CFLAGS="$CFLAGS $OPENSSL_INCLUDES" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_clz" >&5 $as_echo_n "checking for __builtin_clz... " >&6; } if ${ax_cv_have___builtin_clz+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { __builtin_clz(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have___builtin_clz=yes else ax_cv_have___builtin_clz=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have___builtin_clz" >&5 $as_echo "$ax_cv_have___builtin_clz" >&6; } if test yes = $ax_cv_have___builtin_clz; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE___BUILTIN_CLZ 1 _ACEOF fi # No thread support @%:@ Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then : enableval=$enable_threads; fi if test "x$enable_threads" != 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 ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then ax_pthread_save_CC="$CC" ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" if test "x$PTHREAD_CC" != "x"; then : CC="$PTHREAD_CC" fi CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 $as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } 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_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi CC="$ax_pthread_save_CC" CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 # (Note: HP C rejects this with "bad form for `-t' option") # -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads and # -D_REENTRANT too), HP C (must be checked before -lpthread, which # is present but should not be used directly; and before -mthreads, # because the compiler interprets this as "-mt" + "-hreads") # -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case $host_os in freebsd*) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) ax_pthread_flags="-kthread lthread $ax_pthread_flags" ;; hpux*) # From the cc(1) man page: "[-mt] Sets various -D flags to enable # multi-threading and also sets -lpthread." ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" ;; openedition*) # IBM z/OS requires a feature-test macro to be defined in order to # enable POSIX threads at all, so give the user a hint if this is # not set. (We don't define these ourselves, as they can affect # other portions of the system API in unpredictable ways.) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) AX_PTHREAD_ZOS_MISSING # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 $as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} fi rm -f conftest* ;; solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (N.B.: The stubs are missing # pthread_cleanup_push, or rather a function called by this macro, # so we could check for that, but who knows whether they'll stub # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" ;; esac # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) if test "x$GCC" = "xyes"; then : ax_pthread_flags="-pthread -pthreads $ax_pthread_flags" fi # The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled case $host_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; aix*) ax_pthread_check_macro="_THREAD_SAFE" ;; *) ax_pthread_check_macro="--" ;; esac if test "x$ax_pthread_check_macro" = "x--"; then : ax_pthread_check_cond=0 else ax_pthread_check_cond="!defined($ax_pthread_check_macro)" fi # Are we compiling with Clang? { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 $as_echo_n "checking whether $CC is Clang... " >&6; } if ${ax_cv_PTHREAD_CLANG+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Note: Clang 2.7 lacks __clang_[a-z]+__ */ # if defined(__clang__) && defined(__llvm__) AX_PTHREAD_CC_IS_CLANG # endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then : ax_cv_PTHREAD_CLANG=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 $as_echo "$ax_cv_PTHREAD_CLANG" >&6; } ax_pthread_clang="$ax_cv_PTHREAD_CLANG" ax_pthread_clang_warning=no # Clang needs special handling, because older versions handle the -pthread # option in a rather... idiosyncratic way if test "x$ax_pthread_clang" = "xyes"; then # Clang takes -pthread; it has never supported any other flag # (Note 1: This will need to be revisited if a system that Clang # supports has POSIX threads in a separate library. This tends not # to be the way of modern systems, but it's conceivable.) # (Note 2: On some systems, notably Darwin, -pthread is not needed # to get POSIX threads support; the API is always present and # active. We could reasonably leave PTHREAD_CFLAGS empty. But # -pthread does define _REENTRANT, and while the Darwin headers # ignore this macro, third-party headers might not.) PTHREAD_CFLAGS="-pthread" PTHREAD_LIBS= ax_pthread_ok=yes # However, older versions of Clang make a point of warning the user # that, in an invocation where only linking and no compilation is # taking place, the -pthread option has no effect ("argument unused # during compilation"). They expect -pthread to be passed in only # when source code is being compiled. # # Problem is, this is at odds with the way Automake and most other # C build frameworks function, which is that the same flags used in # compilation (CFLAGS) are also used in linking. Many systems # supported by AX_PTHREAD require exactly this for POSIX threads # support, and in fact it is often not straightforward to specify a # flag that is used only in the compilation phase and not in # linking. Such a scenario is extremely rare in practice. # # Even though use of the -pthread flag in linking would only print # a warning, this can be a nuisance for well-run software projects # that build with -Werror. So if the active version of Clang has # this misfeature, we search for an option to squash it. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 $as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second # step ax_pthread_save_ac_link="$ac_link" ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do if test "x$ax_pthread_try" = "xunknown"; then : break fi CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" ac_link="$ax_pthread_save_ac_link" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void){return 0;} _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_link="$ax_pthread_2step_ac_link" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(void){return 0;} _ACEOF if ac_fn_c_try_link "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done ac_link="$ax_pthread_save_ac_link" CFLAGS="$ax_pthread_save_CFLAGS" if test "x$ax_pthread_try" = "x"; then : ax_pthread_try=no fi ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 $as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in no | unknown) ;; *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; esac fi # $ax_pthread_clang = yes if test "x$ax_pthread_ok" = "xno"; then for ax_pthread_try_flag in $ax_pthread_flags; do case $ax_pthread_try_flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -mt,pthread) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5 $as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; } PTHREAD_CFLAGS="-mt" PTHREAD_LIBS="-lpthread" ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 $as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ax_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ax_pthread_config="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_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" fi fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 $as_echo "$ax_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ax_pthread_config" = "xno"; then : continue fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 $as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; } int main () { pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xyes"; then : break fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = "xyes"; then ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr = $ax_pthread_attr; return attr /* ; */ ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 $as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ test "x$ax_pthread_joinable_attr_defined" != "xyes"; then : cat >>confdefs.h <<_ACEOF @%:@define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR _ACEOF ax_pthread_joinable_attr_defined=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 $as_echo_n "checking whether more special flags are required for pthreads... " >&6; } if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 $as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ test "x$ax_pthread_special_flags_added" != "xyes"; then : PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" ax_pthread_special_flags_added=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int i = PTHREAD_PRIO_INHERIT; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_PTHREAD_PRIO_INHERIT=yes else ax_cv_PTHREAD_PRIO_INHERIT=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ test "x$ax_pthread_prio_inherit_defined" != "xyes"; then : $as_echo "@%:@define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h ax_pthread_prio_inherit_defined=yes fi CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then case $host_os in aix*) case "x/$CC" in @%:@( x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : #handle absolute path differently from PATH based program lookup case "x$CC" in @%:@( x/*) : if as_fn_executable_p ${CC}_r; then : PTHREAD_CC="${CC}_r" fi ;; @%:@( *) : for ac_prog in ${CC}_r 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_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_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_PTHREAD_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 PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" ;; esac ;; @%:@( *) : ;; esac ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then $as_echo "@%:@define HAVE_PTHREAD 1" >>confdefs.h : else ax_pthread_ok=no 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 fi ac_config_files="$ac_config_files Makefile scamper/Makefile utils/Makefile utils/sc_ally/Makefile utils/sc_analysis_dump/Makefile utils/sc_attach/Makefile utils/sc_bdrmap/Makefile utils/sc_filterpolicy/Makefile utils/sc_ipiddump/Makefile utils/sc_prefixscan/Makefile utils/sc_radargun/Makefile utils/sc_remoted/Makefile utils/sc_speedtrap/Makefile utils/sc_tbitblind/Makefile utils/sc_tracediff/Makefile" if test "x$with_sc_uptime" != xno; then ac_config_files="$ac_config_files utils/sc_uptime/Makefile" fi ac_config_files="$ac_config_files utils/sc_warts2csv/Makefile utils/sc_warts2json/Makefile utils/sc_warts2pcap/Makefile utils/sc_warts2text/Makefile utils/sc_wartscat/Makefile utils/sc_wartsdump/Makefile utils/sc_wartsfix/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIB@&t@OBJS; 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 LIB@&t@OBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_SC_UPTIME_TRUE}" && test -z "${WITH_SC_UPTIME_FALSE}"; then as_fn_error $? "conditional \"WITH_SC_UPTIME\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in @%:@( *posix*) : set -o posix ;; @%:@( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in @%:@( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in @%:@(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH @%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] @%:@ ---------------------------------------- @%:@ Output "`basename @S|@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 @S|@? 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 @S|@as_val. Take advantage of shells that can avoid forks. The arguments @%:@ must be portable across @S|@(()) 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 "@S|@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 scamper $as_me 20171204, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ scamper config.status 20171204 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX @%:@@%:@ Running $as_me. @%:@@%:@ _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "scamper/Makefile") CONFIG_FILES="$CONFIG_FILES scamper/Makefile" ;; "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "utils/sc_ally/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_ally/Makefile" ;; "utils/sc_analysis_dump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_analysis_dump/Makefile" ;; "utils/sc_attach/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_attach/Makefile" ;; "utils/sc_bdrmap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_bdrmap/Makefile" ;; "utils/sc_filterpolicy/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_filterpolicy/Makefile" ;; "utils/sc_ipiddump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_ipiddump/Makefile" ;; "utils/sc_prefixscan/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_prefixscan/Makefile" ;; "utils/sc_radargun/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_radargun/Makefile" ;; "utils/sc_remoted/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_remoted/Makefile" ;; "utils/sc_speedtrap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_speedtrap/Makefile" ;; "utils/sc_tbitblind/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_tbitblind/Makefile" ;; "utils/sc_tracediff/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_tracediff/Makefile" ;; "utils/sc_uptime/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_uptime/Makefile" ;; "utils/sc_warts2csv/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2csv/Makefile" ;; "utils/sc_warts2json/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2json/Makefile" ;; "utils/sc_warts2pcap/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2pcap/Makefile" ;; "utils/sc_warts2text/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_warts2text/Makefile" ;; "utils/sc_wartscat/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartscat/Makefile" ;; "utils/sc_wartsdump/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartsdump/Makefile" ;; "utils/sc_wartsfix/Makefile") CONFIG_FILES="$CONFIG_FILES utils/sc_wartsfix/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi scamper-cvs-20171204/autom4te.cache/traces.2000644 001751 000000 00000204351 13211200056 020256 0ustar00mjlwheel000000 000000 m4trace:aclocal.m4:10182: -1- m4_include([m4/ax_check_openssl.m4]) m4trace:aclocal.m4:10183: -1- m4_include([m4/ax_gcc_builtin.m4]) m4trace:aclocal.m4:10184: -1- m4_include([m4/ax_pthread.m4]) m4trace:configure.ac:3: -1- AC_INIT([scamper], [20171204], [mjl@luckie.org.nz]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:3: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) m4trace:configure.ac:3: -1- m4_pattern_allow([^AS_FLAGS$]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.ac:3: -1- m4_pattern_forbid([^_?AS_]) m4trace:configure.ac:3: -1- AC_SUBST([SHELL]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([SHELL]) m4trace:configure.ac:3: -1- m4_pattern_allow([^SHELL$]) m4trace:configure.ac:3: -1- AC_SUBST([PATH_SEPARATOR]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PATH_SEPARATOR$]) m4trace:configure.ac:3: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([PACKAGE_NAME]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:3: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:3: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:3: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([PACKAGE_STRING]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:3: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:3: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([PACKAGE_URL]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_URL$]) m4trace:configure.ac:3: -1- AC_SUBST([exec_prefix], [NONE]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([exec_prefix]) m4trace:configure.ac:3: -1- m4_pattern_allow([^exec_prefix$]) m4trace:configure.ac:3: -1- AC_SUBST([prefix], [NONE]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([prefix]) m4trace:configure.ac:3: -1- m4_pattern_allow([^prefix$]) m4trace:configure.ac:3: -1- AC_SUBST([program_transform_name], [s,x,x,]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([program_transform_name]) m4trace:configure.ac:3: -1- m4_pattern_allow([^program_transform_name$]) m4trace:configure.ac:3: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([bindir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^bindir$]) m4trace:configure.ac:3: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([sbindir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^sbindir$]) m4trace:configure.ac:3: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([libexecdir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^libexecdir$]) m4trace:configure.ac:3: -1- AC_SUBST([datarootdir], ['${prefix}/share']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([datarootdir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^datarootdir$]) m4trace:configure.ac:3: -1- AC_SUBST([datadir], ['${datarootdir}']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([datadir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^datadir$]) m4trace:configure.ac:3: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([sysconfdir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^sysconfdir$]) m4trace:configure.ac:3: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([sharedstatedir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^sharedstatedir$]) m4trace:configure.ac:3: -1- AC_SUBST([localstatedir], ['${prefix}/var']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([localstatedir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^localstatedir$]) m4trace:configure.ac:3: -1- AC_SUBST([includedir], ['${prefix}/include']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([includedir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^includedir$]) m4trace:configure.ac:3: -1- AC_SUBST([oldincludedir], ['/usr/include']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([oldincludedir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^oldincludedir$]) m4trace:configure.ac:3: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], ['${datarootdir}/doc/${PACKAGE_TARNAME}'], ['${datarootdir}/doc/${PACKAGE}'])]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([docdir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^docdir$]) m4trace:configure.ac:3: -1- AC_SUBST([infodir], ['${datarootdir}/info']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([infodir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^infodir$]) m4trace:configure.ac:3: -1- AC_SUBST([htmldir], ['${docdir}']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([htmldir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^htmldir$]) m4trace:configure.ac:3: -1- AC_SUBST([dvidir], ['${docdir}']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([dvidir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^dvidir$]) m4trace:configure.ac:3: -1- AC_SUBST([pdfdir], ['${docdir}']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([pdfdir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^pdfdir$]) m4trace:configure.ac:3: -1- AC_SUBST([psdir], ['${docdir}']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([psdir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^psdir$]) m4trace:configure.ac:3: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([libdir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^libdir$]) m4trace:configure.ac:3: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([localedir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^localedir$]) m4trace:configure.ac:3: -1- AC_SUBST([mandir], ['${datarootdir}/man']) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([mandir]) m4trace:configure.ac:3: -1- m4_pattern_allow([^mandir$]) m4trace:configure.ac:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:3: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ @%:@undef PACKAGE_NAME]) m4trace:configure.ac:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:3: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ @%:@undef PACKAGE_TARNAME]) m4trace:configure.ac:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:3: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ @%:@undef PACKAGE_VERSION]) m4trace:configure.ac:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:3: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ @%:@undef PACKAGE_STRING]) m4trace:configure.ac:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:3: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ @%:@undef PACKAGE_BUGREPORT]) m4trace:configure.ac:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) m4trace:configure.ac:3: -1- m4_pattern_allow([^PACKAGE_URL$]) m4trace:configure.ac:3: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ @%:@undef PACKAGE_URL]) m4trace:configure.ac:3: -1- AC_SUBST([DEFS]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([DEFS]) m4trace:configure.ac:3: -1- m4_pattern_allow([^DEFS$]) m4trace:configure.ac:3: -1- AC_SUBST([ECHO_C]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([ECHO_C]) m4trace:configure.ac:3: -1- m4_pattern_allow([^ECHO_C$]) m4trace:configure.ac:3: -1- AC_SUBST([ECHO_N]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([ECHO_N]) m4trace:configure.ac:3: -1- m4_pattern_allow([^ECHO_N$]) m4trace:configure.ac:3: -1- AC_SUBST([ECHO_T]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([ECHO_T]) m4trace:configure.ac:3: -1- m4_pattern_allow([^ECHO_T$]) m4trace:configure.ac:3: -1- AC_SUBST([LIBS]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([LIBS]) m4trace:configure.ac:3: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:3: -1- AC_SUBST([build_alias]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build_alias]) m4trace:configure.ac:3: -1- m4_pattern_allow([^build_alias$]) m4trace:configure.ac:3: -1- AC_SUBST([host_alias]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host_alias]) m4trace:configure.ac:3: -1- m4_pattern_allow([^host_alias$]) m4trace:configure.ac:3: -1- AC_SUBST([target_alias]) m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target_alias]) m4trace:configure.ac:3: -1- m4_pattern_allow([^target_alias$]) m4trace:configure.ac:7: -1- AM_INIT_AUTOMAKE m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) m4trace:configure.ac:7: -1- AM_AUTOMAKE_VERSION([1.15.1]) m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([install-sh]) m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_PROGRAM]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_SCRIPT]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_DATA]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_DATA]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_DATA$]) m4trace:configure.ac:7: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__isrc]) m4trace:configure.ac:7: -1- m4_pattern_allow([^am__isrc$]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__isrc]) m4trace:configure.ac:7: -1- AC_SUBST([CYGPATH_W]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([CYGPATH_W]) m4trace:configure.ac:7: -1- m4_pattern_allow([^CYGPATH_W$]) m4trace:configure.ac:7: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([PACKAGE]) m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) m4trace:configure.ac:7: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([VERSION]) m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) m4trace:configure.ac:7: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ @%:@undef PACKAGE]) m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) m4trace:configure.ac:7: -1- AH_OUTPUT([VERSION], [/* Version number of package */ @%:@undef VERSION]) m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([missing]) m4trace:configure.ac:7: -1- AC_SUBST([ACLOCAL]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([ACLOCAL]) m4trace:configure.ac:7: -1- m4_pattern_allow([^ACLOCAL$]) m4trace:configure.ac:7: -1- AC_SUBST([AUTOCONF]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOCONF]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOCONF$]) m4trace:configure.ac:7: -1- AC_SUBST([AUTOMAKE]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOMAKE]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOMAKE$]) m4trace:configure.ac:7: -1- AC_SUBST([AUTOHEADER]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOHEADER]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOHEADER$]) m4trace:configure.ac:7: -1- AC_SUBST([MAKEINFO]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([MAKEINFO]) m4trace:configure.ac:7: -1- m4_pattern_allow([^MAKEINFO$]) m4trace:configure.ac:7: -1- AC_SUBST([install_sh]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([install_sh]) m4trace:configure.ac:7: -1- m4_pattern_allow([^install_sh$]) m4trace:configure.ac:7: -1- AC_SUBST([STRIP]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([STRIP]) m4trace:configure.ac:7: -1- m4_pattern_allow([^STRIP$]) m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([install-sh]) m4trace:configure.ac:7: -1- AC_SUBST([MKDIR_P]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([MKDIR_P]) m4trace:configure.ac:7: -1- m4_pattern_allow([^MKDIR_P$]) m4trace:configure.ac:7: -1- AC_SUBST([mkdir_p], ['$(MKDIR_P)']) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([mkdir_p]) m4trace:configure.ac:7: -1- m4_pattern_allow([^mkdir_p$]) m4trace:configure.ac:7: -1- AC_SUBST([AWK]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AWK]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AWK$]) m4trace:configure.ac:7: -1- AC_SUBST([SET_MAKE]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([SET_MAKE]) m4trace:configure.ac:7: -1- m4_pattern_allow([^SET_MAKE$]) m4trace:configure.ac:7: -1- AC_SUBST([am__leading_dot]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__leading_dot]) m4trace:configure.ac:7: -1- m4_pattern_allow([^am__leading_dot$]) m4trace:configure.ac:7: -1- AC_SUBST([AMTAR], ['$${TAR-tar}']) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AMTAR]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AMTAR$]) m4trace:configure.ac:7: -1- AC_SUBST([am__tar]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__tar]) m4trace:configure.ac:7: -1- m4_pattern_allow([^am__tar$]) m4trace:configure.ac:7: -1- AC_SUBST([am__untar]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__untar]) m4trace:configure.ac:7: -1- m4_pattern_allow([^am__untar$]) m4trace:configure.ac:7: -1- AM_SILENT_RULES m4trace:configure.ac:7: -1- AC_SUBST([AM_V]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_V]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_V$]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_V]) m4trace:configure.ac:7: -1- AC_SUBST([AM_DEFAULT_V]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_DEFAULT_V]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_V$]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) m4trace:configure.ac:7: -1- AC_SUBST([AM_DEFAULT_VERBOSITY]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_DEFAULT_VERBOSITY]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) m4trace:configure.ac:7: -1- AC_SUBST([AM_BACKSLASH]) m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_BACKSLASH]) m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_BACKSLASH$]) m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) m4trace:configure.ac:8: -1- AC_CONFIG_HEADERS([config.h]) m4trace:configure.ac:10: -1- AC_PROG_LIBTOOL m4trace:configure.ac:10: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. You should run autoupdate.], [aclocal.m4:121: AC_PROG_LIBTOOL is expanded from... configure.ac:10: the top level]) m4trace:configure.ac:10: -1- LT_INIT m4trace:configure.ac:10: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) m4trace:configure.ac:10: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) m4trace:configure.ac:10: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) m4trace:configure.ac:10: -1- AC_SUBST([LIBTOOL]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([LIBTOOL]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LIBTOOL$]) m4trace:configure.ac:10: -1- AC_CANONICAL_HOST m4trace:configure.ac:10: -1- AC_CANONICAL_BUILD m4trace:configure.ac:10: -1- AC_REQUIRE_AUX_FILE([config.sub]) m4trace:configure.ac:10: -1- AC_REQUIRE_AUX_FILE([config.guess]) m4trace:configure.ac:10: -1- AC_SUBST([build], [$ac_cv_build]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([build]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build$]) m4trace:configure.ac:10: -1- AC_SUBST([build_cpu], [$[1]]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([build_cpu]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build_cpu$]) m4trace:configure.ac:10: -1- AC_SUBST([build_vendor], [$[2]]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([build_vendor]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build_vendor$]) m4trace:configure.ac:10: -1- AC_SUBST([build_os]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([build_os]) m4trace:configure.ac:10: -1- m4_pattern_allow([^build_os$]) m4trace:configure.ac:10: -1- AC_SUBST([host], [$ac_cv_host]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([host]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host$]) m4trace:configure.ac:10: -1- AC_SUBST([host_cpu], [$[1]]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([host_cpu]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host_cpu$]) m4trace:configure.ac:10: -1- AC_SUBST([host_vendor], [$[2]]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([host_vendor]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host_vendor$]) m4trace:configure.ac:10: -1- AC_SUBST([host_os]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([host_os]) m4trace:configure.ac:10: -1- m4_pattern_allow([^host_os$]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- AC_SUBST([CFLAGS]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CFLAGS]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CFLAGS$]) m4trace:configure.ac:10: -1- AC_SUBST([LDFLAGS]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([LDFLAGS]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:10: -1- AC_SUBST([LIBS]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([LIBS]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:10: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CPPFLAGS]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- AC_SUBST([CC]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:10: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([ac_ct_CC]) m4trace:configure.ac:10: -1- m4_pattern_allow([^ac_ct_CC$]) m4trace:configure.ac:10: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([EXEEXT]) m4trace:configure.ac:10: -1- m4_pattern_allow([^EXEEXT$]) m4trace:configure.ac:10: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([OBJEXT]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OBJEXT$]) m4trace:configure.ac:10: -1- AC_REQUIRE_AUX_FILE([compile]) m4trace:configure.ac:10: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([DEPDIR]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DEPDIR$]) m4trace:configure.ac:10: -1- AC_SUBST([am__include]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([am__include]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__include$]) m4trace:configure.ac:10: -1- AC_SUBST([am__quote]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([am__quote]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__quote$]) m4trace:configure.ac:10: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) m4trace:configure.ac:10: -1- AC_SUBST([AMDEP_TRUE]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AMDEP_TRUE]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AMDEP_TRUE$]) m4trace:configure.ac:10: -1- AC_SUBST([AMDEP_FALSE]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AMDEP_FALSE]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AMDEP_FALSE$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) m4trace:configure.ac:10: -1- AC_SUBST([AMDEPBACKSLASH]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) m4trace:configure.ac:10: -1- AC_SUBST([am__nodep]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([am__nodep]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__nodep$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([am__nodep]) m4trace:configure.ac:10: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CCDEPMODE]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CCDEPMODE$]) m4trace:configure.ac:10: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:10: -1- AC_SUBST([am__fastdepCC_TRUE]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) m4trace:configure.ac:10: -1- AC_SUBST([am__fastdepCC_FALSE]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) m4trace:configure.ac:10: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) m4trace:configure.ac:10: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) m4trace:configure.ac:10: -1- AC_SUBST([SED]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([SED]) m4trace:configure.ac:10: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:10: -1- AC_SUBST([GREP]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([GREP]) m4trace:configure.ac:10: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:10: -1- AC_SUBST([EGREP]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([EGREP]) m4trace:configure.ac:10: -1- m4_pattern_allow([^EGREP$]) m4trace:configure.ac:10: -1- AC_SUBST([FGREP]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([FGREP]) m4trace:configure.ac:10: -1- m4_pattern_allow([^FGREP$]) m4trace:configure.ac:10: -1- AC_SUBST([GREP]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([GREP]) m4trace:configure.ac:10: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:10: -1- AC_SUBST([LD]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([LD]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LD$]) m4trace:configure.ac:10: -1- AC_SUBST([DUMPBIN]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([DUMPBIN]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DUMPBIN$]) m4trace:configure.ac:10: -1- AC_SUBST([ac_ct_DUMPBIN]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN]) m4trace:configure.ac:10: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) m4trace:configure.ac:10: -1- AC_SUBST([DUMPBIN]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([DUMPBIN]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DUMPBIN$]) m4trace:configure.ac:10: -1- AC_SUBST([NM]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([NM]) m4trace:configure.ac:10: -1- m4_pattern_allow([^NM$]) m4trace:configure.ac:10: -1- AC_SUBST([LN_S], [$as_ln_s]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([LN_S]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LN_S$]) m4trace:configure.ac:10: -1- AC_SUBST([OBJDUMP]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([OBJDUMP]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:10: -1- AC_SUBST([OBJDUMP]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([OBJDUMP]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:10: -1- AC_SUBST([DLLTOOL]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([DLLTOOL]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:10: -1- AC_SUBST([DLLTOOL]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([DLLTOOL]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:10: -1- AC_SUBST([AR]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AR]) m4trace:configure.ac:10: -1- m4_pattern_allow([^AR$]) m4trace:configure.ac:10: -1- AC_SUBST([ac_ct_AR]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([ac_ct_AR]) m4trace:configure.ac:10: -1- m4_pattern_allow([^ac_ct_AR$]) m4trace:configure.ac:10: -1- AC_SUBST([STRIP]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([STRIP]) m4trace:configure.ac:10: -1- m4_pattern_allow([^STRIP$]) m4trace:configure.ac:10: -1- AC_SUBST([RANLIB]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([RANLIB]) m4trace:configure.ac:10: -1- m4_pattern_allow([^RANLIB$]) m4trace:configure.ac:10: -1- m4_pattern_allow([LT_OBJDIR]) m4trace:configure.ac:10: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LT_OBJDIR$]) m4trace:configure.ac:10: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory where libtool stores uninstalled libraries. */ @%:@undef LT_OBJDIR]) m4trace:configure.ac:10: -1- LT_SUPPORTED_TAG([CC]) m4trace:configure.ac:10: -1- AC_SUBST([MANIFEST_TOOL]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([MANIFEST_TOOL]) m4trace:configure.ac:10: -1- m4_pattern_allow([^MANIFEST_TOOL$]) m4trace:configure.ac:10: -1- AC_SUBST([DSYMUTIL]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([DSYMUTIL]) m4trace:configure.ac:10: -1- m4_pattern_allow([^DSYMUTIL$]) m4trace:configure.ac:10: -1- AC_SUBST([NMEDIT]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([NMEDIT]) m4trace:configure.ac:10: -1- m4_pattern_allow([^NMEDIT$]) m4trace:configure.ac:10: -1- AC_SUBST([LIPO]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([LIPO]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LIPO$]) m4trace:configure.ac:10: -1- AC_SUBST([OTOOL]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([OTOOL]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OTOOL$]) m4trace:configure.ac:10: -1- AC_SUBST([OTOOL64]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([OTOOL64]) m4trace:configure.ac:10: -1- m4_pattern_allow([^OTOOL64$]) m4trace:configure.ac:10: -1- AC_SUBST([LT_SYS_LIBRARY_PATH]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([LT_SYS_LIBRARY_PATH]) m4trace:configure.ac:10: -1- m4_pattern_allow([^LT_SYS_LIBRARY_PATH$]) m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_DLFCN_H]) m4trace:configure.ac:10: -1- AC_SUBST([CPP]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CPP]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$]) m4trace:configure.ac:10: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CPPFLAGS]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:10: -1- AC_SUBST([CPP]) m4trace:configure.ac:10: -1- AC_SUBST_TRACE([CPP]) m4trace:configure.ac:10: -1- m4_pattern_allow([^CPP$]) m4trace:configure.ac:10: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) m4trace:configure.ac:10: -1- m4_pattern_allow([^STDC_HEADERS$]) m4trace:configure.ac:10: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ @%:@undef STDC_HEADERS]) m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_SYS_TYPES_H]) m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_SYS_STAT_H]) m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_STDLIB_H]) m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_STRING_H]) m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_MEMORY_H]) m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_STRINGS_H]) m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_INTTYPES_H]) m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_STDINT_H]) m4trace:configure.ac:10: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_UNISTD_H]) m4trace:configure.ac:10: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H]) m4trace:configure.ac:10: -1- m4_pattern_allow([^HAVE_DLFCN_H$]) m4trace:configure.ac:11: -1- AC_SUBST([CC]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- AC_SUBST([CFLAGS]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CFLAGS]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CFLAGS$]) m4trace:configure.ac:11: -1- AC_SUBST([LDFLAGS]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([LDFLAGS]) m4trace:configure.ac:11: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:11: -1- AC_SUBST([LIBS]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([LIBS]) m4trace:configure.ac:11: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:11: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CPPFLAGS]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:11: -1- AC_SUBST([CC]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- AC_SUBST([CC]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- AC_SUBST([CC]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- AC_SUBST([CC]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:11: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([ac_ct_CC]) m4trace:configure.ac:11: -1- m4_pattern_allow([^ac_ct_CC$]) m4trace:configure.ac:11: -1- AC_REQUIRE_AUX_FILE([compile]) m4trace:configure.ac:11: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([CCDEPMODE]) m4trace:configure.ac:11: -1- m4_pattern_allow([^CCDEPMODE$]) m4trace:configure.ac:11: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:11: -1- AC_SUBST([am__fastdepCC_TRUE]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) m4trace:configure.ac:11: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) m4trace:configure.ac:11: -1- AC_SUBST([am__fastdepCC_FALSE]) m4trace:configure.ac:11: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) m4trace:configure.ac:11: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) m4trace:configure.ac:11: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) m4trace:configure.ac:22: -1- AC_DEFINE_TRACE_LITERAL([NDEBUG]) m4trace:configure.ac:22: -1- m4_pattern_allow([^NDEBUG$]) m4trace:configure.ac:22: -1- AH_OUTPUT([NDEBUG], [/* Define to 1 if we don\'t want to do any debugging */ @%:@undef NDEBUG]) m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([WITHOUT_PRIVSEP]) m4trace:configure.ac:30: -1- m4_pattern_allow([^WITHOUT_PRIVSEP$]) m4trace:configure.ac:30: -1- AH_OUTPUT([WITHOUT_PRIVSEP], [/* Define to 1 if we don\'t want privilege separation */ @%:@undef WITHOUT_PRIVSEP]) m4trace:configure.ac:34: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:34: the top level]) m4trace:configure.ac:39: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:39: the top level]) m4trace:configure.ac:44: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:44: the top level]) m4trace:configure.ac:49: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from... configure.ac:49: the top level]) m4trace:configure.ac:54: -1- AC_SUBST([privsep_user]) m4trace:configure.ac:54: -1- AC_SUBST_TRACE([privsep_user]) m4trace:configure.ac:54: -1- m4_pattern_allow([^privsep_user$]) m4trace:configure.ac:55: -1- AC_SUBST([privsep_dir]) m4trace:configure.ac:55: -1- AC_SUBST_TRACE([privsep_dir]) m4trace:configure.ac:55: -1- m4_pattern_allow([^privsep_dir$]) m4trace:configure.ac:56: -1- AC_SUBST([privsep_dir_user]) m4trace:configure.ac:56: -1- AC_SUBST_TRACE([privsep_dir_user]) m4trace:configure.ac:56: -1- m4_pattern_allow([^privsep_dir_user$]) m4trace:configure.ac:57: -1- AC_SUBST([privsep_dir_group]) m4trace:configure.ac:57: -1- AC_SUBST_TRACE([privsep_dir_group]) m4trace:configure.ac:57: -1- m4_pattern_allow([^privsep_dir_group$]) m4trace:configure.ac:58: -1- AC_DEFINE_TRACE_LITERAL([PRIVSEP_USER]) m4trace:configure.ac:58: -1- m4_pattern_allow([^PRIVSEP_USER$]) m4trace:configure.ac:58: -1- AH_OUTPUT([PRIVSEP_USER], [/* user name for privsep process */ @%:@undef PRIVSEP_USER]) m4trace:configure.ac:61: -1- AC_DEFINE_TRACE_LITERAL([PRIVSEP_DIR]) m4trace:configure.ac:61: -1- m4_pattern_allow([^PRIVSEP_DIR$]) m4trace:configure.ac:61: -1- AH_OUTPUT([PRIVSEP_DIR], [/* chroot directory for privsep process */ @%:@undef PRIVSEP_DIR]) m4trace:configure.ac:64: -1- AC_DEFINE_TRACE_LITERAL([PRIVSEP_DIR_USER]) m4trace:configure.ac:64: -1- m4_pattern_allow([^PRIVSEP_DIR_USER$]) m4trace:configure.ac:64: -1- AH_OUTPUT([PRIVSEP_DIR_USER], [/* chroot directory owner */ @%:@undef PRIVSEP_DIR_USER]) m4trace:configure.ac:67: -1- AC_DEFINE_TRACE_LITERAL([PRIVSEP_DIR_GROUP]) m4trace:configure.ac:67: -1- m4_pattern_allow([^PRIVSEP_DIR_GROUP$]) m4trace:configure.ac:67: -1- AH_OUTPUT([PRIVSEP_DIR_GROUP], [/* chroot directory group id */ @%:@undef PRIVSEP_DIR_GROUP]) m4trace:configure.ac:77: -1- AC_DEFINE_TRACE_LITERAL([WITHOUT_DEBUGFILE]) m4trace:configure.ac:77: -1- m4_pattern_allow([^WITHOUT_DEBUGFILE$]) m4trace:configure.ac:77: -1- AH_OUTPUT([WITHOUT_DEBUGFILE], [/* Defined to 1 if we don\'t want to be able generate a debugfile */ @%:@undef WITHOUT_DEBUGFILE]) m4trace:configure.ac:102: -1- AM_CONDITIONAL([WITH_SC_UPTIME], [test x$with_sc_uptime = xyes]) m4trace:configure.ac:102: -1- AC_SUBST([WITH_SC_UPTIME_TRUE]) m4trace:configure.ac:102: -1- AC_SUBST_TRACE([WITH_SC_UPTIME_TRUE]) m4trace:configure.ac:102: -1- m4_pattern_allow([^WITH_SC_UPTIME_TRUE$]) m4trace:configure.ac:102: -1- AC_SUBST([WITH_SC_UPTIME_FALSE]) m4trace:configure.ac:102: -1- AC_SUBST_TRACE([WITH_SC_UPTIME_FALSE]) m4trace:configure.ac:102: -1- m4_pattern_allow([^WITH_SC_UPTIME_FALSE$]) m4trace:configure.ac:102: -1- _AM_SUBST_NOTMAKE([WITH_SC_UPTIME_TRUE]) m4trace:configure.ac:102: -1- _AM_SUBST_NOTMAKE([WITH_SC_UPTIME_FALSE]) m4trace:configure.ac:105: -1- AH_OUTPUT([HAVE_LIBIPHLPAPI], [/* Define to 1 if you have the `iphlpapi\' library (-liphlpapi). */ @%:@undef HAVE_LIBIPHLPAPI]) m4trace:configure.ac:105: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBIPHLPAPI]) m4trace:configure.ac:105: -1- m4_pattern_allow([^HAVE_LIBIPHLPAPI$]) m4trace:configure.ac:106: -1- AH_OUTPUT([HAVE_LIBWS2_32], [/* Define to 1 if you have the `ws2_32\' library (-lws2_32). */ @%:@undef HAVE_LIBWS2_32]) m4trace:configure.ac:106: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBWS2_32]) m4trace:configure.ac:106: -1- m4_pattern_allow([^HAVE_LIBWS2_32$]) m4trace:configure.ac:109: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) m4trace:configure.ac:109: -1- m4_pattern_allow([^STDC_HEADERS$]) m4trace:configure.ac:109: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ @%:@undef STDC_HEADERS]) m4trace:configure.ac:110: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_WAIT_H]) m4trace:configure.ac:110: -1- m4_pattern_allow([^HAVE_SYS_WAIT_H$]) m4trace:configure.ac:110: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have that is POSIX.1 compatible. */ @%:@undef HAVE_SYS_WAIT_H]) m4trace:configure.ac:111: -1- AC_DEFINE_TRACE_LITERAL([TIME_WITH_SYS_TIME]) m4trace:configure.ac:111: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) m4trace:configure.ac:111: -1- AH_OUTPUT([TIME_WITH_SYS_TIME], [/* Define to 1 if you can safely include both and . */ @%:@undef TIME_WITH_SYS_TIME]) m4trace:configure.ac:112: -1- AH_OUTPUT([HAVE_ARPA_INET_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_ARPA_INET_H]) m4trace:configure.ac:112: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ARPA_INET_H]) m4trace:configure.ac:112: -1- m4_pattern_allow([^HAVE_ARPA_INET_H$]) m4trace:configure.ac:113: -1- AH_OUTPUT([HAVE_FCNTL_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_FCNTL_H]) m4trace:configure.ac:113: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FCNTL_H]) m4trace:configure.ac:113: -1- m4_pattern_allow([^HAVE_FCNTL_H$]) m4trace:configure.ac:114: -1- AH_OUTPUT([HAVE_LIMITS_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_LIMITS_H]) m4trace:configure.ac:114: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIMITS_H]) m4trace:configure.ac:114: -1- m4_pattern_allow([^HAVE_LIMITS_H$]) m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_NETDB_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_NETDB_H]) m4trace:configure.ac:115: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NETDB_H]) m4trace:configure.ac:115: -1- m4_pattern_allow([^HAVE_NETDB_H$]) m4trace:configure.ac:116: -1- AH_OUTPUT([HAVE_NET_IF_DL_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_NET_IF_DL_H]) m4trace:configure.ac:116: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NET_IF_DL_H]) m4trace:configure.ac:116: -1- m4_pattern_allow([^HAVE_NET_IF_DL_H$]) m4trace:configure.ac:117: -1- AH_OUTPUT([HAVE_NET_IF_TYPES_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_NET_IF_TYPES_H]) m4trace:configure.ac:117: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NET_IF_TYPES_H]) m4trace:configure.ac:117: -1- m4_pattern_allow([^HAVE_NET_IF_TYPES_H$]) m4trace:configure.ac:118: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_NETINET_IN_H]) m4trace:configure.ac:118: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NETINET_IN_H]) m4trace:configure.ac:118: -1- m4_pattern_allow([^HAVE_NETINET_IN_H$]) m4trace:configure.ac:119: -1- AH_OUTPUT([HAVE_POLL_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_POLL_H]) m4trace:configure.ac:119: -1- AC_DEFINE_TRACE_LITERAL([HAVE_POLL_H]) m4trace:configure.ac:119: -1- m4_pattern_allow([^HAVE_POLL_H$]) m4trace:configure.ac:120: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_STDINT_H]) m4trace:configure.ac:120: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDINT_H]) m4trace:configure.ac:120: -1- m4_pattern_allow([^HAVE_STDINT_H$]) m4trace:configure.ac:121: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_STDLIB_H]) m4trace:configure.ac:121: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDLIB_H]) m4trace:configure.ac:121: -1- m4_pattern_allow([^HAVE_STDLIB_H$]) m4trace:configure.ac:122: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_STRING_H]) m4trace:configure.ac:122: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRING_H]) m4trace:configure.ac:122: -1- m4_pattern_allow([^HAVE_STRING_H$]) m4trace:configure.ac:123: -1- AH_OUTPUT([HAVE_SYS_EPOLL_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_SYS_EPOLL_H]) m4trace:configure.ac:123: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_EPOLL_H]) m4trace:configure.ac:123: -1- m4_pattern_allow([^HAVE_SYS_EPOLL_H$]) m4trace:configure.ac:124: -1- AH_OUTPUT([HAVE_SYS_EVENT_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_SYS_EVENT_H]) m4trace:configure.ac:124: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_EVENT_H]) m4trace:configure.ac:124: -1- m4_pattern_allow([^HAVE_SYS_EVENT_H$]) m4trace:configure.ac:125: -1- AH_OUTPUT([HAVE_SYS_IOCTL_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_SYS_IOCTL_H]) m4trace:configure.ac:125: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_IOCTL_H]) m4trace:configure.ac:125: -1- m4_pattern_allow([^HAVE_SYS_IOCTL_H$]) m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_SYS_PARAM_H]) m4trace:configure.ac:126: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_PARAM_H]) m4trace:configure.ac:126: -1- m4_pattern_allow([^HAVE_SYS_PARAM_H$]) m4trace:configure.ac:127: -1- AH_OUTPUT([HAVE_SYS_SOCKET_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_SYS_SOCKET_H]) m4trace:configure.ac:127: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SOCKET_H]) m4trace:configure.ac:127: -1- m4_pattern_allow([^HAVE_SYS_SOCKET_H$]) m4trace:configure.ac:128: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_SYS_TIME_H]) m4trace:configure.ac:128: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_TIME_H]) m4trace:configure.ac:128: -1- m4_pattern_allow([^HAVE_SYS_TIME_H$]) m4trace:configure.ac:129: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_UNISTD_H]) m4trace:configure.ac:129: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UNISTD_H]) m4trace:configure.ac:129: -1- m4_pattern_allow([^HAVE_UNISTD_H$]) m4trace:configure.ac:130: -1- AH_OUTPUT([HAVE_IFADDRS_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_IFADDRS_H]) m4trace:configure.ac:130: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IFADDRS_H]) m4trace:configure.ac:130: -1- m4_pattern_allow([^HAVE_IFADDRS_H$]) m4trace:configure.ac:133: -1- AH_OUTPUT([HAVE_SYS_SYSCTL_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_SYS_SYSCTL_H]) m4trace:configure.ac:133: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_SYSCTL_H]) m4trace:configure.ac:133: -1- m4_pattern_allow([^HAVE_SYS_SYSCTL_H$]) m4trace:configure.ac:140: -1- AH_OUTPUT([HAVE_NETINET_IP_FW_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_NETINET_IP_FW_H]) m4trace:configure.ac:140: -1- AH_OUTPUT([HAVE_NETINET6_IP6_FW_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_NETINET6_IP6_FW_H]) m4trace:configure.ac:158: -1- AH_OUTPUT([HAVE_NETINET_TCP_VAR_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_NETINET_TCP_VAR_H]) m4trace:configure.ac:158: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NETINET_TCP_VAR_H]) m4trace:configure.ac:158: -1- m4_pattern_allow([^HAVE_NETINET_TCP_VAR_H$]) m4trace:configure.ac:173: -1- AH_OUTPUT([HAVE_NET_PFVAR_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_NET_PFVAR_H]) m4trace:configure.ac:173: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NET_PFVAR_H]) m4trace:configure.ac:173: -1- m4_pattern_allow([^HAVE_NET_PFVAR_H$]) m4trace:configure.ac:182: -1- AC_DEFINE_TRACE_LITERAL([const]) m4trace:configure.ac:182: -1- m4_pattern_allow([^const$]) m4trace:configure.ac:182: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ @%:@undef const]) m4trace:configure.ac:183: -1- AC_DEFINE_TRACE_LITERAL([uid_t]) m4trace:configure.ac:183: -1- m4_pattern_allow([^uid_t$]) m4trace:configure.ac:183: -1- AH_OUTPUT([uid_t], [/* Define to `int\' if doesn\'t define. */ @%:@undef uid_t]) m4trace:configure.ac:183: -1- AC_DEFINE_TRACE_LITERAL([gid_t]) m4trace:configure.ac:183: -1- m4_pattern_allow([^gid_t$]) m4trace:configure.ac:183: -1- AH_OUTPUT([gid_t], [/* Define to `int\' if doesn\'t define. */ @%:@undef gid_t]) m4trace:configure.ac:184: -1- AC_DEFINE_TRACE_LITERAL([int16_t]) m4trace:configure.ac:184: -1- m4_pattern_allow([^int16_t$]) m4trace:configure.ac:184: -1- AH_OUTPUT([int16_t], [/* Define to the type of a signed integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ @%:@undef int16_t]) m4trace:configure.ac:185: -1- AC_DEFINE_TRACE_LITERAL([int32_t]) m4trace:configure.ac:185: -1- m4_pattern_allow([^int32_t$]) m4trace:configure.ac:185: -1- AH_OUTPUT([int32_t], [/* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ @%:@undef int32_t]) m4trace:configure.ac:186: -1- AC_DEFINE_TRACE_LITERAL([mode_t]) m4trace:configure.ac:186: -1- m4_pattern_allow([^mode_t$]) m4trace:configure.ac:186: -1- AH_OUTPUT([mode_t], [/* Define to `int\' if does not define. */ @%:@undef mode_t]) m4trace:configure.ac:187: -1- AC_DEFINE_TRACE_LITERAL([off_t]) m4trace:configure.ac:187: -1- m4_pattern_allow([^off_t$]) m4trace:configure.ac:187: -1- AH_OUTPUT([off_t], [/* Define to `long int\' if does not define. */ @%:@undef off_t]) m4trace:configure.ac:188: -1- AC_DEFINE_TRACE_LITERAL([pid_t]) m4trace:configure.ac:188: -1- m4_pattern_allow([^pid_t$]) m4trace:configure.ac:188: -1- AH_OUTPUT([pid_t], [/* Define to `int\' if does not define. */ @%:@undef pid_t]) m4trace:configure.ac:189: -1- AC_DEFINE_TRACE_LITERAL([size_t]) m4trace:configure.ac:189: -1- m4_pattern_allow([^size_t$]) m4trace:configure.ac:189: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if does not define. */ @%:@undef size_t]) m4trace:configure.ac:190: -1- AC_DEFINE_TRACE_LITERAL([ssize_t]) m4trace:configure.ac:190: -1- m4_pattern_allow([^ssize_t$]) m4trace:configure.ac:190: -1- AH_OUTPUT([ssize_t], [/* Define to `int\' if does not define. */ @%:@undef ssize_t]) m4trace:configure.ac:191: -1- AC_DEFINE_TRACE_LITERAL([TM_IN_SYS_TIME]) m4trace:configure.ac:191: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) m4trace:configure.ac:191: -1- AH_OUTPUT([TM_IN_SYS_TIME], [/* Define to 1 if your declares `struct tm\'. */ @%:@undef TM_IN_SYS_TIME]) m4trace:configure.ac:192: -1- AC_DEFINE_TRACE_LITERAL([uint16_t]) m4trace:configure.ac:192: -1- m4_pattern_allow([^uint16_t$]) m4trace:configure.ac:192: -1- AH_OUTPUT([uint16_t], [/* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ @%:@undef uint16_t]) m4trace:configure.ac:193: -1- AC_DEFINE_TRACE_LITERAL([_UINT32_T]) m4trace:configure.ac:193: -1- m4_pattern_allow([^_UINT32_T$]) m4trace:configure.ac:193: -1- AH_OUTPUT([_UINT32_T], [/* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the @%:@define below would cause a syntax error. */ @%:@undef _UINT32_T]) m4trace:configure.ac:193: -1- AC_DEFINE_TRACE_LITERAL([uint32_t]) m4trace:configure.ac:193: -1- m4_pattern_allow([^uint32_t$]) m4trace:configure.ac:193: -1- AH_OUTPUT([uint32_t], [/* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ @%:@undef uint32_t]) m4trace:configure.ac:194: -1- AC_DEFINE_TRACE_LITERAL([_UINT64_T]) m4trace:configure.ac:194: -1- m4_pattern_allow([^_UINT64_T$]) m4trace:configure.ac:194: -1- AH_OUTPUT([_UINT64_T], [/* Define for Solaris 2.5.1 so the uint64_t typedef from , , or is not used. If the typedef were allowed, the @%:@define below would cause a syntax error. */ @%:@undef _UINT64_T]) m4trace:configure.ac:194: -1- AC_DEFINE_TRACE_LITERAL([uint64_t]) m4trace:configure.ac:194: -1- m4_pattern_allow([^uint64_t$]) m4trace:configure.ac:194: -1- AH_OUTPUT([uint64_t], [/* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ @%:@undef uint64_t]) m4trace:configure.ac:195: -1- AC_DEFINE_TRACE_LITERAL([_UINT8_T]) m4trace:configure.ac:195: -1- m4_pattern_allow([^_UINT8_T$]) m4trace:configure.ac:195: -1- AH_OUTPUT([_UINT8_T], [/* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the @%:@define below would cause a syntax error. */ @%:@undef _UINT8_T]) m4trace:configure.ac:195: -1- AC_DEFINE_TRACE_LITERAL([uint8_t]) m4trace:configure.ac:195: -1- m4_pattern_allow([^uint8_t$]) m4trace:configure.ac:195: -1- AH_OUTPUT([uint8_t], [/* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ @%:@undef uint8_t]) m4trace:configure.ac:198: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_UNISTD_H]) m4trace:configure.ac:198: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UNISTD_H]) m4trace:configure.ac:198: -1- m4_pattern_allow([^HAVE_UNISTD_H$]) m4trace:configure.ac:198: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CHOWN]) m4trace:configure.ac:198: -1- m4_pattern_allow([^HAVE_CHOWN$]) m4trace:configure.ac:198: -1- AH_OUTPUT([HAVE_CHOWN], [/* Define to 1 if your system has a working `chown\' function. */ @%:@undef HAVE_CHOWN]) m4trace:configure.ac:199: -1- AH_OUTPUT([HAVE_VFORK_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_VFORK_H]) m4trace:configure.ac:199: -1- AC_DEFINE_TRACE_LITERAL([HAVE_VFORK_H]) m4trace:configure.ac:199: -1- m4_pattern_allow([^HAVE_VFORK_H$]) m4trace:configure.ac:199: -1- AH_OUTPUT([HAVE_FORK], [/* Define to 1 if you have the `fork\' function. */ @%:@undef HAVE_FORK]) m4trace:configure.ac:199: -1- AH_OUTPUT([HAVE_VFORK], [/* Define to 1 if you have the `vfork\' function. */ @%:@undef HAVE_VFORK]) m4trace:configure.ac:199: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_VFORK]) m4trace:configure.ac:199: -1- m4_pattern_allow([^HAVE_WORKING_VFORK$]) m4trace:configure.ac:199: -1- AH_OUTPUT([HAVE_WORKING_VFORK], [/* Define to 1 if `vfork\' works. */ @%:@undef HAVE_WORKING_VFORK]) m4trace:configure.ac:199: -1- AC_DEFINE_TRACE_LITERAL([vfork]) m4trace:configure.ac:199: -1- m4_pattern_allow([^vfork$]) m4trace:configure.ac:199: -1- AH_OUTPUT([vfork], [/* Define as `fork\' if `vfork\' does not work. */ @%:@undef vfork]) m4trace:configure.ac:199: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_FORK]) m4trace:configure.ac:199: -1- m4_pattern_allow([^HAVE_WORKING_FORK$]) m4trace:configure.ac:199: -1- AH_OUTPUT([HAVE_WORKING_FORK], [/* Define to 1 if `fork\' works. */ @%:@undef HAVE_WORKING_FORK]) m4trace:configure.ac:200: -1- AH_OUTPUT([HAVE_ARC4RANDOM], [/* Define to 1 if you have the `arc4random\' function. */ @%:@undef HAVE_ARC4RANDOM]) m4trace:configure.ac:200: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ARC4RANDOM]) m4trace:configure.ac:200: -1- m4_pattern_allow([^HAVE_ARC4RANDOM$]) m4trace:configure.ac:201: -1- AH_OUTPUT([HAVE_ARC4RANDOM_UNIFORM], [/* Define to 1 if you have the `arc4random_uniform\' function. */ @%:@undef HAVE_ARC4RANDOM_UNIFORM]) m4trace:configure.ac:201: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ARC4RANDOM_UNIFORM]) m4trace:configure.ac:201: -1- m4_pattern_allow([^HAVE_ARC4RANDOM_UNIFORM$]) m4trace:configure.ac:202: -1- AH_OUTPUT([HAVE_ATEXIT], [/* Define to 1 if you have the `atexit\' function. */ @%:@undef HAVE_ATEXIT]) m4trace:configure.ac:202: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ATEXIT]) m4trace:configure.ac:202: -1- m4_pattern_allow([^HAVE_ATEXIT$]) m4trace:configure.ac:203: -1- AH_OUTPUT([HAVE_CALLOC], [/* Define to 1 if you have the `calloc\' function. */ @%:@undef HAVE_CALLOC]) m4trace:configure.ac:203: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CALLOC]) m4trace:configure.ac:203: -1- m4_pattern_allow([^HAVE_CALLOC$]) m4trace:configure.ac:204: -1- AH_OUTPUT([HAVE_DAEMON], [/* Define to 1 if you have the `daemon\' function. */ @%:@undef HAVE_DAEMON]) m4trace:configure.ac:204: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DAEMON]) m4trace:configure.ac:204: -1- m4_pattern_allow([^HAVE_DAEMON$]) m4trace:configure.ac:205: -1- AH_OUTPUT([HAVE_ENDPWENT], [/* Define to 1 if you have the `endpwent\' function. */ @%:@undef HAVE_ENDPWENT]) m4trace:configure.ac:205: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ENDPWENT]) m4trace:configure.ac:205: -1- m4_pattern_allow([^HAVE_ENDPWENT$]) m4trace:configure.ac:206: -1- AH_OUTPUT([HAVE_EPOLL_WAIT], [/* Define to 1 if you have the `epoll_wait\' function. */ @%:@undef HAVE_EPOLL_WAIT]) m4trace:configure.ac:206: -1- AC_DEFINE_TRACE_LITERAL([HAVE_EPOLL_WAIT]) m4trace:configure.ac:206: -1- m4_pattern_allow([^HAVE_EPOLL_WAIT$]) m4trace:configure.ac:207: -1- AH_OUTPUT([HAVE_FTRUNCATE], [/* Define to 1 if you have the `ftruncate\' function. */ @%:@undef HAVE_FTRUNCATE]) m4trace:configure.ac:207: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FTRUNCATE]) m4trace:configure.ac:207: -1- m4_pattern_allow([^HAVE_FTRUNCATE$]) m4trace:configure.ac:208: -1- AH_OUTPUT([HAVE_GETDTABLESIZE], [/* Define to 1 if you have the `getdtablesize\' function. */ @%:@undef HAVE_GETDTABLESIZE]) m4trace:configure.ac:208: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETDTABLESIZE]) m4trace:configure.ac:208: -1- m4_pattern_allow([^HAVE_GETDTABLESIZE$]) m4trace:configure.ac:209: -1- AH_OUTPUT([HAVE_GETHOSTNAME], [/* Define to 1 if you have the `gethostname\' function. */ @%:@undef HAVE_GETHOSTNAME]) m4trace:configure.ac:209: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETHOSTNAME]) m4trace:configure.ac:209: -1- m4_pattern_allow([^HAVE_GETHOSTNAME$]) m4trace:configure.ac:210: -1- AH_OUTPUT([HAVE_GETIFADDRS], [/* Define to 1 if you have the `getifaddrs\' function. */ @%:@undef HAVE_GETIFADDRS]) m4trace:configure.ac:210: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETIFADDRS]) m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_GETIFADDRS$]) m4trace:configure.ac:211: -1- AH_OUTPUT([HAVE_GETPAGESIZE], [/* Define to 1 if you have the `getpagesize\' function. */ @%:@undef HAVE_GETPAGESIZE]) m4trace:configure.ac:211: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPAGESIZE]) m4trace:configure.ac:211: -1- m4_pattern_allow([^HAVE_GETPAGESIZE$]) m4trace:configure.ac:212: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the `gettimeofday\' function. */ @%:@undef HAVE_GETTIMEOFDAY]) m4trace:configure.ac:212: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETTIMEOFDAY]) m4trace:configure.ac:212: -1- m4_pattern_allow([^HAVE_GETTIMEOFDAY$]) m4trace:configure.ac:213: -1- AH_OUTPUT([HAVE_KQUEUE], [/* Define to 1 if you have the `kqueue\' function. */ @%:@undef HAVE_KQUEUE]) m4trace:configure.ac:213: -1- AC_DEFINE_TRACE_LITERAL([HAVE_KQUEUE]) m4trace:configure.ac:213: -1- m4_pattern_allow([^HAVE_KQUEUE$]) m4trace:configure.ac:214: -1- AH_OUTPUT([HAVE_MEMMOVE], [/* Define to 1 if you have the `memmove\' function. */ @%:@undef HAVE_MEMMOVE]) m4trace:configure.ac:214: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MEMMOVE]) m4trace:configure.ac:214: -1- m4_pattern_allow([^HAVE_MEMMOVE$]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_MEMSET], [/* Define to 1 if you have the `memset\' function. */ @%:@undef HAVE_MEMSET]) m4trace:configure.ac:215: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MEMSET]) m4trace:configure.ac:215: -1- m4_pattern_allow([^HAVE_MEMSET$]) m4trace:configure.ac:216: -1- AH_OUTPUT([HAVE_MKDIR], [/* Define to 1 if you have the `mkdir\' function. */ @%:@undef HAVE_MKDIR]) m4trace:configure.ac:216: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MKDIR]) m4trace:configure.ac:216: -1- m4_pattern_allow([^HAVE_MKDIR$]) m4trace:configure.ac:217: -1- AH_OUTPUT([HAVE_POLL], [/* Define to 1 if you have the `poll\' function. */ @%:@undef HAVE_POLL]) m4trace:configure.ac:217: -1- AC_DEFINE_TRACE_LITERAL([HAVE_POLL]) m4trace:configure.ac:217: -1- m4_pattern_allow([^HAVE_POLL$]) m4trace:configure.ac:218: -1- AH_OUTPUT([HAVE_RMDIR], [/* Define to 1 if you have the `rmdir\' function. */ @%:@undef HAVE_RMDIR]) m4trace:configure.ac:218: -1- AC_DEFINE_TRACE_LITERAL([HAVE_RMDIR]) m4trace:configure.ac:218: -1- m4_pattern_allow([^HAVE_RMDIR$]) m4trace:configure.ac:219: -1- AH_OUTPUT([HAVE_SELECT], [/* Define to 1 if you have the `select\' function. */ @%:@undef HAVE_SELECT]) m4trace:configure.ac:219: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SELECT]) m4trace:configure.ac:219: -1- m4_pattern_allow([^HAVE_SELECT$]) m4trace:configure.ac:220: -1- AH_OUTPUT([HAVE_SOCKET], [/* Define to 1 if you have the `socket\' function. */ @%:@undef HAVE_SOCKET]) m4trace:configure.ac:220: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOCKET]) m4trace:configure.ac:220: -1- m4_pattern_allow([^HAVE_SOCKET$]) m4trace:configure.ac:221: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the `snprintf\' function. */ @%:@undef HAVE_SNPRINTF]) m4trace:configure.ac:221: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SNPRINTF]) m4trace:configure.ac:221: -1- m4_pattern_allow([^HAVE_SNPRINTF$]) m4trace:configure.ac:222: -1- AH_OUTPUT([HAVE_SETPROCTITLE], [/* Define to 1 if you have the `setproctitle\' function. */ @%:@undef HAVE_SETPROCTITLE]) m4trace:configure.ac:222: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SETPROCTITLE]) m4trace:configure.ac:222: -1- m4_pattern_allow([^HAVE_SETPROCTITLE$]) m4trace:configure.ac:223: -1- AH_OUTPUT([HAVE_STRCASECMP], [/* Define to 1 if you have the `strcasecmp\' function. */ @%:@undef HAVE_STRCASECMP]) m4trace:configure.ac:223: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRCASECMP]) m4trace:configure.ac:223: -1- m4_pattern_allow([^HAVE_STRCASECMP$]) m4trace:configure.ac:224: -1- AH_OUTPUT([HAVE_STRCASESTR], [/* Define to 1 if you have the `strcasestr\' function. */ @%:@undef HAVE_STRCASESTR]) m4trace:configure.ac:224: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRCASESTR]) m4trace:configure.ac:224: -1- m4_pattern_allow([^HAVE_STRCASESTR$]) m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_STRDUP], [/* Define to 1 if you have the `strdup\' function. */ @%:@undef HAVE_STRDUP]) m4trace:configure.ac:225: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRDUP]) m4trace:configure.ac:225: -1- m4_pattern_allow([^HAVE_STRDUP$]) m4trace:configure.ac:226: -1- AH_OUTPUT([HAVE_STRERROR], [/* Define to 1 if you have the `strerror\' function. */ @%:@undef HAVE_STRERROR]) m4trace:configure.ac:226: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRERROR]) m4trace:configure.ac:226: -1- m4_pattern_allow([^HAVE_STRERROR$]) m4trace:configure.ac:227: -1- AH_OUTPUT([HAVE_STRNCASECMP], [/* Define to 1 if you have the `strncasecmp\' function. */ @%:@undef HAVE_STRNCASECMP]) m4trace:configure.ac:227: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRNCASECMP]) m4trace:configure.ac:227: -1- m4_pattern_allow([^HAVE_STRNCASECMP$]) m4trace:configure.ac:228: -1- AH_OUTPUT([HAVE_STRTOL], [/* Define to 1 if you have the `strtol\' function. */ @%:@undef HAVE_STRTOL]) m4trace:configure.ac:228: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRTOL]) m4trace:configure.ac:228: -1- m4_pattern_allow([^HAVE_STRTOL$]) m4trace:configure.ac:229: -1- AH_OUTPUT([HAVE_UNAME], [/* Define to 1 if you have the `uname\' function. */ @%:@undef HAVE_UNAME]) m4trace:configure.ac:229: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UNAME]) m4trace:configure.ac:229: -1- m4_pattern_allow([^HAVE_UNAME$]) m4trace:configure.ac:231: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG]) m4trace:configure.ac:231: -1- m4_pattern_allow([^SIZEOF_LONG$]) m4trace:configure.ac:231: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of `long\', as computed by sizeof. */ @%:@undef SIZEOF_LONG]) m4trace:configure.ac:233: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_SA_LEN]) m4trace:configure.ac:233: -1- m4_pattern_allow([^HAVE_STRUCT_SOCKADDR_SA_LEN$]) m4trace:configure.ac:233: -1- AH_OUTPUT([HAVE_STRUCT_SOCKADDR_SA_LEN], [/* Define if struct sockaddr has an sa_len member */ @%:@undef HAVE_STRUCT_SOCKADDR_SA_LEN]) m4trace:configure.ac:240: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_PFIOC_TRANS_E_TYPE]) m4trace:configure.ac:240: -1- m4_pattern_allow([^HAVE_STRUCT_PFIOC_TRANS_E_TYPE$]) m4trace:configure.ac:240: -1- AH_OUTPUT([HAVE_STRUCT_PFIOC_TRANS_E_TYPE], [/* Define if struct pfioc_trans_e has a type member */ @%:@undef HAVE_STRUCT_PFIOC_TRANS_E_TYPE]) m4trace:configure.ac:248: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM]) m4trace:configure.ac:248: -1- m4_pattern_allow([^HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM$]) m4trace:configure.ac:248: -1- AH_OUTPUT([HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM], [/* Define if struct pfioc_trans_e has a rs_num member */ @%:@undef HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM]) m4trace:configure.ac:256: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_PF_RULE_NAT]) m4trace:configure.ac:256: -1- m4_pattern_allow([^HAVE_STRUCT_PF_RULE_NAT$]) m4trace:configure.ac:256: -1- AH_OUTPUT([HAVE_STRUCT_PF_RULE_NAT], [/* Define if struct pf_rule has a nat member */ @%:@undef HAVE_STRUCT_PF_RULE_NAT]) m4trace:configure.ac:264: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_PF_RULE_RDR]) m4trace:configure.ac:264: -1- m4_pattern_allow([^HAVE_STRUCT_PF_RULE_RDR$]) m4trace:configure.ac:264: -1- AH_OUTPUT([HAVE_STRUCT_PF_RULE_RDR], [/* Define if struct pf_rule has a rdr member */ @%:@undef HAVE_STRUCT_PF_RULE_RDR]) m4trace:configure.ac:276: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_IP6_EXT]) m4trace:configure.ac:276: -1- m4_pattern_allow([^HAVE_STRUCT_IP6_EXT$]) m4trace:configure.ac:276: -1- AH_OUTPUT([HAVE_STRUCT_IP6_EXT], [/* Define to 1 if you have the `ip6_ext\' struct. */ @%:@undef HAVE_STRUCT_IP6_EXT]) m4trace:configure.ac:297: -1- AC_SUBST([PKG_CONFIG]) m4trace:configure.ac:297: -1- AC_SUBST_TRACE([PKG_CONFIG]) m4trace:configure.ac:297: -1- m4_pattern_allow([^PKG_CONFIG$]) m4trace:configure.ac:297: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL]) m4trace:configure.ac:297: -1- m4_pattern_allow([^HAVE_OPENSSL$]) m4trace:configure.ac:297: -1- AH_OUTPUT([HAVE_OPENSSL], [/* Define to 1 if you have OpenSSL */ @%:@undef HAVE_OPENSSL]) m4trace:configure.ac:297: -1- AC_SUBST([OPENSSL_INCLUDES]) m4trace:configure.ac:297: -1- AC_SUBST_TRACE([OPENSSL_INCLUDES]) m4trace:configure.ac:297: -1- m4_pattern_allow([^OPENSSL_INCLUDES$]) m4trace:configure.ac:297: -1- AC_SUBST([OPENSSL_LIBS]) m4trace:configure.ac:297: -1- AC_SUBST_TRACE([OPENSSL_LIBS]) m4trace:configure.ac:297: -1- m4_pattern_allow([^OPENSSL_LIBS$]) m4trace:configure.ac:297: -1- AC_SUBST([OPENSSL_LDFLAGS]) m4trace:configure.ac:297: -1- AC_SUBST_TRACE([OPENSSL_LDFLAGS]) m4trace:configure.ac:297: -1- m4_pattern_allow([^OPENSSL_LDFLAGS$]) m4trace:configure.ac:301: -1- AC_DEFINE_TRACE_LITERAL([HAVE___BUILTIN_CLZ]) m4trace:configure.ac:301: -1- m4_pattern_allow([^HAVE___BUILTIN_CLZ$]) m4trace:configure.ac:301: -1- AH_OUTPUT([HAVE___BUILTIN_CLZ], [/* Define to 1 if the system has the `__builtin_clz\' built-in function */ @%:@undef HAVE___BUILTIN_CLZ]) m4trace:configure.ac:308: -1- AC_SUBST([ax_pthread_config]) m4trace:configure.ac:308: -1- AC_SUBST_TRACE([ax_pthread_config]) m4trace:configure.ac:308: -1- m4_pattern_allow([^ax_pthread_config$]) m4trace:configure.ac:308: -1- AC_DEFINE_TRACE_LITERAL([PTHREAD_CREATE_JOINABLE]) m4trace:configure.ac:308: -1- m4_pattern_allow([^PTHREAD_CREATE_JOINABLE$]) m4trace:configure.ac:308: -1- AH_OUTPUT([PTHREAD_CREATE_JOINABLE], [/* Define to necessary symbol if this constant uses a non-standard name on your system. */ @%:@undef PTHREAD_CREATE_JOINABLE]) m4trace:configure.ac:308: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PTHREAD_PRIO_INHERIT]) m4trace:configure.ac:308: -1- m4_pattern_allow([^HAVE_PTHREAD_PRIO_INHERIT$]) m4trace:configure.ac:308: -1- AH_OUTPUT([HAVE_PTHREAD_PRIO_INHERIT], [/* Have PTHREAD_PRIO_INHERIT. */ @%:@undef HAVE_PTHREAD_PRIO_INHERIT]) m4trace:configure.ac:308: -1- AC_SUBST([PTHREAD_CC]) m4trace:configure.ac:308: -1- AC_SUBST_TRACE([PTHREAD_CC]) m4trace:configure.ac:308: -1- m4_pattern_allow([^PTHREAD_CC$]) m4trace:configure.ac:308: -1- AC_SUBST([PTHREAD_LIBS]) m4trace:configure.ac:308: -1- AC_SUBST_TRACE([PTHREAD_LIBS]) m4trace:configure.ac:308: -1- m4_pattern_allow([^PTHREAD_LIBS$]) m4trace:configure.ac:308: -1- AC_SUBST([PTHREAD_CFLAGS]) m4trace:configure.ac:308: -1- AC_SUBST_TRACE([PTHREAD_CFLAGS]) m4trace:configure.ac:308: -1- m4_pattern_allow([^PTHREAD_CFLAGS$]) m4trace:configure.ac:308: -1- AC_SUBST([PTHREAD_CC]) m4trace:configure.ac:308: -1- AC_SUBST_TRACE([PTHREAD_CC]) m4trace:configure.ac:308: -1- m4_pattern_allow([^PTHREAD_CC$]) m4trace:configure.ac:308: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PTHREAD]) m4trace:configure.ac:308: -1- m4_pattern_allow([^HAVE_PTHREAD$]) m4trace:configure.ac:308: -1- AH_OUTPUT([HAVE_PTHREAD], [/* Define to 1 if you have pthread */ @%:@undef HAVE_PTHREAD]) m4trace:configure.ac:312: -1- AC_CONFIG_FILES([ Makefile scamper/Makefile utils/Makefile utils/sc_ally/Makefile utils/sc_analysis_dump/Makefile utils/sc_attach/Makefile utils/sc_bdrmap/Makefile utils/sc_filterpolicy/Makefile utils/sc_ipiddump/Makefile utils/sc_prefixscan/Makefile utils/sc_radargun/Makefile utils/sc_remoted/Makefile utils/sc_speedtrap/Makefile utils/sc_tbitblind/Makefile utils/sc_tracediff/Makefile ]) m4trace:configure.ac:331: -1- AC_CONFIG_FILES([ utils/sc_uptime/Makefile ]) m4trace:configure.ac:336: -1- AC_CONFIG_FILES([ utils/sc_warts2csv/Makefile utils/sc_warts2json/Makefile utils/sc_warts2pcap/Makefile utils/sc_warts2text/Makefile utils/sc_wartscat/Makefile utils/sc_wartsdump/Makefile utils/sc_wartsfix/Makefile ]) m4trace:configure.ac:346: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) m4trace:configure.ac:346: -1- m4_pattern_allow([^LIB@&t@OBJS$]) m4trace:configure.ac:346: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([LTLIBOBJS]) m4trace:configure.ac:346: -1- m4_pattern_allow([^LTLIBOBJS$]) m4trace:configure.ac:346: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) m4trace:configure.ac:346: -1- AC_SUBST([am__EXEEXT_TRUE]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) m4trace:configure.ac:346: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) m4trace:configure.ac:346: -1- AC_SUBST([am__EXEEXT_FALSE]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) m4trace:configure.ac:346: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) m4trace:configure.ac:346: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) m4trace:configure.ac:346: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([top_builddir]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([top_build_prefix]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([srcdir]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([abs_srcdir]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([top_srcdir]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([abs_top_srcdir]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([builddir]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([abs_builddir]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([abs_top_builddir]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([INSTALL]) m4trace:configure.ac:346: -1- AC_SUBST_TRACE([MKDIR_P]) m4trace:configure.ac:346: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) scamper-cvs-20171204/m4/ax_check_openssl.m4000644 001751 000000 00000010135 13211200025 020167 0ustar00mjlwheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) # # DESCRIPTION # # Look for OpenSSL in a number of default spots, or in a user-selected # spot (via --with-openssl). Sets # # OPENSSL_INCLUDES to the include directives required # OPENSSL_LIBS to the -l directives required # OPENSSL_LDFLAGS to the -L or -R flags required # # and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately # # This macro sets OPENSSL_INCLUDES such that source files should use the # openssl/ directory in include directives: # # #include # # LICENSE # # Copyright (c) 2009,2010 Zmanda Inc. # Copyright (c) 2009,2010 Dustin J. Mitchell # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 10 AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) AC_DEFUN([AX_CHECK_OPENSSL], [ found=false AC_ARG_WITH([openssl], [AS_HELP_STRING([--with-openssl=DIR], [root of the OpenSSL directory])], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([Invalid --with-openssl value]) ;; *) ssldirs="$withval" ;; esac ], [ # if pkg-config is installed and openssl has installed a .pc file, # then use that information and don't search ssldirs AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) if test x"$PKG_CONFIG" != x""; then OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` if test $? = 0; then OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` found=true fi fi # no such luck; use some default ssldirs if ! $found; then ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" fi ] ) # note that we #include , so the OpenSSL headers have to be in # an 'openssl' subdirectory if ! $found; then OPENSSL_INCLUDES= for ssldir in $ssldirs; do AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) if test -f "$ssldir/include/openssl/ssl.h"; then OPENSSL_INCLUDES="-I$ssldir/include" OPENSSL_LDFLAGS="-L$ssldir/lib" OPENSSL_LIBS="-lssl -lcrypto" found=true AC_MSG_RESULT([yes]) break else AC_MSG_RESULT([no]) fi done # if the file wasn't found, well, go ahead and try the link anyway -- maybe # it will just work! fi # try the preprocessor and linker with our new flags, # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD save_LIBS="$LIBS" save_LDFLAGS="$LDFLAGS" save_CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" LIBS="$OPENSSL_LIBS $LIBS" CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" AC_LINK_IFELSE( [AC_LANG_PROGRAM([#include ], [SSL_new(NULL)])], [ AC_MSG_RESULT([yes]) $1 ], [ AC_MSG_RESULT([no]) $2 ]) CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" AC_SUBST([OPENSSL_INCLUDES]) AC_SUBST([OPENSSL_LIBS]) AC_SUBST([OPENSSL_LDFLAGS]) ]) scamper-cvs-20171204/m4/ax_gcc_builtin.m4000644 001751 000000 00000013346 13211200026 017641 0ustar00mjlwheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_gcc_builtin.html # =========================================================================== # # SYNOPSIS # # AX_GCC_BUILTIN(BUILTIN) # # DESCRIPTION # # This macro checks if the compiler supports one of GCC's built-in # functions; many other compilers also provide those same built-ins. # # The BUILTIN parameter is the name of the built-in function. # # If BUILTIN is supported define HAVE_. Keep in mind that since # builtins usually start with two underscores they will be copied over # into the HAVE_ definition (e.g. HAVE___BUILTIN_EXPECT for # __builtin_expect()). # # The macro caches its result in the ax_cv_have_ variable (e.g. # ax_cv_have___builtin_expect). # # The macro currently supports the following built-in functions: # # __builtin_assume_aligned # __builtin_bswap16 # __builtin_bswap32 # __builtin_bswap64 # __builtin_choose_expr # __builtin___clear_cache # __builtin_clrsb # __builtin_clrsbl # __builtin_clrsbll # __builtin_clz # __builtin_clzl # __builtin_clzll # __builtin_complex # __builtin_constant_p # __builtin_ctz # __builtin_ctzl # __builtin_ctzll # __builtin_expect # __builtin_ffs # __builtin_ffsl # __builtin_ffsll # __builtin_fpclassify # __builtin_huge_val # __builtin_huge_valf # __builtin_huge_vall # __builtin_inf # __builtin_infd128 # __builtin_infd32 # __builtin_infd64 # __builtin_inff # __builtin_infl # __builtin_isinf_sign # __builtin_nan # __builtin_nand128 # __builtin_nand32 # __builtin_nand64 # __builtin_nanf # __builtin_nanl # __builtin_nans # __builtin_nansf # __builtin_nansl # __builtin_object_size # __builtin_parity # __builtin_parityl # __builtin_parityll # __builtin_popcount # __builtin_popcountl # __builtin_popcountll # __builtin_powi # __builtin_powif # __builtin_powil # __builtin_prefetch # __builtin_trap # __builtin_types_compatible_p # __builtin_unreachable # # Unsupported built-ins will be tested with an empty parameter set and the # result of the check might be wrong or meaningless so use with care. # # LICENSE # # Copyright (c) 2013 Gabriele Svelto # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 6 AC_DEFUN([AX_GCC_BUILTIN], [ AS_VAR_PUSHDEF([ac_var], [ax_cv_have_$1]) AC_CACHE_CHECK([for $1], [ac_var], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [ m4_case([$1], [__builtin_assume_aligned], [$1("", 0)], [__builtin_bswap16], [$1(0)], [__builtin_bswap32], [$1(0)], [__builtin_bswap64], [$1(0)], [__builtin_choose_expr], [$1(0, 0, 0)], [__builtin___clear_cache], [$1("", "")], [__builtin_clrsb], [$1(0)], [__builtin_clrsbl], [$1(0)], [__builtin_clrsbll], [$1(0)], [__builtin_clz], [$1(0)], [__builtin_clzl], [$1(0)], [__builtin_clzll], [$1(0)], [__builtin_complex], [$1(0.0, 0.0)], [__builtin_constant_p], [$1(0)], [__builtin_ctz], [$1(0)], [__builtin_ctzl], [$1(0)], [__builtin_ctzll], [$1(0)], [__builtin_expect], [$1(0, 0)], [__builtin_ffs], [$1(0)], [__builtin_ffsl], [$1(0)], [__builtin_ffsll], [$1(0)], [__builtin_fpclassify], [$1(0, 1, 2, 3, 4, 0.0)], [__builtin_huge_val], [$1()], [__builtin_huge_valf], [$1()], [__builtin_huge_vall], [$1()], [__builtin_inf], [$1()], [__builtin_infd128], [$1()], [__builtin_infd32], [$1()], [__builtin_infd64], [$1()], [__builtin_inff], [$1()], [__builtin_infl], [$1()], [__builtin_isinf_sign], [$1(0.0)], [__builtin_nan], [$1("")], [__builtin_nand128], [$1("")], [__builtin_nand32], [$1("")], [__builtin_nand64], [$1("")], [__builtin_nanf], [$1("")], [__builtin_nanl], [$1("")], [__builtin_nans], [$1("")], [__builtin_nansf], [$1("")], [__builtin_nansl], [$1("")], [__builtin_object_size], [$1("", 0)], [__builtin_parity], [$1(0)], [__builtin_parityl], [$1(0)], [__builtin_parityll], [$1(0)], [__builtin_popcount], [$1(0)], [__builtin_popcountl], [$1(0)], [__builtin_popcountll], [$1(0)], [__builtin_powi], [$1(0, 0)], [__builtin_powif], [$1(0, 0)], [__builtin_powil], [$1(0, 0)], [__builtin_prefetch], [$1("")], [__builtin_trap], [$1()], [__builtin_types_compatible_p], [$1(int, int)], [__builtin_unreachable], [$1()], [m4_warn([syntax], [Unsupported built-in $1, the test may fail]) $1()] ) ])], [AS_VAR_SET([ac_var], [yes])], [AS_VAR_SET([ac_var], [no])]) ]) AS_IF([test yes = AS_VAR_GET([ac_var])], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1, [Define to 1 if the system has the `$1' built-in function])], []) AS_VAR_POPDEF([ac_var]) ]) scamper-cvs-20171204/m4/ax_pthread.m4000644 001751 000000 00000050522 13211200027 017004 0ustar00mjlwheel000000 000000 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS # # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro figures out how to build C programs using POSIX threads. It # sets the PTHREAD_LIBS output variable to the threads library and linker # flags, and the PTHREAD_CFLAGS output variable to any special C compiler # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # # Also sets PTHREAD_CC to any special C compiler that is needed for # multi-threaded programs (defaults to the value of CC otherwise). (This # is necessary on AIX to use the special cc_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, # but also to link with them as well. For example, you might link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threaded programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to # that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the # PTHREAD_PRIO_INHERIT symbol is defined when compiling with # PTHREAD_CFLAGS. # # ACTION-IF-FOUND is a list of shell commands to run if a threads library # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is not found. If ACTION-IF-FOUND is not specified, the default action # will define HAVE_PTHREAD. # # Please let the authors know if this macro fails on any platform, or if # you have any other suggestions or comments. This macro was based on work # by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help # from M. Frigo), as well as ac_pthread and hb_pthread macros posted by # Alejandro Forero Cuervo to the autoconf macro repository. We are also # grateful for the helpful feedback of numerous users. # # Updated for Autoconf 2.68 by Daniel Richard G. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2011 Daniel Richard G. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 24 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_SED]) AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then ax_pthread_save_CC="$CC" ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) AC_MSG_RESULT([$ax_pthread_ok]) if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi CC="$ax_pthread_save_CC" CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 # (Note: HP C rejects this with "bad form for `-t' option") # -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads and # -D_REENTRANT too), HP C (must be checked before -lpthread, which # is present but should not be used directly; and before -mthreads, # because the compiler interprets this as "-mt" + "-hreads") # -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case $host_os in freebsd*) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) ax_pthread_flags="-kthread lthread $ax_pthread_flags" ;; hpux*) # From the cc(1) man page: "[-mt] Sets various -D flags to enable # multi-threading and also sets -lpthread." ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" ;; openedition*) # IBM z/OS requires a feature-test macro to be defined in order to # enable POSIX threads at all, so give the user a hint if this is # not set. (We don't define these ourselves, as they can affect # other portions of the system API in unpredictable ways.) AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], [ # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) AX_PTHREAD_ZOS_MISSING # endif ], [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) ;; solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (N.B.: The stubs are missing # pthread_cleanup_push, or rather a function called by this macro, # so we could check for that, but who knows whether they'll stub # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" ;; esac # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) AS_IF([test "x$GCC" = "xyes"], [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"]) # The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled case $host_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; aix*) ax_pthread_check_macro="_THREAD_SAFE" ;; *) ax_pthread_check_macro="--" ;; esac AS_IF([test "x$ax_pthread_check_macro" = "x--"], [ax_pthread_check_cond=0], [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) # Are we compiling with Clang? AC_CACHE_CHECK([whether $CC is Clang], [ax_cv_PTHREAD_CLANG], [ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ # if defined(__clang__) && defined(__llvm__) AX_PTHREAD_CC_IS_CLANG # endif ], [ax_cv_PTHREAD_CLANG=yes]) fi ]) ax_pthread_clang="$ax_cv_PTHREAD_CLANG" ax_pthread_clang_warning=no # Clang needs special handling, because older versions handle the -pthread # option in a rather... idiosyncratic way if test "x$ax_pthread_clang" = "xyes"; then # Clang takes -pthread; it has never supported any other flag # (Note 1: This will need to be revisited if a system that Clang # supports has POSIX threads in a separate library. This tends not # to be the way of modern systems, but it's conceivable.) # (Note 2: On some systems, notably Darwin, -pthread is not needed # to get POSIX threads support; the API is always present and # active. We could reasonably leave PTHREAD_CFLAGS empty. But # -pthread does define _REENTRANT, and while the Darwin headers # ignore this macro, third-party headers might not.) PTHREAD_CFLAGS="-pthread" PTHREAD_LIBS= ax_pthread_ok=yes # However, older versions of Clang make a point of warning the user # that, in an invocation where only linking and no compilation is # taking place, the -pthread option has no effect ("argument unused # during compilation"). They expect -pthread to be passed in only # when source code is being compiled. # # Problem is, this is at odds with the way Automake and most other # C build frameworks function, which is that the same flags used in # compilation (CFLAGS) are also used in linking. Many systems # supported by AX_PTHREAD require exactly this for POSIX threads # support, and in fact it is often not straightforward to specify a # flag that is used only in the compilation phase and not in # linking. Such a scenario is extremely rare in practice. # # Even though use of the -pthread flag in linking would only print # a warning, this can be a nuisance for well-run software projects # that build with -Werror. So if the active version of Clang has # this misfeature, we search for an option to squash it. AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second # step ax_pthread_save_ac_link="$ac_link" ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" ac_link="$ax_pthread_save_ac_link" AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], [ac_link="$ax_pthread_2step_ac_link" AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], [break]) ]) done ac_link="$ax_pthread_save_ac_link" CFLAGS="$ax_pthread_save_CFLAGS" AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" ]) case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in no | unknown) ;; *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; esac fi # $ax_pthread_clang = yes if test "x$ax_pthread_ok" = "xno"; then for ax_pthread_try_flag in $ax_pthread_flags; do case $ax_pthread_try_flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -mt,pthread) AC_MSG_CHECKING([whether pthreads work with -mt -lpthread]) PTHREAD_CFLAGS="-mt" PTHREAD_LIBS="-lpthread" ;; -*) AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_LINK_IFELSE([AC_LANG_PROGRAM([#include # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif static void routine(void *a) { a = 0; } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */])], [ax_pthread_ok=yes], []) CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" AC_MSG_RESULT([$ax_pthread_ok]) AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = "xyes"; then ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_CACHE_CHECK([for joinable pthread attribute], [ax_cv_PTHREAD_JOINABLE_ATTR], [ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [int attr = $ax_pthread_attr; return attr /* ; */])], [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], []) done ]) AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ test "x$ax_pthread_joinable_attr_defined" != "xyes"], [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$ax_cv_PTHREAD_JOINABLE_ATTR], [Define to necessary symbol if this constant uses a non-standard name on your system.]) ax_pthread_joinable_attr_defined=yes ]) AC_CACHE_CHECK([whether more special flags are required for pthreads], [ax_cv_PTHREAD_SPECIAL_FLAGS], [ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac ]) AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ test "x$ax_pthread_special_flags_added" != "xyes"], [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" ax_pthread_special_flags_added=yes]) AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], [ax_cv_PTHREAD_PRIO_INHERIT], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int i = PTHREAD_PRIO_INHERIT;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ test "x$ax_pthread_prio_inherit_defined" != "xyes"], [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) ax_pthread_prio_inherit_defined=yes ]) CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then case $host_os in aix*) AS_CASE(["x/$CC"], [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], [#handle absolute path differently from PATH based program lookup AS_CASE(["x$CC"], [x/*], [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CC]) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) : else ax_pthread_ok=no $2 fi AC_LANG_POP ])dnl AX_PTHREAD scamper-cvs-20171204/m4/libtool.m4000644 001751 000000 00001125073 13211200046 016337 0ustar00mjlwheel000000 000000 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. 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 what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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 no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [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 # that 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 # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS scamper-cvs-20171204/m4/ltoptions.m4000644 001751 000000 00000034262 13211200047 016725 0ustar00mjlwheel000000 000000 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) scamper-cvs-20171204/m4/ltsugar.m4000644 001751 000000 00000010440 13211200047 016343 0ustar00mjlwheel000000 000000 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) scamper-cvs-20171204/m4/ltversion.m4000644 001751 000000 00000001273 13211200047 016713 0ustar00mjlwheel000000 000000 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) scamper-cvs-20171204/m4/lt~obsolete.m4000644 001751 000000 00000013774 13211200047 017251 0ustar00mjlwheel000000 000000 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) scamper-cvs-20171204/utils/.cvsignore000644 001751 000000 00000000025 11525045574 017260 0ustar00mjlwheel000000 000000 Makefile Makefile.in scamper-cvs-20171204/utils/Makefile.am000644 001751 000000 00000000604 13126106607 017311 0ustar00mjlwheel000000 000000 SUBDIRS = \ sc_ally \ sc_analysis_dump \ sc_attach \ sc_bdrmap \ sc_filterpolicy \ sc_ipiddump \ sc_prefixscan \ sc_radargun \ sc_remoted \ sc_speedtrap \ sc_tbitblind \ sc_tracediff if WITH_SC_UPTIME SUBDIRS+= sc_uptime endif SUBDIRS+= \ sc_warts2csv \ sc_warts2json \ sc_warts2pcap \ sc_warts2text \ sc_wartscat \ sc_wartsdump \ sc_wartsfix CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_ally/000755 001751 000000 00000000000 13211200553 016671 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_analysis_dump/000755 001751 000000 00000000000 13211200553 020600 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_attach/000755 001751 000000 00000000000 13211200553 017174 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_bdrmap/000755 001751 000000 00000000000 13211200553 017175 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_filterpolicy/000755 001751 000000 00000000000 13211200553 020435 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_ipiddump/000755 001751 000000 00000000000 13211200553 017543 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_prefixscan/000755 001751 000000 00000000000 13211200553 020072 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_radargun/000755 001751 000000 00000000000 13211200553 017533 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_remoted/000755 001751 000000 00000000000 13211200554 017370 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_speedtrap/000755 001751 000000 00000000000 13211200554 017720 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_tbitblind/000755 001751 000000 00000000000 13211200554 017704 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_tracediff/000755 001751 000000 00000000000 13211200554 017660 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_uptime/000755 001751 000000 00000000000 13211200554 017234 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_warts2csv/000755 001751 000000 00000000000 13211200554 017667 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_warts2json/000755 001751 000000 00000000000 13211200554 020045 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_warts2pcap/000755 001751 000000 00000000000 13211200554 020017 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_warts2text/000755 001751 000000 00000000000 13211200554 020060 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_wartscat/000755 001751 000000 00000000000 13211200554 017561 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_wartsdump/000755 001751 000000 00000000000 13211200554 017757 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/sc_wartsfix/000755 001751 000000 00000000000 13211200554 017600 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/utils/Makefile.in000644 001751 000000 00000045504 13211200061 017312 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WITH_SC_UPTIME_TRUE@am__append_1 = sc_uptime subdir = utils ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = sc_ally sc_analysis_dump sc_attach sc_bdrmap \ sc_filterpolicy sc_ipiddump sc_prefixscan sc_radargun \ sc_remoted sc_speedtrap sc_tbitblind sc_tracediff sc_uptime \ sc_warts2csv sc_warts2json sc_warts2pcap sc_warts2text \ sc_wartscat sc_wartsdump sc_wartsfix am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = sc_ally sc_analysis_dump sc_attach sc_bdrmap sc_filterpolicy \ sc_ipiddump sc_prefixscan sc_radargun sc_remoted sc_speedtrap \ sc_tbitblind sc_tracediff $(am__append_1) sc_warts2csv \ sc_warts2json sc_warts2pcap sc_warts2text sc_wartscat \ sc_wartsdump sc_wartsfix CLEANFILES = *~ *.core all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_wartsfix/.cvsignore000644 001751 000000 00000000055 11525063774 021621 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_wartsfix scamper-cvs-20171204/utils/sc_wartsfix/Makefile.am000644 001751 000000 00000000300 12177530303 021635 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_wartsfix sc_wartsfix_SOURCES = sc_wartsfix.c ../../utils.c CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_wartsfix/sc_wartsfix.c000644 001751 000000 00000006066 11723016767 022331 0ustar00mjlwheel000000 000000 /* * warts-fix * * $Id: sc_wartsfix.c,v 1.10 2012/02/28 00:21:11 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2007-2010 The University of Waikato * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_wartsfix.c,v 1.10 2012/02/28 00:21:11 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "utils.h" int main(int argc, char *argv[]) { struct stat sb; mode_t mode; uint16_t u16; uint32_t u32; uint8_t hdr[8]; uint8_t *tmp; char *fixname = NULL; ssize_t rc; size_t len; int in, out; off_t off = 0; char offs[16]; if(argc != 2) { goto err; } len = strlen(argv[1]); len += 5; if((fixname = malloc(len)) == NULL) { goto err; } snprintf(fixname, len, "%s.fix", argv[1]); /* open the file to be repaired. get file properties. */ if((in = open(argv[1], O_RDONLY)) < 0) { goto err; } fstat(in, &sb); mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); /* * open the file that will hold the recovered data. set it to be * identical in mode and owner to the file that is being repaired */ if((out = open(fixname, O_WRONLY | O_TRUNC | O_CREAT | O_EXCL, mode)) < 0) { goto err; } free(fixname); fixname = NULL; if(fchown(out, sb.st_uid, sb.st_gid) != 0) fprintf(stderr, "warning: could not chown: %s\n", strerror(errno)); for(;;) { /* read header in */ rc = read(in, hdr, 8); if(rc == 0) { fprintf(stderr, "%s is intact\n", argv[1]); break; } if(rc < 0 || rc != 8) { break; } /* check magic field */ memcpy(&u16, hdr, 2); u16 = ntohs(u16); if(u16 != 0x1205) { break; } /* figure out how much to read */ memcpy(&u32, hdr+4, 4); u32 = ntohl(u32); if(u32 > 0) { len = u32 + 8; if((tmp = malloc(len)) == NULL) { goto err; } memcpy(tmp, hdr, 8); rc = read(in, tmp+8, u32); if(rc != u32) break; } else { len = 8; tmp = hdr; } /* write record out */ rc = write(out, tmp, len); if(rc != len) { perror("could not write"); if(ftruncate(out, off) != 0) perror("could not truncate"); break; } off += len; if(len > 8) free(tmp); } fprintf(stderr, "stop at %s\n", offt_tostr(offs, sizeof(offs), off, 0, 'd')); return 0; err: if(fixname != NULL) free(fixname); return -1; } scamper-cvs-20171204/utils/sc_wartsfix/Makefile.in000644 001751 000000 00000050054 13211200067 021650 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_wartsfix$(EXEEXT) subdir = utils/sc_wartsfix ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_wartsfix_OBJECTS = sc_wartsfix.$(OBJEXT) ../../utils.$(OBJEXT) sc_wartsfix_OBJECTS = $(am_sc_wartsfix_OBJECTS) sc_wartsfix_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_wartsfix_SOURCES) DIST_SOURCES = $(sc_wartsfix_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_wartsfix_SOURCES = sc_wartsfix.c ../../utils.c CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_wartsfix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_wartsfix/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_wartsfix$(EXEEXT): $(sc_wartsfix_OBJECTS) $(sc_wartsfix_DEPENDENCIES) $(EXTRA_sc_wartsfix_DEPENDENCIES) @rm -f sc_wartsfix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_wartsfix_OBJECTS) $(sc_wartsfix_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_wartsfix.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_wartsdump/.cvsignore000644 001751 000000 00000000056 11525063774 022001 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_wartsdump scamper-cvs-20171204/utils/sc_wartsdump/Makefile.am000644 001751 000000 00000000343 12055003625 022020 0ustar00mjlwheel000000 000000 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_wartsdump sc_wartsdump_SOURCES = sc_wartsdump.c sc_wartsdump_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_wartsdump.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_wartsdump/sc_wartsdump.1000644 001751 000000 00000002573 12577420003 022572 0ustar00mjlwheel000000 000000 .\" .\" sc_wartsdump.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2010 University of Waikato .\" All rights reserved .\" .\" $Id: sc_wartsdump.1,v 1.3 2015/09/20 02:54:59 mjl Exp $ .\" .\" nroff -man sc_wartsdump.1 .\" groff -man -Tascii sc_wartsdump.1 | man2html -title sc_wartsdump.1 .\" .Dd October 15, 2010 .Dt SC_WARTSDUMP 1 .Os .Sh NAME .Nm sc_wartsdump .Nd verbose dump of information contained in a warts file. .Sh SYNOPSIS .Nm .Op Ar .Sh DESCRIPTION The .Nm provides a verbose dump of information contained in a sequence of warts files. While the output is structured and suitable for initial analyses of results, the format of the output is not suitable for automated parsing and analysis as the output of .Nm will change overtime with no regard to backwards compatibility. Analyses of the contents of a warts file should be made using specialised programs which link against the scamper file API. .Sh EXAMPLES The command: .Pp .in +.3i sc_wartsdump file1.warts file2.warts .in -.3i .Pp will decode and print the contents of file1.warts, followed by the contents of file2.warts. .Pp The command: .Pp .in +.3i gzcat file1.warts.gz | sc_wartsdump .in -.3i .Pp will print the contents of the uncompressed file supplied on stdin. .Sh SEE ALSO .Xr scamper 1 , .Xr sc_warts2text 1 .Sh AUTHORS .Nm was written by Matthew Luckie . scamper-cvs-20171204/utils/sc_wartsdump/sc_wartsdump.c000644 001751 000000 00000146155 13146642621 022666 0ustar00mjlwheel000000 000000 /* * sc_wartsdump * * $Id: sc_wartsdump.c,v 1.215 2017/08/21 20:41:53 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2015 The Regents of the University of California * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_wartsdump.c,v 1.215 2017/08/21 20:41:53 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "trace/scamper_trace.h" #include "ping/scamper_ping.h" #include "tracelb/scamper_tracelb.h" #include "dealias/scamper_dealias.h" #include "neighbourdisc/scamper_neighbourdisc.h" #include "tbit/scamper_tbit.h" #include "sting/scamper_sting.h" #include "sniff/scamper_sniff.h" #include "scamper_file.h" #include "utils.h" static void usage() { fprintf(stderr, "usage: warts-dump \n"); return; } static char *icmp_unreach_tostr(char *buf, size_t len, int at, uint8_t co) { char *p = NULL; if(at == SCAMPER_ADDR_TYPE_IPV4) { switch(co) { case ICMP_UNREACH_NET: p = "net"; break; case ICMP_UNREACH_HOST: p = "host"; break; case ICMP_UNREACH_PROTOCOL: p = "protocol"; break; case ICMP_UNREACH_PORT: p = "port"; break; case ICMP_UNREACH_SRCFAIL: p = "src-rt failed"; break; case ICMP_UNREACH_NET_UNKNOWN: p = "net unknown"; break; case ICMP_UNREACH_HOST_UNKNOWN: p = "host unknown"; break; case ICMP_UNREACH_ISOLATED: p = "isolated"; break; case ICMP_UNREACH_NET_PROHIB: p = "net prohib"; break; case ICMP_UNREACH_HOST_PROHIB: p = "host prohib"; break; case ICMP_UNREACH_TOSNET: p = "tos net"; break; case ICMP_UNREACH_TOSHOST: p = "tos host"; break; case ICMP_UNREACH_FILTER_PROHIB: p = "admin prohib"; break; case ICMP_UNREACH_NEEDFRAG: p = "need frag"; break; } } else { switch(co) { case ICMP6_DST_UNREACH_NOROUTE: p = "no route"; break; case ICMP6_DST_UNREACH_ADMIN: p = "admin prohib"; break; case ICMP6_DST_UNREACH_BEYONDSCOPE: p = "beyond scope"; break; case ICMP6_DST_UNREACH_ADDR: p = "addr"; break; case ICMP6_DST_UNREACH_NOPORT: p = "port"; break; } } if(p != NULL) snprintf(buf, len, "%s", p); else snprintf(buf, len, "%d", co); return buf; } static void dump_list_summary(scamper_list_t *list) { if(list != NULL) { printf(" list id: %d", list->id); if(list->name != NULL) printf(", name: %s", list->name); if(list->monitor != NULL) printf(", monitor: %s", list->monitor); printf("\n"); } return; } static void dump_cycle_summary(scamper_cycle_t *cycle) { if(cycle != NULL) printf(" cycle id: %d\n", cycle->id); return; } static void dump_tcp_flags(uint8_t flags) { if(flags != 0) { printf(" (%s%s%s%s%s%s%s%s )", (flags & 0x01) ? " fin" : "", (flags & 0x02) ? " syn" : "", (flags & 0x04) ? " rst" : "", (flags & 0x08) ? " psh" : "", (flags & 0x10) ? " ack" : "", (flags & 0x20) ? " urg" : "", (flags & 0x40) ? " ece" : "", (flags & 0x80) ? " cwr" : ""); } return; } static void dump_timeval(const char *label, struct timeval *start) { time_t tt = start->tv_sec; char buf[32]; memcpy(buf, ctime(&tt), 24); buf[24] = '\0'; printf(" %s: %s %06d\n", label, buf, (int)start->tv_usec); return; } static void dump_trace_hop(const scamper_trace_t *trace, scamper_trace_hop_t *hop) { struct timeval tv; scamper_icmpext_t *ie; uint32_t u32; char addr[256]; int i; printf("hop %2d %s\n", hop->hop_probe_ttl, scamper_addr_tostr(hop->hop_addr, addr, sizeof(addr))); printf(" attempt: %d", hop->hop_probe_id); if(hop->hop_tx.tv_sec != 0) { timeval_diff_tv(&tv, &trace->start, &hop->hop_tx); printf(", tx: %d.%06ds", (int)tv.tv_sec, (int)tv.tv_usec); } printf(", rtt: %d.%06ds, probe-size: %d\n", (int)hop->hop_rtt.tv_sec, (int)hop->hop_rtt.tv_usec, hop->hop_probe_size); printf(" reply-size: %d", hop->hop_reply_size); if(hop->hop_flags & SCAMPER_TRACE_HOP_FLAG_REPLY_TTL) printf(", reply-ttl: %d", hop->hop_reply_ttl); if(hop->hop_addr->type == SCAMPER_ADDR_TYPE_IPV4) printf(", reply-ipid: 0x%04x, reply-tos 0x%02x", hop->hop_reply_ipid, hop->hop_reply_tos); printf("\n"); if(SCAMPER_TRACE_HOP_IS_ICMP(hop)) { printf(" icmp-type: %d, icmp-code: %d", hop->hop_icmp_type, hop->hop_icmp_code); if(SCAMPER_TRACE_HOP_IS_ICMP_Q(hop)) { printf(", q-ttl: %d, q-len: %d", hop->hop_icmp_q_ttl, hop->hop_icmp_q_ipl); if(hop->hop_addr->type == SCAMPER_ADDR_TYPE_IPV4) printf(", q-tos %d", hop->hop_icmp_q_tos); } if(SCAMPER_TRACE_HOP_IS_ICMP_PTB(hop)) printf(", nhmtu: %d", hop->hop_icmp_nhmtu); printf("\n"); } else if(SCAMPER_TRACE_HOP_IS_TCP(hop)) { printf(" tcp-flags: 0x%02x", hop->hop_tcp_flags); dump_tcp_flags(hop->hop_tcp_flags); printf("\n"); } printf(" flags: 0x%02x", hop->hop_flags); if(hop->hop_flags != 0) { printf(" ("); if(hop->hop_flags & SCAMPER_TRACE_HOP_FLAG_TS_SOCK_RX) printf(" sockrxts"); if(hop->hop_flags & SCAMPER_TRACE_HOP_FLAG_TS_DL_TX) printf(" dltxts"); if(hop->hop_flags & SCAMPER_TRACE_HOP_FLAG_TS_DL_RX) printf(" dlrxts"); if(hop->hop_flags & SCAMPER_TRACE_HOP_FLAG_TS_TSC) printf(" tscrtt"); if(hop->hop_flags & SCAMPER_TRACE_HOP_FLAG_REPLY_TTL) printf(" replyttl"); printf(" )"); } printf("\n"); for(ie = hop->hop_icmpext; ie != NULL; ie = ie->ie_next) { if(SCAMPER_ICMPEXT_IS_MPLS(ie)) { for(i=0; isrc != NULL) { scamper_addr_tostr(trace->src, buf, sizeof(buf)); printf("traceroute from %s to ", buf); scamper_addr_tostr(trace->dst, buf, sizeof(buf)); printf("%s\n", buf); } else { printf("traceroute to %s\n", scamper_addr_tostr(trace->dst, buf, sizeof(buf))); } dump_list_summary(trace->list); dump_cycle_summary(trace->cycle); printf(" user-id: %d\n", trace->userid); dump_timeval("start", &trace->start); printf(" type: "); switch(trace->type) { case SCAMPER_TRACE_TYPE_ICMP_ECHO: printf("icmp, echo id: %d", trace->sport); break; case SCAMPER_TRACE_TYPE_ICMP_ECHO_PARIS: /* * if the byte ordering of the trace->sport used in the icmp csum * is unknown -- that is, not known to be correct, print that detail */ printf("icmp paris, echo id: %d", trace->sport); if(SCAMPER_TRACE_IS_ICMPCSUMDP(trace)) printf(", csum: 0x%04x", trace->dport); break; case SCAMPER_TRACE_TYPE_UDP: printf("udp, sport: %d, base dport: %d", trace->sport, trace->dport); break; case SCAMPER_TRACE_TYPE_UDP_PARIS: printf("udp paris, sport: %d, dport: %d", trace->sport, trace->dport); break; case SCAMPER_TRACE_TYPE_TCP: printf("tcp, sport: %d, dport: %d", trace->sport, trace->dport); break; case SCAMPER_TRACE_TYPE_TCP_ACK: printf("tcp-ack, sport: %d, dport: %d", trace->sport, trace->dport); break; default: printf("%d", trace->type); break; } if(trace->offset != 0) printf(", offset %d", trace->offset); printf("\n"); if(trace->dtree != NULL) { printf(" doubletree firsthop: %d", trace->dtree->firsthop); if(trace->dtree->lss != NULL) printf(", lss-name: %s", trace->dtree->lss); if(trace->dtree->lss_stop != NULL) printf(", lss-stop: %s", scamper_addr_tostr(trace->dtree->lss_stop, buf, sizeof(buf))); if(trace->dtree->gss_stop != NULL) printf(", gss-stop: %s", scamper_addr_tostr(trace->dtree->gss_stop, buf, sizeof(buf))); printf("\n"); } printf(" attempts: %d, hoplimit: %d, loops: %d, probec: %d\n", trace->attempts, trace->hoplimit, trace->loops, trace->probec); printf(" gaplimit: %d, gapaction: ", trace->gaplimit); if(trace->gapaction == SCAMPER_TRACE_GAPACTION_STOP) printf("stop"); else if(trace->gapaction == SCAMPER_TRACE_GAPACTION_LASTDITCH) printf("lastditch"); else printf("0x%02x", trace->gapaction); printf("\n"); printf(" wait-timeout: %ds", trace->wait); if(trace->wait_probe != 0) printf(", wait-probe: %dms", trace->wait_probe * 10); if(trace->confidence != 0) printf(", confidence: %d%%", trace->confidence); printf("\n"); printf(" flags: 0x%02x", trace->flags); if(trace->flags != 0) { printf(" ("); if(trace->flags & SCAMPER_TRACE_FLAG_ALLATTEMPTS) printf(" all-attempts"); if(trace->flags & SCAMPER_TRACE_FLAG_PMTUD) printf(" pmtud"); if(trace->flags & SCAMPER_TRACE_FLAG_DL) printf(" dl"); if(trace->flags & SCAMPER_TRACE_FLAG_IGNORETTLDST) printf(" ignorettldst"); if(trace->flags & SCAMPER_TRACE_FLAG_DOUBLETREE) printf(" doubletree"); if(trace->flags & SCAMPER_TRACE_FLAG_ICMPCSUMDP) printf(" icmp-csum-dport"); if(trace->flags & SCAMPER_TRACE_FLAG_CONSTPAYLOAD) printf(" const-payload"); printf(" )"); } printf("\n"); printf(" stop reason: "); switch(trace->stop_reason) { case SCAMPER_TRACE_STOP_NONE: printf("none"); break; case SCAMPER_TRACE_STOP_COMPLETED: printf("done"); break; case SCAMPER_TRACE_STOP_UNREACH: i = trace->dst->type; printf("icmp unreach %s", icmp_unreach_tostr(buf, sizeof(buf), i, trace->stop_data)); break; case SCAMPER_TRACE_STOP_ICMP: printf("icmp type %d", trace->stop_data); break; case SCAMPER_TRACE_STOP_LOOP: printf("loop"); break; case SCAMPER_TRACE_STOP_GAPLIMIT: printf("gaplimit"); break; case SCAMPER_TRACE_STOP_ERROR: printf("errno %d", trace->stop_data); break; case SCAMPER_TRACE_STOP_HOPLIMIT: printf("hoplimit"); break; case SCAMPER_TRACE_STOP_GSS: printf("dtree-gss"); break; case SCAMPER_TRACE_STOP_HALTED: printf("halted"); break; default: printf("reason 0x%02x data 0x%02x",trace->stop_reason,trace->stop_data); break; } printf("\n"); for(u16=0; u16hop_count; u16++) for(hop = trace->hops[u16]; hop != NULL; hop = hop->hop_next) dump_trace_hop(trace, hop); /* dump any last-ditch probing hops */ for(hop = trace->lastditch; hop != NULL; hop = hop->hop_next) dump_trace_hop(trace, hop); if((pmtud = trace->pmtud) != NULL) { printf("pmtud: ver %d ifmtu %d, pmtu %d", pmtud->ver, pmtud->ifmtu, pmtud->pmtu); if(pmtud->outmtu != 0) printf(", outmtu %d", pmtud->outmtu); if(pmtud->notec != 0) printf(", notec %d", pmtud->notec); printf("\n"); for(u8=0; u8notec; u8++) { n = pmtud->notes[u8]; hop = n->hop; printf(" note %d: nhmtu %d, ", u8, n->nhmtu); if(hop != NULL) scamper_addr_tostr(hop->hop_addr, buf, sizeof(buf)); else buf[0] = '\0'; if(n->type == SCAMPER_TRACE_PMTUD_N_TYPE_PTB) printf("ptb %s", buf); else if(n->type == SCAMPER_TRACE_PMTUD_N_TYPE_PTB_BAD && hop != NULL) printf("ptb-bad %s mtu %d", buf, hop->hop_icmp_nhmtu); else if(n->type == SCAMPER_TRACE_PMTUD_N_TYPE_SILENCE) printf("silence > ttl %d", hop != NULL ? hop->hop_probe_ttl : 0); else printf("type-%d", n->type); printf("\n"); } for(hop = trace->pmtud->hops; hop != NULL; hop = hop->hop_next) dump_trace_hop(trace, hop); } printf("\n"); scamper_trace_free(trace); return; } static void dump_tracelb_reply(scamper_tracelb_probe_t *probe, scamper_tracelb_reply_t *reply) { scamper_icmpext_t *ie; struct timeval rtt; char from[32]; uint32_t u32; uint16_t m; timeval_diff_tv(&rtt, &probe->tx, &reply->reply_rx); scamper_addr_tostr(reply->reply_from, from, sizeof(from)); printf(" reply from: %s, rtt: %d.%06d, ttl: %d", from, (int)rtt.tv_sec, (int)rtt.tv_usec, reply->reply_ttl); if(reply->reply_from->type == SCAMPER_ADDR_TYPE_IPV4) printf(", ipid: 0x%04x", reply->reply_ipid); printf("\n "); if(reply->reply_flags & SCAMPER_TRACELB_REPLY_FLAG_TCP) { printf("tcp flags 0x%02x", reply->reply_tcp_flags); dump_tcp_flags(reply->reply_tcp_flags); printf("\n"); } else { printf("icmp: %d/%d, q-tos: 0x%02x", reply->reply_icmp_type, reply->reply_icmp_code, reply->reply_icmp_q_tos); if(SCAMPER_TRACELB_REPLY_IS_ICMP_UNREACH(reply) || SCAMPER_TRACELB_REPLY_IS_ICMP_TTL_EXP(reply)) { printf(", q-ttl: %d", reply->reply_icmp_q_ttl); } printf("\n"); for(ie = reply->reply_icmp_ext; ie != NULL; ie = ie->ie_next) { if(SCAMPER_ICMPEXT_IS_MPLS(ie)) { for(m=0; mflowid, probe->ttl, probe->attempt, (int)probe->tx.tv_sec, (int)probe->tx.tv_usec); for(i=0; irxc; i++) { dump_tracelb_reply(probe, probe->rxs[i]); } return; } static void dump_tracelb(scamper_tracelb_t *trace) { scamper_tracelb_link_t *link; scamper_tracelb_node_t *node; scamper_tracelb_probeset_t *set; char src[256], dst[256]; uint16_t i, j, k, l; if(trace->src != NULL) { printf("tracelb from %s to %s\n", scamper_addr_tostr(trace->src, src, sizeof(src)), scamper_addr_tostr(trace->dst, dst, sizeof(dst))); } else { printf("tracelb to %s\n", scamper_addr_tostr(trace->dst, dst, sizeof(dst))); } dump_list_summary(trace->list); dump_cycle_summary(trace->cycle); printf(" user-id: %d\n", trace->userid); dump_timeval("start", &trace->start); printf(" type: "); switch(trace->type) { case SCAMPER_TRACELB_TYPE_ICMP_ECHO: printf("icmp-echo id: %d", trace->sport); break; case SCAMPER_TRACELB_TYPE_UDP_DPORT: printf("udp-dport %d:%d", trace->sport, trace->dport); break; case SCAMPER_TRACELB_TYPE_UDP_SPORT: printf("udp-sport %d:%d", trace->sport, trace->dport); break; case SCAMPER_TRACELB_TYPE_TCP_SPORT: printf("tcp-sport %d:%d", trace->sport, trace->dport); break; case SCAMPER_TRACELB_TYPE_TCP_ACK_SPORT: printf("tcp-ack-sport %d:%d", trace->sport, trace->dport); break; default: printf("%d", trace->type); break; } printf(", tos: 0x%02x\n", trace->tos); printf(" firsthop: %d, attempts: %d, confidence: %d\n", trace->firsthop, trace->attempts, trace->confidence); printf(" probe-size: %d, wait-probe: %dms, wait-timeout %ds\n", trace->probe_size, trace->wait_probe * 10, trace->wait_timeout); printf(" nodec: %d, linkc: %d, probec: %d, probec_max: %d\n", trace->nodec, trace->linkc, trace->probec, trace->probec_max); for(i=0; inodec; i++) { node = trace->nodes[i]; if(node->addr != NULL) scamper_addr_tostr(node->addr, src, sizeof(src)); else snprintf(src, sizeof(src), "*"); printf("node %d %s", i, src); if(SCAMPER_TRACELB_NODE_QTTL(node) != 0) printf(", qttl %d", node->q_ttl); printf("\n"); for(j=0; jlinkc; j++) { link = node->links[j]; if(link->from->addr != NULL) scamper_addr_tostr(link->from->addr, src, sizeof(src)); else snprintf(src, sizeof(src), "*"); if(link->to != NULL) scamper_addr_tostr(link->to->addr, dst, sizeof(dst)); else snprintf(dst, sizeof(dst), "*"); printf(" link %s -> %s hopc %d\n", src, dst, link->hopc); for(k=0; khopc; k++) { set = link->sets[k]; for(l=0; lprobec; l++) dump_tracelb_probe(trace, set->probes[l]); } } } printf("\n"); scamper_tracelb_free(trace); return; } static char *ping_tsreply_tostr(char *buf, size_t len, uint32_t val) { uint32_t hh, mm, ss, ms; ms = val % 1000; ss = val / 1000; hh = ss / 3600; ss -= (hh * 3600); mm = ss / 60; ss -= (mm * 60); snprintf(buf, len, "%02d:%02d:%02d.%03d", hh, mm, ss, ms); return buf; } static void dump_ping_reply(const scamper_ping_t *ping, const scamper_ping_reply_t *reply) { scamper_ping_reply_v4rr_t *v4rr; scamper_ping_reply_v4ts_t *v4ts; scamper_ping_reply_tsreply_t *tsreply; uint8_t i; char buf[256]; struct timeval txoff; printf("reply from %s, attempt: %d", scamper_addr_tostr(reply->addr, buf, sizeof(buf)), reply->probe_id+1); if(timeval_cmp(&reply->tx, &ping->start) >= 0) { timeval_diff_tv(&txoff, &ping->start, &reply->tx); printf(", tx: %d.%06ds", (int)txoff.tv_sec, (int)txoff.tv_usec); } printf(", rtt: %d.%06ds\n", (int)reply->rtt.tv_sec, (int)reply->rtt.tv_usec); printf(" size: %d", reply->reply_size); if(reply->flags & SCAMPER_PING_REPLY_FLAG_REPLY_TTL) printf(", ttl: %d", reply->reply_ttl); if(reply->flags & SCAMPER_PING_REPLY_FLAG_PROBE_IPID) printf(", probe-ipid: 0x%04x", reply->probe_ipid); if(reply->flags & SCAMPER_PING_REPLY_FLAG_REPLY_IPID) { if(SCAMPER_ADDR_TYPE_IS_IPV4(reply->addr)) printf(", reply-ipid: 0x%04x", reply->reply_ipid); else printf(", reply-ipid32: 0x%08x", reply->reply_ipid32); } printf("\n"); if(SCAMPER_PING_REPLY_IS_ICMP(reply)) { printf(" icmp type: %d, code: %d\n", reply->icmp_type, reply->icmp_code); } else if(SCAMPER_PING_REPLY_IS_TCP(reply)) { printf(" tcp flags: %02x", reply->tcp_flags); dump_tcp_flags(reply->tcp_flags); printf("\n"); } if((tsreply = reply->tsreply) != NULL) { printf(" icmp-tsreply:"); printf(" tso=%s", ping_tsreply_tostr(buf, sizeof(buf), tsreply->tso)); printf(" tsr=%s", ping_tsreply_tostr(buf, sizeof(buf), tsreply->tsr)); printf(" tst=%s\n", ping_tsreply_tostr(buf, sizeof(buf), tsreply->tst)); } if((v4rr = reply->v4rr) != NULL) { printf(" record route:"); for(i=0; irrc; i++) { if((i % 3) == 0 && i != 0) printf("\n "); printf(" %-15s", scamper_addr_tostr(v4rr->rr[i],buf,sizeof(buf))); } printf("\n"); } if((v4ts = reply->v4ts) != NULL) { printf(" IP timestamp option: tsc %d", v4ts->tsc); if(v4ts->ips != NULL) { for(i=0; itsc; i++) { if((i % 2) == 0) printf("\n "); else if(i != 0) printf(" "); printf("%-15s 0x%08x", scamper_addr_tostr(v4ts->ips[i], buf, sizeof(buf)), v4ts->tss[i]); } } else { for(i=0; itsc; i++) { if((i % 3) == 0) printf("\n "); printf(" 0x%08x", v4ts->tss[i]); } } printf("\n"); } return; } static void dump_ping(scamper_ping_t *ping) { static const char *flags[] = { "v4rr", "spoof", "payload", "tsonly", "tsandaddr", "icmpsum", "dl", "8" }; scamper_ping_reply_t *reply; char buf[256]; uint32_t u32; int i; scamper_addr_tostr(ping->src, buf, sizeof(buf)); printf("ping from %s", buf); if(ping->flags & SCAMPER_PING_FLAG_SPOOF) printf(" (spoofed)"); scamper_addr_tostr(ping->dst, buf, sizeof(buf)); printf(" to %s\n", buf); dump_list_summary(ping->list); dump_cycle_summary(ping->cycle); printf(" user-id: %d\n", ping->userid); dump_timeval("start", &ping->start); printf(" probe-count: %d", ping->probe_count); if(ping->reply_count > 0) printf(", replies-req: %d", ping->reply_count); printf(", size: %d", ping->probe_size); if(ping->reply_pmtu > 0) printf(", reply-pmtu: %d", ping->reply_pmtu); printf(", wait: %u", ping->probe_wait); if(ping->probe_wait_us > 0) { u32 = ping->probe_wait_us; while((u32 % 10) == 0) u32 /= 10; printf(".%u", u32); } printf(", timeout: %u, ttl: %u", ping->probe_timeout, ping->probe_ttl); printf("\n"); if(ping->flags != 0) { printf(" flags:"); u32 = 0; for(i=0; i<8; i++) { if((ping->flags & (0x1 << i)) == 0) continue; if(u32 > 0) printf(","); printf(" %s", flags[i]); u32++; } printf("\n"); } printf(" method: %s", scamper_ping_method2str(ping, buf, sizeof(buf))); switch(ping->probe_method) { case SCAMPER_PING_METHOD_ICMP_ECHO: case SCAMPER_PING_METHOD_ICMP_TIME: if((ping->flags & SCAMPER_PING_FLAG_ICMPSUM) != 0) printf(", icmp-csum: %04x", ping->probe_icmpsum); break; case SCAMPER_PING_METHOD_UDP: case SCAMPER_PING_METHOD_TCP_ACK: case SCAMPER_PING_METHOD_TCP_SYN: printf(", sport: %d, dport: %d", ping->probe_sport, ping->probe_dport); break; case SCAMPER_PING_METHOD_TCP_ACK_SPORT: printf(", base-sport: %d, dport: %d", ping->probe_sport, ping->probe_dport); break; case SCAMPER_PING_METHOD_UDP_DPORT: printf(", sport: %d, base-dport %d", ping->probe_sport, ping->probe_dport); break; } printf("\n"); if(ping->probe_tsps != NULL) { printf(" timestamp-prespec:"); for(i=0; iprobe_tsps->ipc; i++) printf(" %s", scamper_addr_tostr(ping->probe_tsps->ips[i],buf,sizeof(buf))); printf("\n"); } /* dump pad bytes, if used */ if(ping->probe_datalen > 0 && ping->probe_data != NULL) { if((ping->flags & SCAMPER_PING_FLAG_PAYLOAD) != 0) printf(" payload"); else printf(" pattern"); printf(" bytes (%d): ", ping->probe_datalen); for(i=0; iprobe_datalen; i++) printf("%02x", ping->probe_data[i]); printf("\n"); } printf(" probes-sent: %d, stop-reason: ", ping->ping_sent); switch(ping->stop_reason) { case SCAMPER_PING_STOP_NONE: printf("none"); break; case SCAMPER_PING_STOP_COMPLETED: printf("done"); break; case SCAMPER_PING_STOP_ERROR: printf("sendto errno %d", ping->stop_data); break; case SCAMPER_PING_STOP_HALTED: printf("halted"); break; default: printf("reason 0x%02x data 0x%02x", ping->stop_reason, ping->stop_data); break; } printf("\n"); for(i=0; iping_sent; i++) { for(reply = ping->ping_replies[i]; reply != NULL; reply = reply->next) { dump_ping_reply(ping, reply); } } printf("\n"); scamper_ping_free(ping); return; } static void dump_dealias_probedef(scamper_dealias_probedef_t *def) { scamper_dealias_probedef_icmp_t *icmp; char dst[128], src[128]; printf(" probedef %d: dst: %s, ttl: %d, tos: 0x%02x\n src: %s", def->id, scamper_addr_tostr(def->dst, dst, sizeof(dst)), def->ttl, def->tos, scamper_addr_tostr(def->src, src, sizeof(src))); if(def->size > 0) printf(", size: %d", def->size); if(def->mtu > 0) printf(", mtu: %d", def->mtu); printf("\n"); if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_ICMP(def)) { icmp = &def->un.icmp; printf(" icmp-echo csum: %04x, id: %04x\n", icmp->csum, icmp->id); } else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP(def)) { if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP) printf(" udp"); else if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP_DPORT) printf(" udp-dport"); else printf(" udp-%d", def->method); printf(" %d:%d\n", def->un.udp.sport, def->un.udp.dport); } else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP(def)) { if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK) printf(" tcp-ack"); else if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK_SPORT) printf(" tcp-ack-sport"); else if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_SYN_SPORT) printf(" tcp-syn-sport"); else printf(" tcp-%d", def->method); printf(" %d:%d ", def->un.tcp.sport, def->un.tcp.dport); dump_tcp_flags(def->un.tcp.flags); printf("\n"); } else { printf("%d\n", def->method); } return; } static void dump_dealias(scamper_dealias_t *dealias) { scamper_dealias_prefixscan_t *ps = dealias->data; scamper_dealias_mercator_t *mercator = dealias->data; scamper_dealias_radargun_t *radargun = dealias->data; scamper_dealias_ally_t *ally = dealias->data; scamper_dealias_bump_t *bump = dealias->data; scamper_dealias_probe_t *probe; scamper_dealias_reply_t *reply; struct timeval rtt; uint32_t i; uint16_t u16; uint8_t u8; char buf[256]; int j; /* first line: dealias */ printf("dealias"); if(dealias->method == SCAMPER_DEALIAS_METHOD_MERCATOR) { scamper_addr_tostr(mercator->probedef.src, buf, sizeof(buf)); printf(" from %s", buf); scamper_addr_tostr(mercator->probedef.dst, buf, sizeof(buf)); printf(" to %s", buf); } printf("\n"); /* dump list, cycle, start time */ dump_list_summary(dealias->list); dump_cycle_summary(dealias->cycle); printf(" user-id: %d\n", dealias->userid); dump_timeval("start", &dealias->start); /* method headers */ printf(" method: "); if(dealias->method == SCAMPER_DEALIAS_METHOD_MERCATOR) { printf("mercator, attempts: %d, timeout: %ds\n", mercator->attempts, mercator->wait_timeout); dump_dealias_probedef(&mercator->probedef); } else if(dealias->method == SCAMPER_DEALIAS_METHOD_ALLY) { printf("ally, attempts: %d, fudge: %d, " "wait-probe: %dms, wait-timeout: %ds", ally->attempts,ally->fudge,ally->wait_probe,ally->wait_timeout); if(SCAMPER_DEALIAS_ALLY_IS_NOBS(dealias)) printf(", nobs"); printf("\n"); dump_dealias_probedef(&ally->probedefs[0]); dump_dealias_probedef(&ally->probedefs[1]); } else if(dealias->method == SCAMPER_DEALIAS_METHOD_BUMP) { printf("bump, attempts: %d, wait-probe: %dms, bump-limit: %d\n", bump->attempts, bump->wait_probe, bump->bump_limit); dump_dealias_probedef(&bump->probedefs[0]); dump_dealias_probedef(&bump->probedefs[1]); } else if(dealias->method == SCAMPER_DEALIAS_METHOD_RADARGUN) { printf("radargun, wait-probe: %dms, wait-round: %dms\n" " wait-timeout: %ds, attempts: %d, probedefc: %d\n", radargun->wait_probe, radargun->wait_round, radargun->wait_timeout, radargun->attempts, radargun->probedefc); if((u8 = radargun->flags) != 0) { printf(" flags: "); for(i=0; i<8; i++) { if((u8 & (1 << i)) == 0) continue; switch(1 << i) { case SCAMPER_DEALIAS_RADARGUN_FLAG_SHUFFLE: printf("shuffle"); break; default: printf("0x%02x", 1<probedefc; i++) dump_dealias_probedef(&radargun->probedefs[i]); } else if(dealias->method == SCAMPER_DEALIAS_METHOD_PREFIXSCAN) { printf("prefixscan, %s:", scamper_addr_tostr(ps->a, buf, sizeof(buf))); printf("%s/%d", scamper_addr_tostr(ps->b, buf, sizeof(buf)), ps->prefix); if(ps->ab != NULL) printf(", alias: %s/%d", scamper_addr_tostr(ps->ab, buf, sizeof(buf)), scamper_addr_prefixhosts(ps->b, ps->ab)); printf("\n"); printf(" attempts: %d, replyc: %d, fudge: %d, wait-probe: %dms, " "wait-timeout: %ds", ps->attempts, ps->replyc, ps->fudge, ps->wait_probe, ps->wait_timeout); if(SCAMPER_DEALIAS_PREFIXSCAN_IS_NOBS(dealias)) printf(", nobs"); printf("\n"); if(ps->xc > 0) { printf(" exclude:"); for(u16=0; u16xc; u16++) printf(" %s", scamper_addr_tostr(ps->xs[u16], buf, sizeof(buf))); printf("\n"); } for(i=0; iprobedefc; i++) dump_dealias_probedef(&ps->probedefs[i]); } else { printf("%d\n", dealias->method); } printf(" probes: %d, result: %s", dealias->probec, scamper_dealias_result_tostr(dealias, buf, sizeof(buf))); if(dealias->method == SCAMPER_DEALIAS_METHOD_PREFIXSCAN && ps->flags & SCAMPER_DEALIAS_PREFIXSCAN_FLAG_CSA) printf(", csa"); printf("\n"); for(i=0; iprobec; i++) { probe = dealias->probes[i]; printf(" probe: %d, def: %d, seq: %d, tx: %d.%06d", i, probe->def->id, probe->seq, (int)probe->tx.tv_sec, (int)probe->tx.tv_usec); if(SCAMPER_ADDR_TYPE_IS_IPV4(probe->def->dst)) printf(", ipid: %04x", probe->ipid); printf("\n"); for(j=0; jreplyc; j++) { reply = probe->replies[j]; timeval_diff_tv(&rtt, &probe->tx, &reply->rx); printf(" reply: %d, src: %s, ttl: %d, rtt: %d.%06d", j, scamper_addr_tostr(reply->src, buf, sizeof(buf)), reply->ttl, (int)rtt.tv_sec, (int)rtt.tv_usec); if(SCAMPER_ADDR_TYPE_IS_IPV4(reply->src)) printf(", ipid: %04x", reply->ipid); else if(reply->flags & SCAMPER_DEALIAS_REPLY_FLAG_IPID32) printf(", ipid32: %08x", reply->ipid32); printf("\n"); if(SCAMPER_DEALIAS_REPLY_IS_ICMP(reply)) { printf(" icmp-type: %d, icmp-code: %d", reply->icmp_type, reply->icmp_code); if(SCAMPER_DEALIAS_REPLY_IS_ICMP_UNREACH(reply) || SCAMPER_DEALIAS_REPLY_IS_ICMP_TTL_EXP(reply)) { printf(", icmp-q-ttl: %d", reply->icmp_q_ip_ttl); } printf("\n"); } else if(SCAMPER_DEALIAS_REPLY_IS_TCP(reply)) { printf(" tcp flags:"); dump_tcp_flags(reply->tcp_flags); printf("\n"); } else { printf(" reply proto %d\n", reply->proto); } } } printf("\n"); scamper_dealias_free(dealias); return; } static void dump_neighbourdisc(scamper_neighbourdisc_t *nd) { scamper_neighbourdisc_probe_t *probe; scamper_neighbourdisc_reply_t *reply; struct timeval rtt; uint16_t i, j; char a[64], b[64]; printf("neighbourdisc\n"); dump_list_summary(nd->list); dump_cycle_summary(nd->cycle); printf(" user-id: %d\n", nd->userid); dump_timeval("start", &nd->start); if(nd->method == SCAMPER_NEIGHBOURDISC_METHOD_ARP || nd->method == SCAMPER_NEIGHBOURDISC_METHOD_ND_NSOL) { if(nd->method == SCAMPER_NEIGHBOURDISC_METHOD_ARP) printf(" method: arp"); else printf(" method: ipv6 nsol"); printf(", attempts: %d, wait: %ds, replyc: %d, iface: %s\n", nd->attempts, nd->wait, nd->replyc, nd->ifname); printf(" our-mac: %s\n", scamper_addr_tostr(nd->src_mac, a, sizeof(a))); printf(" flags: 0x%02x", nd->flags); if(nd->flags != 0) { printf(" ("); if(nd->flags & SCAMPER_NEIGHBOURDISC_FLAG_ALLATTEMPTS) printf(" all-attempts"); if(nd->flags & SCAMPER_NEIGHBOURDISC_FLAG_FIRSTRESPONSE) printf(" first-response"); printf(" )"); } printf("\n"); printf(" query: who-has %s tell %s\n", scamper_addr_tostr(nd->dst_ip, a, sizeof(a)), scamper_addr_tostr(nd->src_ip, b, sizeof(b))); printf(" result: %s is-at %s\n", a, scamper_addr_tostr(nd->dst_mac, b, sizeof(b))); } for(i=0; iprobec; i++) { probe = nd->probes[i]; printf(" probe: %d, tx: %d.%06d\n", i, (int)probe->tx.tv_sec, (int)probe->tx.tv_usec); for(j=0; jrxc; j++) { reply = probe->rxs[j]; timeval_diff_tv(&rtt, &probe->tx, &reply->rx); printf(" reply: %d, rtt: %d.%06d, mac: %s\n", i, (int)rtt.tv_sec, (int)rtt.tv_usec, scamper_addr_tostr(reply->mac, a, sizeof(a))); } } printf("\n"); scamper_neighbourdisc_free(nd); return; } static void tbit_bits_print(uint32_t flags,int bits, const char **f2s,int f2sc) { int i, f = 0; uint32_t u32; if(flags == 0) return; for(i=0; i 0) printf(","); if(i < f2sc) printf(" %s", f2s[i]); else printf(" 0x%x", u32); f++; } return; } static uint32_t tbit_isnoff(uint32_t isn, uint32_t seq) { if(seq >= isn) return seq - isn; return TCP_MAX_SEQNUM - isn + seq + 1; } static void dump_tbit(scamper_tbit_t *tbit) { static const char *tbit_options[] = {"tcpts", "sack"}; static const char *null_options[] = {"tcpts", "ipts-syn", "iprr-syn", "ipqs-syn", "sack", "fo", "fo-exp"}; static const char *null_results[] = {"tcpts-ok", "sack-ok", "fo-ok"}; scamper_tbit_pmtud_t *pmtud; scamper_tbit_null_t *null; scamper_tbit_icw_t *icw; scamper_tbit_blind_t *blind; scamper_tbit_app_http_t *http; scamper_tbit_app_bgp_t *bgp; scamper_tbit_pkt_t *pkt; struct timeval diff; uint32_t i; uint16_t len, u16, datalen; uint8_t proto, flags, iphlen, tcphlen, mf, ecn, u8, *tmp, txsyn, rxsyn; uint32_t seq, ack, server_isn, client_isn, off, u32; char src[64], dst[64], buf[128], ipid[12], fstr[32], tfstr[32], sack[64]; uint8_t cookie[16]; char *str; size_t soff; int frag; /* Start dumping the tbit test information */ printf("tbit from %s to %s\n", scamper_addr_tostr(tbit->src, src, sizeof(src)), scamper_addr_tostr(tbit->dst, dst, sizeof(dst))); dump_list_summary(tbit->list); dump_cycle_summary(tbit->cycle); printf(" user-id: %d\n", tbit->userid); dump_timeval("start", &tbit->start); printf(" sport: %d, dport: %d\n", tbit->sport, tbit->dport); printf(" client-mss: %d, server-mss: %d, ttl: %u", tbit->client_mss, tbit->server_mss, tbit->ttl); if(tbit->wscale > 0) printf(", wscale: %u", tbit->wscale); printf("\n"); printf(" type: %s,", scamper_tbit_type2str(tbit, buf, sizeof(buf))); printf(" result: %s\n", scamper_tbit_res2str(tbit, buf, sizeof(buf))); if(tbit->options != 0) { printf(" options:"); tbit_bits_print(tbit->options, 32, tbit_options, sizeof(tbit_options) / sizeof(char *)); printf("\n"); } if(tbit->fo_cookielen > 0) { printf(" fo-cookie: "); for(u8=0; u8fo_cookielen; u8++) printf("%02x", tbit->fo_cookie[u8]); printf("\n"); } if(tbit->type == SCAMPER_TBIT_TYPE_PMTUD && tbit->data != NULL) { pmtud = tbit->data; printf(" mtu: %d, ptb-retx: %d", pmtud->mtu, pmtud->ptb_retx); if(pmtud->ptbsrc != NULL) printf(", ptb-src: %s", scamper_addr_tostr(pmtud->ptbsrc, src, sizeof(src))); if(pmtud->options & SCAMPER_TBIT_PMTUD_OPTION_BLACKHOLE) printf(", blackhole"); printf("\n"); } else if(tbit->type == SCAMPER_TBIT_TYPE_NULL && tbit->data != NULL) { null = tbit->data; if(null->options != 0) { printf(" null-options:"); tbit_bits_print(null->options, 16, null_options, sizeof(null_options) / sizeof(char *)); printf("\n"); } if(null->results != 0) { printf(" results:"); tbit_bits_print(null->results, 16, null_results, sizeof(null_results) / sizeof(char *)); printf("\n"); if((null->results & SCAMPER_TBIT_NULL_RESULT_FO) && scamper_tbit_fo_getcookie(tbit, cookie, &u8) != 0) { printf(" fo-cookie: "); for(i=0; itype == SCAMPER_TBIT_TYPE_ICW && tbit->result == SCAMPER_TBIT_RESULT_ICW_SUCCESS) { icw = tbit->data; printf(" icw-start-seq: %u", icw->start_seq); if(scamper_tbit_icw_size(tbit, &u32) == 0) printf(", icw-size: %u bytes", u32); printf("\n"); } else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_RST || tbit->type == SCAMPER_TBIT_TYPE_BLIND_SYN || tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA) { blind = tbit->data; printf(" blind: offset %d, retx %u\n", blind->off, blind->retx); } if(tbit->app_proto == SCAMPER_TBIT_APP_HTTP && tbit->app_data != NULL) { http = tbit->app_data; printf(" app: http"); if(http->type == SCAMPER_TBIT_APP_HTTP_TYPE_HTTPS) str = "https"; else str = "http"; if(http->host != NULL && http->file != NULL) printf(", url: %s://%s%s", str, http->host, http->file); else if(http->host != NULL) printf(", url: %s://%s", str, http->host); else printf(", file: %s", http->file); printf("\n"); } else if(tbit->app_proto == SCAMPER_TBIT_APP_BGP && tbit->app_data != NULL) { bgp = tbit->app_data; printf(" app: bgp, asn: %u\n", bgp->asn); } client_isn = 0; server_isn = 0; txsyn = 0; rxsyn = 0; for(i=0; ipktc; i++) { pkt = tbit->pkts[i]; frag = 0; mf = 0; off = 0; ipid[0] = '\0'; if((pkt->data[0] >> 4) == 4) { iphlen = (pkt->data[0] & 0xf) * 4; len = bytes_ntohs(pkt->data+2); proto = pkt->data[9]; ecn = pkt->data[1] & 0x3; if(pkt->data[6] & 0x20) mf = 1; off = (bytes_ntohs(pkt->data+6) & 0x1fff) * 8; if(mf != 0 || off != 0) frag = 1; snprintf(ipid, sizeof(ipid), "%04x", bytes_ntohs(pkt->data+4)); } else if((pkt->data[0] >> 4) == 6) { iphlen = 40; len = bytes_ntohs(pkt->data+4) + iphlen; proto = pkt->data[6]; ecn = (pkt->data[1] & 0x30) >> 4; for(;;) { switch(proto) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: case IPPROTO_ROUTING: proto = pkt->data[iphlen+0]; iphlen += (pkt->data[iphlen+1] * 8) + 8; continue; case IPPROTO_FRAGMENT: if(pkt->data[iphlen+3] & 0x1) mf = 1; off = (bytes_ntohs(pkt->data+iphlen+2) & 0xfff8); snprintf(ipid, sizeof(ipid), "%x", bytes_ntohl(pkt->data+iphlen+4)); proto = pkt->data[iphlen+0]; iphlen += 8; frag = 1; continue; } break; } } else { continue; } timeval_diff_tv(&diff, &tbit->start, &pkt->tv); printf(" [%3d.%03d] %s ", (int)diff.tv_sec, (int)(diff.tv_usec / 1000), pkt->dir == SCAMPER_TBIT_PKT_DIR_TX ? "TX" : "RX"); if(frag != 0) snprintf(fstr,sizeof(fstr),":%u%s", off, mf != 0 ? " MF" : ""); else fstr[0] = '\0'; if(off != 0) { printf("%13s %4dF%17s%s%s", "", len, "", ipid, fstr); } else if(proto == IPPROTO_TCP) { seq = bytes_ntohl(pkt->data+iphlen+4); ack = bytes_ntohl(pkt->data+iphlen+8); flags = pkt->data[iphlen+13]; tcphlen = ((pkt->data[iphlen+12] & 0xf0) >> 4) * 4; soff = 0; tfstr[0] = '\0'; if(flags & 0x2) { if(flags & 0x10) { if(rxsyn == 0) { server_isn = seq; rxsyn = 1; } string_concat(tfstr, sizeof(tfstr), &soff, "SYN/ACK"); } else { if(txsyn == 0) { client_isn = seq; txsyn = 1; } string_concat(tfstr, sizeof(tfstr), &soff, "SYN"); } } else if(flags & 0x1) string_concat(tfstr, sizeof(tfstr), &soff, "FIN"); else if(flags & 0x4) string_concat(tfstr, sizeof(tfstr), &soff, "RST"); if(flags & 0x40) string_concat(tfstr, sizeof(tfstr), &soff, "%sECE", soff != 0 ? "/" : ""); if(flags & 0x80) string_concat(tfstr, sizeof(tfstr), &soff, "%sCWR", soff != 0 ? "/" : ""); /* parse TCP options for sack blocks */ u8 = 20; soff = 0; sack[0] = '\0'; while(u8 < tcphlen) { tmp = pkt->data + iphlen + u8; if(tmp[0] == 0) /* end of option list */ break; if(tmp[0] == 1) /* nop */ { u8++; continue; } if(tmp[1] == 0 || u8 + tmp[1] > tcphlen) break; /* sack edges */ if(tmp[0] == 5 && (tmp[1]==10 || tmp[1]==18 || tmp[1]==26 || tmp[1]==34)) { if(pkt->dir == SCAMPER_TBIT_PKT_DIR_TX) u32 = server_isn; else u32 = client_isn; string_concat(sack, sizeof(sack), &soff, " {"); for(u16=0; u16<(tmp[1]-2)/8; u16++) string_concat(sack, sizeof(sack), &soff, "%s%u:%u", u16 != 0 ? "," : "", bytes_ntohl(tmp+2+(u16*8)) - u32, bytes_ntohl(tmp+2+(u16*8)+4) - u32); string_concat(sack, sizeof(sack), &soff, "}"); } u8 += tmp[1]; } if(pkt->dir == SCAMPER_TBIT_PKT_DIR_TX) { seq = tbit_isnoff(client_isn, seq); ack = tbit_isnoff(server_isn, ack); } else { if(!(seq == 0 && (flags & TH_RST) != 0)) seq = tbit_isnoff(server_isn, seq); ack = tbit_isnoff(client_isn, ack); } datalen = len - iphlen - tcphlen; printf("%-13s %4d%s", tfstr, len, frag != 0 ? "F" : " "); soff = 0; string_concat(buf, sizeof(buf), &soff, " %u", seq); if(flags & TH_ACK) string_concat(buf, sizeof(buf), &soff, ":%u", ack); if(datalen != 0) string_concat(buf, sizeof(buf), &soff, "(%d)", datalen); printf("%-17s%s", buf, ipid); if(frag != 0) printf("%s", fstr); if(datalen > 0 && (pkt->data[0] >> 4) == 4 && pkt->data[6] & 0x40) printf(" DF"); if(ecn == 3) printf(" CE"); else if(ecn != 0) printf(" ECT"); printf("%s", sack); } else if(proto == IPPROTO_ICMP) { if(pkt->data[iphlen+0] == 3 && pkt->data[iphlen+1] == 4) { u16 = bytes_ntohs(pkt->data+iphlen+6); printf("%-13s %4d mtu = %d", "PTB", len, u16); } } else if(proto == IPPROTO_ICMPV6) { if(pkt->data[iphlen+0] == 2) { u32 = bytes_ntohl(pkt->data+iphlen+4); printf("%-13s %4d mtu = %d", "PTB", len, u32); } } printf("\n"); } fprintf(stdout,"\n"); scamper_tbit_free(tbit); return; } static void dump_sting(scamper_sting_t *sting) { scamper_sting_pkt_t *pkt; struct timeval diff; char src[64], dst[64], buf[32], ipid[12], tfstr[32], *dir; uint32_t i, seq, ack, server_isn, client_isn; uint16_t len, datalen; uint8_t proto, flags, iphlen, tcphlen; size_t tfoff; printf("sting from %s to %s\n", scamper_addr_tostr(sting->src, src, sizeof(src)), scamper_addr_tostr(sting->dst, dst, sizeof(dst))); dump_list_summary(sting->list); dump_cycle_summary(sting->cycle); printf(" user-id: %d\n", sting->userid); dump_timeval("start", &sting->start); printf(" sport: %d, dport: %d\n", sting->sport, sting->dport); printf(" count: %d, mean: %dus, inter: %dus, seqskip %d\n", sting->count, sting->mean, sting->inter, sting->seqskip); printf(" synretx: %d, dataretx: %d\n", sting->synretx, sting->dataretx); printf(" dataackc: %d, holec: %d\n", sting->dataackc, sting->holec); printf(" hs-rtt: %d.%06d\n", (int)sting->hsrtt.tv_sec, (int)sting->hsrtt.tv_usec); printf(" result: "); if(sting->result == SCAMPER_STING_RESULT_NONE) printf("none"); else if(sting->result == SCAMPER_STING_RESULT_COMPLETED) printf("completed"); else printf("0x%02x", sting->result); printf("\n"); client_isn = 0; server_isn = 0; for(i=0; ipktc; i++) { pkt = sting->pkts[i]; if((pkt->data[0] >> 4) == 4) { iphlen = (pkt->data[0] & 0xf) * 4; len = bytes_ntohs(pkt->data+2); proto = pkt->data[9]; snprintf(ipid, sizeof(ipid), " %04x", bytes_ntohs(pkt->data+4)); } else if((pkt->data[0] >> 4) == 6) { iphlen = 40; len = bytes_ntohs(pkt->data+4) + iphlen; proto = pkt->data[6]; ipid[0] = '\0'; for(;;) { switch(proto) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: case IPPROTO_ROUTING: proto = pkt->data[iphlen+0]; iphlen += (pkt->data[iphlen+1] * 8) + 8; continue; case IPPROTO_FRAGMENT: proto = pkt->data[iphlen+0]; iphlen += 8; continue; } break; } } else continue; if(proto != IPPROTO_TCP) continue; timeval_diff_tv(&diff, &sting->start, &pkt->tv); if(pkt->flags & SCAMPER_STING_PKT_FLAG_TX) dir = "TX"; else if(pkt->flags & SCAMPER_STING_PKT_FLAG_RX) dir = "RX"; else dir = "??"; printf(" [%3d.%03d] %s ",(int)diff.tv_sec,(int)(diff.tv_usec/1000),dir); seq = bytes_ntohl(pkt->data+iphlen+4); ack = bytes_ntohl(pkt->data+iphlen+8); flags = pkt->data[iphlen+13]; tcphlen = ((pkt->data[iphlen+12] & 0xf0) >> 4) * 4; tfoff = 0; if(flags & 0x2) { if(flags & 0x10) { server_isn = seq; string_concat(tfstr, sizeof(tfstr), &tfoff, "SYN/ACK"); } else { client_isn = seq; string_concat(tfstr, sizeof(tfstr), &tfoff, "SYN"); } } else if(flags & 0x1) string_concat(tfstr, sizeof(tfstr), &tfoff, "FIN"); else if(flags & 0x4) string_concat(tfstr, sizeof(tfstr), &tfoff, "RST"); if(flags & 0x40) string_concat(tfstr, sizeof(tfstr), &tfoff, "%sECE", tfoff != 0 ? "/" : ""); if(flags & 0x80) string_concat(tfstr, sizeof(tfstr), &tfoff, "%sCWR", tfoff != 0 ? "/" : ""); if(tfoff == 0) tfstr[0] = '\0'; if(pkt->flags & SCAMPER_STING_PKT_FLAG_TX) { seq = tbit_isnoff(client_isn, seq); ack = tbit_isnoff(server_isn, ack); } else { seq = tbit_isnoff(server_isn, seq); ack = tbit_isnoff(client_isn, ack); } datalen = len - iphlen - tcphlen; printf("%-13s %4d", tfstr, len); if(datalen != 0) snprintf(buf, sizeof(buf), " seq = %u:%u(%d)", seq, ack, datalen); else snprintf(buf, sizeof(buf), " seq = %u:%u", seq, ack); printf("%-23s%s\n", buf, ipid); } scamper_sting_free(sting); return; } static void dump_sniff(scamper_sniff_t *sniff) { scamper_sniff_pkt_t *pkt; struct timeval tv; uint8_t u8, *ptr; uint32_t i, j; int k; char src[64], dst[64], buf[32], *str; printf("sniff %s\n", scamper_addr_tostr(sniff->src, src, sizeof(src))); dump_list_summary(sniff->list); dump_cycle_summary(sniff->cycle); printf(" user-id: %d\n", sniff->userid); dump_timeval("start", &sniff->start); dump_timeval("finish", &sniff->finish); printf(" limit-pktc: %d, limit-time: %d, icmp-id %d\n", sniff->limit_pktc, sniff->limit_time, sniff->icmpid); switch(sniff->stop_reason) { case SCAMPER_SNIFF_STOP_NONE: str = "none"; break; case SCAMPER_SNIFF_STOP_ERROR: str = "error"; break; case SCAMPER_SNIFF_STOP_LIMIT_TIME: str = "limit-time"; break; case SCAMPER_SNIFF_STOP_LIMIT_PKTC: str = "limit-pktc"; break; case SCAMPER_SNIFF_STOP_HALTED: str = "halted"; break; default: snprintf(buf, sizeof(buf), "%d", sniff->stop_reason); str = buf; break; } printf(" result: %s, pktc: %d\n", str, sniff->pktc); for(i=0; ipktc; i++) { pkt = sniff->pkts[i]; timeval_diff_tv(&tv, &sniff->start, &pkt->tv); printf(" %3d %d.%06d", i, (int)tv.tv_sec, (int)tv.tv_usec); u8 = (pkt->data[0] & 0xf0) >> 4; if(u8 == 4) { printf(" %s -> %s", inet_ntop(AF_INET, pkt->data+12, src, sizeof(src)), inet_ntop(AF_INET, pkt->data+16, dst, sizeof(dst))); } else if(u8 == 6) { printf(" %s -> %s", inet_ntop(AF_INET6, pkt->data+8, src, sizeof(src)), inet_ntop(AF_INET6, pkt->data+24, dst, sizeof(dst))); } printf("\n"); ptr = pkt->data; for(j=0; j+16<=pkt->len; j+=16) { printf(" 0x%04x: ", j); for(k=0; k<8; k++) { printf(" %02x%02x", ptr[0], ptr[1]); ptr += 2; } printf("\n"); } if(pkt->len - j != 0) { printf(" 0x%04x: ", j); while(jlen) { if((j % 2) == 0) printf(" "); printf("%02x", *ptr); ptr++; j++; } printf("\n"); } } return; } static void dump_cycle(scamper_cycle_t *cycle, const char *type) { time_t tt; char buf[32]; if(strcmp(type, "start") == 0 || strcmp(type, "def") == 0) tt = cycle->start_time; else tt = cycle->stop_time; memcpy(buf, ctime(&tt), 24); buf[24] = '\0'; printf("cycle %s, list %s %d, cycle %d, time %s\n", type, cycle->list->name, cycle->list->id, cycle->id, buf); scamper_cycle_free(cycle); return; } static void dump_list(scamper_list_t *list) { printf("list id %d, name %s", list->id, list->name); if(list->descr != NULL) printf(", descr \"%s\"", list->descr); printf("\n"); scamper_list_free(list); return; } static void dump_addr(scamper_addr_t *addr) { char buf[128]; printf("addr %s\n", scamper_addr_tostr(addr, buf, sizeof(buf))); scamper_addr_free(addr); return; } int main(int argc, char *argv[]) { scamper_file_t *file; scamper_file_filter_t *filter; uint16_t filter_types[] = { SCAMPER_FILE_OBJ_LIST, SCAMPER_FILE_OBJ_CYCLE_START, SCAMPER_FILE_OBJ_CYCLE_DEF, SCAMPER_FILE_OBJ_CYCLE_STOP, SCAMPER_FILE_OBJ_TRACE, SCAMPER_FILE_OBJ_PING, SCAMPER_FILE_OBJ_TRACELB, SCAMPER_FILE_OBJ_DEALIAS, SCAMPER_FILE_OBJ_NEIGHBOURDISC, SCAMPER_FILE_OBJ_TBIT, SCAMPER_FILE_OBJ_STING, SCAMPER_FILE_OBJ_SNIFF, }; uint16_t filter_cnt = sizeof(filter_types)/sizeof(uint16_t); void *data; uint16_t type; int f; #ifdef _WIN32 WSADATA wsaData; WSAStartup(MAKEWORD(2,2), &wsaData); #endif #if defined(DMALLOC) free(malloc(1)); #endif if((filter = scamper_file_filter_alloc(filter_types, filter_cnt)) == NULL) { usage(); fprintf(stderr, "could not alloc filter\n"); return -1; } for(f=0; f 1) continue; if((file=scamper_file_openfd(STDIN_FILENO,"-",'r',"warts")) == NULL) { usage(); fprintf(stderr, "could not use stdin\n"); return -1; } } else { if((file = scamper_file_open(argv[f], 'r', NULL)) == NULL) { usage(); fprintf(stderr, "could not open %s\n", argv[f]); return -1; } } while(scamper_file_read(file, filter, &type, &data) == 0) { /* hit eof */ if(data == NULL) goto done; switch(type) { case SCAMPER_FILE_OBJ_ADDR: dump_addr(data); break; case SCAMPER_FILE_OBJ_TRACE: dump_trace(data); break; case SCAMPER_FILE_OBJ_PING: dump_ping(data); break; case SCAMPER_FILE_OBJ_TRACELB: dump_tracelb(data); break; case SCAMPER_FILE_OBJ_DEALIAS: dump_dealias(data); break; case SCAMPER_FILE_OBJ_NEIGHBOURDISC: dump_neighbourdisc(data); break; case SCAMPER_FILE_OBJ_TBIT: dump_tbit(data); break; case SCAMPER_FILE_OBJ_STING: dump_sting(data); break; case SCAMPER_FILE_OBJ_SNIFF: dump_sniff(data); break; case SCAMPER_FILE_OBJ_LIST: dump_list(data); break; case SCAMPER_FILE_OBJ_CYCLE_START: dump_cycle(data, "start"); break; case SCAMPER_FILE_OBJ_CYCLE_STOP: dump_cycle(data, "stop"); break; case SCAMPER_FILE_OBJ_CYCLE_DEF: dump_cycle(data, "def"); break; } } done: scamper_file_close(file); if(argc == 1) break; } scamper_file_filter_free(filter); return 0; } scamper-cvs-20171204/utils/sc_wartsdump/Makefile.in000644 001751 000000 00000054602 13211200067 022032 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_wartsdump$(EXEEXT) subdir = utils/sc_wartsdump ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_sc_wartsdump_OBJECTS = sc_wartsdump.$(OBJEXT) sc_wartsdump_OBJECTS = $(am_sc_wartsdump_OBJECTS) sc_wartsdump_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_wartsdump_SOURCES) DIST_SOURCES = $(sc_wartsdump_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_wartsdump_SOURCES = sc_wartsdump.c sc_wartsdump_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_wartsdump.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_wartsdump/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_wartsdump/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list sc_wartsdump$(EXEEXT): $(sc_wartsdump_OBJECTS) $(sc_wartsdump_DEPENDENCIES) $(EXTRA_sc_wartsdump_DEPENDENCIES) @rm -f sc_wartsdump$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_wartsdump_OBJECTS) $(sc_wartsdump_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_wartsdump.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_wartscat/.cvsignore000644 001751 000000 00000000055 11525063774 021602 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_wartscat scamper-cvs-20171204/utils/sc_wartscat/Makefile.am000644 001751 000000 00000000422 12177530303 021623 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_wartscat sc_wartscat_SOURCES = sc_wartscat.c ../../mjl_heap.c sc_wartscat_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_wartscat.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_wartscat/sc_wartscat.1000644 001751 000000 00000002053 12577420003 022167 0ustar00mjlwheel000000 000000 .\" .\" sc_wartscat.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2010-2011 University of Waikato .\" All rights reserved .\" .\" $Id: sc_wartscat.1,v 1.4 2015/09/20 02:54:59 mjl Exp $ .\" .\" nroff -man sc_wartscat.1 .\" groff -man -Tascii sc_wartscat.1 | man2html -title sc_wartscat.1 .\" .Dd October 15, 2010 .Dt SC_WARTSCAT 1 .Os .Sh NAME .Nm sc_wartscat .Nd concatenate warts files generated by scamper .Sh SYNOPSIS .Nm .Bk -words .Op Fl ?s .Op Fl o Ar outfile .Op Ar .Sh DESCRIPTION The .Nm utility provides the ability to concatenate warts files generated by scamper. .Sh EXAMPLES The command: .Pp .in +.3i sc_wartscat -o output.warts file1.warts file2.warts .in -.3i .Pp will decode and print the contents of file1.warts, followed by the contents of file2.warts. .Pp The command: .Pp .in +.3i gzcat file1.warts.gz | sc_wartsdump .in -.3i .Pp will print the contents of the uncompressed file supplied on stdin. .Sh SEE ALSO .Xr scamper 1 .Sh AUTHORS .Nm was written by Matthew Luckie . scamper-cvs-20171204/utils/sc_wartscat/sc_wartscat.c000644 001751 000000 00000023676 12520056313 022264 0ustar00mjlwheel000000 000000 /* * warts-cat * * This is a utility program to concatenate warts data files together. * * $Id: sc_wartscat.c,v 1.22 2015/04/29 04:23:39 mjl Exp $ * * Copyright (C) 2007-2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_wartscat.c,v 1.22 2015/04/29 04:23:39 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "trace/scamper_trace.h" #include "tracelb/scamper_tracelb.h" #include "ping/scamper_ping.h" #include "dealias/scamper_dealias.h" #include "tbit/scamper_tbit.h" #include "neighbourdisc/scamper_neighbourdisc.h" #include "sting/scamper_sting.h" #include "scamper_file.h" #include "mjl_heap.h" #include "utils.h" #define OPT_OUTFILE 0x00000001 /* o: */ #define OPT_SORT 0x00000002 /* s: */ #define OPT_HELP 0x00000004 /* ?: */ static uint32_t options = 0; static int infile_cnt = 0; static scamper_file_t **infiles = NULL; static scamper_file_t *outfile = NULL; static scamper_file_filter_t *filter = NULL; /* * sort_struct * * structure that is used when warts-cat has to sort input data items. */ typedef struct sort_struct { /* type type and data just read from the file */ uint16_t type; void *data; /* timestamp associated with the data object */ struct timeval tv; /* index into infiles array */ int file; } sort_struct_t; static void usage(const char *argv0, uint32_t opt_mask) { fprintf(stderr, "usage: sc_wartscat [-?s] [-o outfile] \n"); if(opt_mask == 0) return; fprintf(stderr, "\n"); if(opt_mask & OPT_HELP) fprintf(stderr, " -? give an overview of the usage of sc_wartscat\n"); if(opt_mask & OPT_OUTFILE) fprintf(stderr, " -o output file to concatenate to\n"); if(opt_mask & OPT_SORT) fprintf(stderr, " -s sort objects in input file by timestamp\n"); return; } static int check_options(int argc, char *argv[]) { int i, ch; char *opts = "o:s?"; char *opt_outfile = NULL; while((i = getopt(argc, argv, opts)) != -1) { ch = (char)i; switch(ch) { case 'o': options |= OPT_OUTFILE; opt_outfile = optarg; break; case 's': options |= OPT_SORT; break; case '?': default: usage(argv[0], 0xffffffff); return -1; } } /* figure out how many input files there are to process */ if((infile_cnt = argc - optind) < 1) { usage(argv[0], 0); return -1; } if((infiles = malloc_zero(sizeof(scamper_file_t *) * infile_cnt)) == NULL) return -1; /* open each input file */ for(i=0; itv, &a->tv)) != 0) return i; /* if timestamps are identical, cycle start objects have first priority */ if(a->type == SCAMPER_FILE_OBJ_CYCLE_START) { if(b->type == SCAMPER_FILE_OBJ_CYCLE_START) return 0; else return 1; } if(b->type == SCAMPER_FILE_OBJ_CYCLE_START) return -1; /* if timestamps are identical, cycle start objects have second priority */ if(a->type == SCAMPER_FILE_OBJ_CYCLE_STOP) { if(b->type == SCAMPER_FILE_OBJ_CYCLE_STOP) return 0; else return 1; } if(b->type == SCAMPER_FILE_OBJ_CYCLE_STOP) return -1; return 0; } static int sort_cat_fill(heap_t *heap, sort_struct_t *s) { int i = s->file; if(scamper_file_read(infiles[i], filter, &s->type, &s->data) == 0) { /* EOF */ if(s->data == NULL) { scamper_file_close(infiles[i]); infiles[i] = NULL; return 0; } switch(s->type) { case SCAMPER_FILE_OBJ_TRACELB: timeval_cpy(&s->tv, &((scamper_tracelb_t *)s->data)->start); break; case SCAMPER_FILE_OBJ_TRACE: timeval_cpy(&s->tv, &((scamper_trace_t *)s->data)->start); break; case SCAMPER_FILE_OBJ_PING: timeval_cpy(&s->tv, &((scamper_ping_t *)s->data)->start); break; case SCAMPER_FILE_OBJ_DEALIAS: timeval_cpy(&s->tv, &((scamper_dealias_t *)s->data)->start); break; case SCAMPER_FILE_OBJ_TBIT: timeval_cpy(&s->tv, &((scamper_tbit_t *)s->data)->start); break; case SCAMPER_FILE_OBJ_NEIGHBOURDISC: timeval_cpy(&s->tv, &((scamper_neighbourdisc_t *)s->data)->start); break; case SCAMPER_FILE_OBJ_STING: timeval_cpy(&s->tv, &((scamper_sting_t *)s->data)->start); break; case SCAMPER_FILE_OBJ_CYCLE_START: s->tv.tv_sec = ((scamper_cycle_t *)s->data)->start_time; s->tv.tv_usec = 0; break; case SCAMPER_FILE_OBJ_CYCLE_STOP: s->tv.tv_sec = ((scamper_cycle_t *)s->data)->stop_time; s->tv.tv_usec = 1000000; break; } if(heap_insert(heap, s) == NULL) return -1; } else return -1; return 0; } static int sort_cat(void) { heap_t *heap = NULL; sort_struct_t *ss = NULL; sort_struct_t *s; int i; if((heap = heap_alloc((heap_cmp_t)sort_struct_cmp)) == NULL) goto err; if((ss = malloc_zero(sizeof(sort_struct_t) * infile_cnt)) == NULL) goto err; /* * start by filling all file slots with the first data object from * each file */ for(i=0; itype, s->data) != 0) goto err; if(sort_cat_fill(heap, s) != 0) goto err; } heap_free(heap, NULL); free(ss); return 0; err: if(heap != NULL) heap_free(heap, NULL); if(ss != NULL) free(ss); return -1; } int main(int argc, char *argv[]) { uint16_t filter_types[] = { SCAMPER_FILE_OBJ_TRACELB, SCAMPER_FILE_OBJ_TRACE, SCAMPER_FILE_OBJ_PING, SCAMPER_FILE_OBJ_DEALIAS, SCAMPER_FILE_OBJ_TBIT, SCAMPER_FILE_OBJ_NEIGHBOURDISC, SCAMPER_FILE_OBJ_STING, SCAMPER_FILE_OBJ_CYCLE_START, SCAMPER_FILE_OBJ_CYCLE_STOP, }; uint16_t filter_cnt = sizeof(filter_types)/sizeof(uint16_t); int rc; #if defined(DMALLOC) free(malloc(1)); #endif atexit(cleanup); if(check_options(argc, argv) == -1) return -1; if((filter = scamper_file_filter_alloc(filter_types, filter_cnt)) == NULL) { fprintf(stderr, "could not allocate filter\n"); return -1; } if(options & OPT_SORT) rc = sort_cat(); else rc = simple_cat(); return rc; } scamper-cvs-20171204/utils/sc_wartscat/Makefile.in000644 001751 000000 00000056171 13211200067 021637 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_wartscat$(EXEEXT) subdir = utils/sc_wartscat ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_wartscat_OBJECTS = sc_wartscat.$(OBJEXT) \ ../../mjl_heap.$(OBJEXT) sc_wartscat_OBJECTS = $(am_sc_wartscat_OBJECTS) sc_wartscat_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_wartscat_SOURCES) DIST_SOURCES = $(sc_wartscat_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_wartscat_SOURCES = sc_wartscat.c ../../mjl_heap.c sc_wartscat_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_wartscat.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_wartscat/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_wartscat/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_heap.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_wartscat$(EXEEXT): $(sc_wartscat_OBJECTS) $(sc_wartscat_DEPENDENCIES) $(EXTRA_sc_wartscat_DEPENDENCIES) @rm -f sc_wartscat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_wartscat_OBJECTS) $(sc_wartscat_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_heap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_wartscat.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_warts2text/.cvsignore000644 001751 000000 00000000057 11525063774 022103 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_warts2text scamper-cvs-20171204/utils/sc_warts2text/Makefile.am000644 001751 000000 00000000470 12177530303 022125 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_warts2text sc_warts2text_SOURCES = \ sc_warts2text.c \ ../../utils.c \ ../../mjl_splaytree.c sc_warts2text_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_warts2text.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_warts2text/sc_warts2text.1000644 001751 000000 00000004232 12577420003 022766 0ustar00mjlwheel000000 000000 .\" .\" sc_warts2text.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2010 University of Waikato .\" All rights reserved .\" .\" $Id: sc_warts2text.1,v 1.6 2015/09/20 02:54:59 mjl Exp $ .\" .\" nroff -man sc_warts2text.1 .\" groff -man -Tascii sc_warts2text.1 | man2html -title sc_warts2text.1 .\" .Dd October 15, 2010 .Dt SC_WARTS2TEXT 1 .Os .Sh NAME .Nm sc_warts2text .Nd simple dump of information contained in a warts file. .Sh SYNOPSIS .Nm .Bk -words .Op Fl d Ar ip2descr-file .Op Ar .Sh DESCRIPTION The .Nm utility provides a simple dump of information contained in a sequence of warts files. The output is the same as that which would have been provided by scamper if the text output option had been chosen instead of the warts output option when the data was collected. The options are as follows: .Bl -tag -width Ds .It Fl d Ar ip2descr-file specifies the name of a file with IP-address, description mappings, one mapping per line. See the examples section for further information. .El .Pp While the output of .Nm is structured and suitable for initial analyses of results, the format of the output is not suitable for automated parsing and analysis as the output of .Nm will change overtime with no regard to backwards compatibility. Analyses of the contents of a warts file should be made using specialised programs which link against the scamper file API. .Sh EXAMPLES The command: .Pp .in +.3i sc_warts2text file1.warts file2.warts .in -.3i .Pp will decode and print the contents of file1.warts, followed by the contents of file2.warts. .Pp The command: .Pp .in +.3i gzcat file1.warts.gz | sc_warts2text .in -.3i .Pp will print the contents of the uncompressed file supplied on stdin. .Pp Given a set of IP-address, description pairs in a file name mappings.txt: .Pp .in +.3i .nf 192.0.2.1 "foo" 192.0.2.2 "bar" .fi .in -.3i .Pp then the command gzcat file1.warts.gz | sc_warts2text -d mappings.txt will print the description associated with a given destination address before each result is presented. .Sh SEE ALSO .Xr scamper 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2json 1 .Sh AUTHORS .Nm was written by Matthew Luckie . scamper-cvs-20171204/utils/sc_warts2text/sc_warts2text.c000644 001751 000000 00000016705 12520060606 023055 0ustar00mjlwheel000000 000000 /* * warts2traceroute * * $Id: sc_warts2text.c,v 1.25 2015/04/29 04:43:50 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_warts2text.c,v 1.25 2015/04/29 04:43:50 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_file.h" #include "scamper_addr.h" #include "scamper_list.h" #include "trace/scamper_trace.h" #include "ping/scamper_ping.h" #include "tracelb/scamper_tracelb.h" #include "dealias/scamper_dealias.h" #include "tbit/scamper_tbit.h" #include "sting/scamper_sting.h" #include "mjl_splaytree.h" #include "utils.h" static splaytree_t *tree = NULL; static char **files = NULL; static int filec = 0; typedef int (*wf_t)(scamper_file_t *, void *); typedef void (*ff_t)(void *); typedef scamper_addr_t *(*df_t)(void *); typedef struct ip2descr { scamper_addr_t *addr; char *descr; } ip2descr_t; typedef struct funcset { wf_t write; ff_t datafree; df_t dst; } funcset_t; static int ip2descr_cmp(const ip2descr_t *a, const ip2descr_t *b) { return scamper_addr_cmp(a->addr, b->addr); } /* * ip2descr_line * * parse lines that look like the following: * 1.2.3.4 "foo" * 5.6.7.8 "bar" */ static int ip2descr_line(char *line, void *param) { static int line_no = 1; scamper_addr_t *addr = NULL; ip2descr_t fm, *ip2descr = NULL; char *ip = line, *descr = line, *tmp; while(*descr != '\0') { if(*descr == ' ' || *descr == '\t') break; descr++; } if(*descr == '\0') { fprintf(stderr, "premature end to line %d\n", line_no); goto err; } *descr = '\0'; descr++; while(*descr == ' ' || *descr == '\t') descr++; if(*descr != '"') { fprintf(stderr, "expected \" on line %d\n", line_no); goto err; } descr++; tmp = descr; while(*tmp != '\0') { if(*tmp == '"') break; tmp++; } if(*tmp == '\0') { fprintf(stderr, "missing closing \" on line %d\n", line_no); goto err; } *tmp = '\0'; if((addr = scamper_addr_resolve(AF_UNSPEC, ip)) == NULL) { fprintf(stderr, "invalid address '%s' on line %d\n", ip, line_no); goto err; } fm.addr = addr; if(splaytree_find(tree, &fm) != NULL) { fprintf(stderr, "duplicate definition for %s on line %d\n", ip, line_no); goto err; } if((ip2descr = malloc_zero(sizeof(ip2descr_t))) == NULL) { fprintf(stderr, "could not malloc ip2descr\n"); goto err; } if((ip2descr->descr = strdup(descr)) == NULL) { fprintf(stderr, "could not dup descr on line %d\n", line_no); goto err; } ip2descr->addr = addr; addr = NULL; if(splaytree_insert(tree, ip2descr) == NULL) { fprintf(stderr, "could not add line %d\n", line_no); goto err; } line_no++; return 0; err: if(ip2descr != NULL) { if(ip2descr->addr != NULL) scamper_addr_free(ip2descr->addr); if(ip2descr->descr != NULL) free(ip2descr->descr); free(ip2descr); } if(addr != NULL) scamper_addr_free(addr); return -1; } static char *ip2descr_lookup(scamper_addr_t *addr) { ip2descr_t fm, *ip2descr; fm.addr = addr; if((ip2descr = splaytree_find(tree, &fm)) == NULL) return NULL; return ip2descr->descr; } static scamper_addr_t *trace_dst(void *data) { return ((scamper_trace_t *)data)->dst; } static scamper_addr_t *ping_dst(void *data) { return ((scamper_ping_t *)data)->dst; } static scamper_addr_t *tracelb_dst(void *data) { return ((scamper_tracelb_t *)data)->dst; } static scamper_addr_t *tbit_dst(void *data) { return ((scamper_tbit_t *)data)->dst; } static scamper_addr_t *sting_dst(void *data) { return ((scamper_sting_t *)data)->dst; } static int check_options(int argc, char *argv[]) { char *opt_descr = NULL; int i; while((i = getopt(argc, argv, "d:")) != -1) { switch(i) { case 'd': opt_descr = optarg; break; default: return -1; } } if(opt_descr != NULL) { if((tree = splaytree_alloc((splaytree_cmp_t)ip2descr_cmp)) == NULL) return -1; if(file_lines(opt_descr, ip2descr_line, NULL) != 0) return -1; } filec = argc - optind; if(filec > 0) files = argv + optind; return 0; } int main(int argc, char *argv[]) { funcset_t funcs[] = { {NULL, NULL, NULL}, {NULL, NULL, NULL}, /* list */ {NULL, NULL, NULL}, /* cycle start */ {NULL, NULL, NULL}, /* cycle def */ {NULL, NULL, NULL}, /* cycle stop */ {NULL, NULL, NULL}, /* addr */ {(wf_t)scamper_file_write_trace, (ff_t)scamper_trace_free, trace_dst}, {(wf_t)scamper_file_write_ping, (ff_t)scamper_ping_free, ping_dst}, {(wf_t)scamper_file_write_tracelb,(ff_t)scamper_tracelb_free, tracelb_dst}, {(wf_t)scamper_file_write_dealias,(ff_t)scamper_dealias_free, NULL}, {NULL, NULL, NULL}, /* neighbour discovery */ {(wf_t)scamper_file_write_tbit, (ff_t)scamper_tbit_free, tbit_dst}, {(wf_t)scamper_file_write_sting, (ff_t)scamper_sting_free, sting_dst}, {NULL, NULL, NULL}, /* sniff */ }; uint16_t types[] = { SCAMPER_FILE_OBJ_TRACE, SCAMPER_FILE_OBJ_PING, SCAMPER_FILE_OBJ_TRACELB, SCAMPER_FILE_OBJ_DEALIAS, SCAMPER_FILE_OBJ_TBIT, SCAMPER_FILE_OBJ_STING, }; scamper_file_t *in, *out; scamper_file_filter_t *filter; scamper_addr_t *addr; uint16_t type; void *data; char *descr; int i; if(check_options(argc, argv) != 0) { return -1; } if((out = scamper_file_openfd(STDOUT_FILENO, NULL, 'w', "text")) == NULL) { fprintf(stderr, "could not associate stdout\n"); return -1; } filter = scamper_file_filter_alloc(types, sizeof(types)/sizeof(uint16_t)); if(filter == NULL) { fprintf(stderr, "could not allocate filter\n"); return -1; } for(i=0; i<=filec; i++) { if(filec == 0) { if((in = scamper_file_openfd(STDIN_FILENO,"-",'r',"warts")) == NULL) { fprintf(stderr, "could not use stdin\n"); return -1; } } else if(i < filec) { if((in = scamper_file_open(files[i], 'r', NULL)) == NULL) { fprintf(stderr, "could not open %s: %s\n", files[i], strerror(errno)); return -1; } } else break; while(scamper_file_read(in, filter, &type, (void *)&data) == 0) { if(data == NULL) break; /* EOF */ assert(type < sizeof(funcs)/sizeof(funcset_t)); assert(funcs[type].write != NULL); if(tree != NULL && funcs[type].dst != NULL && (addr = funcs[type].dst(data)) != NULL && (descr = ip2descr_lookup(addr)) != NULL) { printf("%s\n", descr); } funcs[type].write(out, data); funcs[type].datafree(data); } scamper_file_close(in); } scamper_file_close(out); return 0; } scamper-cvs-20171204/utils/sc_warts2text/Makefile.in000644 001751 000000 00000056602 13211200066 022134 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_warts2text$(EXEEXT) subdir = utils/sc_warts2text ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_warts2text_OBJECTS = sc_warts2text.$(OBJEXT) \ ../../utils.$(OBJEXT) ../../mjl_splaytree.$(OBJEXT) sc_warts2text_OBJECTS = $(am_sc_warts2text_OBJECTS) sc_warts2text_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_warts2text_SOURCES) DIST_SOURCES = $(sc_warts2text_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_warts2text_SOURCES = \ sc_warts2text.c \ ../../utils.c \ ../../mjl_splaytree.c sc_warts2text_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_warts2text.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_warts2text/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_warts2text/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_splaytree.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_warts2text$(EXEEXT): $(sc_warts2text_OBJECTS) $(sc_warts2text_DEPENDENCIES) $(EXTRA_sc_warts2text_DEPENDENCIES) @rm -f sc_warts2text$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_warts2text_OBJECTS) $(sc_warts2text_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_splaytree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_warts2text.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_warts2pcap/.cvsignore000644 001751 000000 00000000057 11535054170 022031 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_warts2pcap scamper-cvs-20171204/utils/sc_warts2pcap/Makefile.am000644 001751 000000 00000000434 12177530303 022064 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_warts2pcap sc_warts2pcap_SOURCES = sc_warts2pcap.c ../../mjl_list.c sc_warts2pcap_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_warts2pcap.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_warts2pcap/sc_warts2pcap.1000644 001751 000000 00000003672 12577420003 022673 0ustar00mjlwheel000000 000000 .\" .\" sc_warts2pcap.1 .\" .\" Author: Matthew Luckie .\" Stephen Eichler .\" .\" Copyright (c) 2011 University of Waikato .\" All rights reserved .\" .\" $Id: sc_warts2pcap.1,v 1.5 2015/09/20 02:54:59 mjl Exp $ .\" .\" nroff -man sc_warts2pcap.1 .\" groff -man -Tascii sc_warts2pcap.1 | man2html -title sc_warts2pcap.1 .\" .Dd October 15, 2010 .Dt SC_WARTS2PCAP 1 .Os .Sh NAME .Nm sc_warts2pcap .Nd write packets included in warts object to a pcap file. .Sh SYNOPSIS .Nm .Bk -words .Op Fl o Ar outfile .Op Fl s Ar sort .Op Ar .Sh DESCRIPTION The .Nm utility provides the ability to extract packets embedded in the tbit, sting, and sniff warts objects and write them to a pcap file, which can be read by tcpdump and wireshark. The options are as follows: .Bl -tag -width Ds .It Fl o Ar outfile specifies the name of the output file. If no output file is specified, it will be written to the standard output, provided that it is not a tty. .It Fl o Ar sort specifies how the pcap records (packets) are sorted before being written out. By default, no sorting is applied; the packets are grouped as they are in the warts file. If packet sorting is specified, the packets are written out in timestamp order. Note that this operation requires the packets to be read into memory to be sorted, so it will require a corresponding amount of memory to complete. .El .Sh EXAMPLES The command: .Pp .in +.3i sc_warts2pcap -o output.pcap file1.warts file2.warts .in -.3i .Pp will read the packet objects from file1.warts, and then file2.warts, and write them to output.pcap. .Pp The command: .Pp .in +.3i gzcat file1.warts.gz | sc_warts2pcap -s packet >file1.pcap .in -.3i .Pp will read the contents of the uncompressed warts file supplied on stdin, sort the packets by their timestamp, and then write the output to file1.pcap. .Sh SEE ALSO .Xr scamper 1 , .Xr tcpdump 1 .Sh AUTHORS .Nm was written by Stephen Eichler and Matthew Luckie. scamper-cvs-20171204/utils/sc_warts2pcap/sc_warts2pcap.c000644 001751 000000 00000020502 12520060241 022734 0ustar00mjlwheel000000 000000 /* * sc_warts2pcap * * $Id: sc_warts2pcap.c,v 1.3 2015/04/29 04:40:01 mjl Exp $ * * Copyright (C) 2010 Stephen Eichler * Copyright (C) 2011 University of Waikato * Authors: Stephen Eichler, Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_file.h" #include "scamper_addr.h" #include "scamper_list.h" #include "tbit/scamper_tbit.h" #include "sting/scamper_sting.h" #include "sniff/scamper_sniff.h" #include "utils.h" #include "mjl_list.h" /* * pcap file header */ typedef struct phdr { uint32_t magic_number; /* magic number */ uint16_t version_major; /* major version number */ uint16_t version_minor; /* minor version number */ int32_t thiszone; /* GMT to local correction */ uint32_t sigfigs; /* accuracy of timestamps */ uint32_t snaplen; /* max length of captured packets, in octets */ uint32_t network; /* data link type */ } phdr_t; /* * pcap record */ typedef struct prec { uint32_t ts_sec; /* timestamp seconds */ uint32_t ts_usec; /* timestamp microseconds */ uint32_t incl_len; /* number of octets of packet saved in file */ uint32_t orig_len; /* actual length of packet */ } prec_t; typedef struct pkt { uint8_t *data; uint16_t len; struct timeval tv; } pkt_t; typedef struct sort { int (*init)(void); int (*foreach)(uint16_t type, void *data); int (*finish)(void); } sort_t; static scamper_file_filter_t *filter = NULL; static char *outfile_name = NULL; static FILE *outfile_fd = NULL; static char **files = NULL; static int filec = 0; static int sorti = 0; static int sort_0(uint16_t type, void *data); static int init_1(void); static int sort_1(uint16_t type, void *data); static int finish_1(void); static const sort_t sort[] = { {NULL, sort_0, NULL}, {init_1, sort_1, finish_1}, }; static void usage(void) { fprintf(stderr, "usage: sc_warts2pcap [-o outfile] [-s sorting] warts-files\n"); return; } static int check_options(int argc, char *argv[]) { int ch; while((ch = getopt(argc, argv, "o:s:")) != -1) { switch(ch) { case 'o': outfile_name = optarg; break; case 's': if(strcasecmp(optarg, "none") == 0) sorti = 0; else if(strcasecmp(optarg, "packet") == 0) sorti = 1; else return -1; break; } } if(outfile_name == NULL) { outfile_name = "-"; usage(); return -1; } files = argv + optind; filec = argc - optind; return 0; } static int pkt_write(uint8_t *data, uint16_t len, struct timeval *tv, void *p) { prec_t rec; memset(&rec, 0, sizeof(rec)); rec.ts_sec = tv->tv_sec; rec.ts_usec = tv->tv_usec; rec.incl_len = len; rec.orig_len = len; if(fwrite(&rec, sizeof(rec), 1, outfile_fd) != 1) return -1; if(fwrite(data, len, 1, outfile_fd) != 1) return -1; return 0; } static void pkt_free(pkt_t *pkt) { if(pkt == NULL) return; if(pkt->data != NULL) free(pkt->data); free(pkt); return; } static int pkt_cmp(const pkt_t *a, const pkt_t *b) { return timeval_cmp(&a->tv, &b->tv); } static int pkt_push(uint8_t *data, uint16_t len, struct timeval *tv, void *p) { slist_t *list = p; pkt_t *pkt = NULL; if((pkt = malloc_zero(sizeof(pkt_t))) == NULL) goto err; if((pkt->data = memdup(data, len)) == NULL) goto err; pkt->len = len; timeval_cpy(&pkt->tv, tv); if(slist_tail_push(list, pkt) == NULL) goto err; return 0; err: pkt_free(pkt); return -1; } static int doit(uint16_t type, void *data, int (*func)(uint8_t *, uint16_t, struct timeval *, void *), void *param) { scamper_tbit_t *tbit = NULL; scamper_tbit_pkt_t *tbit_pkt; scamper_sting_t *sting = NULL; scamper_sting_pkt_t *sting_pkt; scamper_sniff_t *sniff = NULL; scamper_sniff_pkt_t *sniff_pkt; uint32_t i; if(type == SCAMPER_FILE_OBJ_TBIT) { tbit = data; for(i=0; ipktc; i++) { tbit_pkt = tbit->pkts[i]; if(func(tbit_pkt->data, tbit_pkt->len, &tbit_pkt->tv, param) != 0) goto err; } scamper_tbit_free(tbit); } else if(type == SCAMPER_FILE_OBJ_STING) { sting = data; for(i=0; ipktc; i++) { sting_pkt = sting->pkts[i]; if(func(sting_pkt->data, sting_pkt->len, &sting_pkt->tv, param) != 0) goto err; } scamper_sting_free(sting); } else if(type == SCAMPER_FILE_OBJ_SNIFF) { sniff = data; for(i=0; ipktc; i++) { sniff_pkt = sniff->pkts[i]; if(func(sniff_pkt->data, sniff_pkt->len, &sniff_pkt->tv, param) != 0) goto err; } scamper_sniff_free(sniff); } else return -1; return 0; err: if(tbit != NULL) scamper_tbit_free(tbit); if(sting != NULL) scamper_sting_free(sting); if(sniff != NULL) scamper_sniff_free(sniff); return -1; } static int sort_0(uint16_t type, void *data) { return doit(type, data, pkt_write, NULL); } static slist_t *list = NULL; static int init_1(void) { if((list = slist_alloc()) == NULL) return -1; return 0; } static int sort_1(uint16_t type, void *data) { return doit(type, data, pkt_push, list); } static int finish_1(void) { pkt_t *pkt; if(slist_qsort(list, (slist_cmp_t)pkt_cmp) != 0) return -1; while((pkt = slist_head_pop(list)) != NULL) { if(pkt_write(pkt->data, pkt->len, &pkt->tv, NULL) != 0) return -1; pkt_free(pkt); } slist_free(list); return 0; } static int do_file(scamper_file_t *in) { uint16_t type; void *data; int rc; while((rc = scamper_file_read(in, filter, &type, &data)) == 0) { if(data == NULL) break; if(sort[sorti].foreach(type, data) != 0) goto err; } if(rc != 0) goto err; scamper_file_close(in); return 0; err: return -1; } int main(int argc, char *argv[]) { uint16_t filter_types[] = { SCAMPER_FILE_OBJ_TBIT, SCAMPER_FILE_OBJ_STING, SCAMPER_FILE_OBJ_SNIFF, }; uint16_t filter_cnt = sizeof(filter_types)/sizeof(uint16_t); scamper_file_t *in; phdr_t hdr; int i; if(check_options(argc, argv) != 0) goto err; if((filter = scamper_file_filter_alloc(filter_types, filter_cnt)) == NULL) { fprintf(stderr, "could not allocate ffilter\n"); goto err; } /* open the output file */ if(strcasecmp(outfile_name, "-") != 0) { if((outfile_fd = fopen(outfile_name, "w")) == NULL) { fprintf(stderr, "could not open for output: %s\n", outfile_name); goto err; } } else { /* writing to stdout; don't dump a binary structure to a tty. */ if(isatty(STDOUT_FILENO) != 0) { fprintf(stderr, "not going to dump pcap to a tty, sorry\n"); return -1; } if((outfile_fd = fdopen(STDOUT_FILENO, "w")) == NULL) { fprintf(stderr, "could not fdopen stdout\n"); goto err; } } /* write the pcap header */ hdr.magic_number = 0xa1b2c3d4; hdr.version_major = 2; hdr.version_minor = 4; hdr.thiszone = 0; hdr.sigfigs = 0; hdr.snaplen = 65535; hdr.network = 12; /* DLT_RAW */ if(fwrite(&hdr, sizeof(phdr_t), 1, outfile_fd) != 1) goto err; if(sort[sorti].init != NULL && sort[sorti].init() != 0) goto err; if(filec != 0) { for(i=0; i&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_warts2pcap$(EXEEXT) subdir = utils/sc_warts2pcap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_warts2pcap_OBJECTS = sc_warts2pcap.$(OBJEXT) \ ../../mjl_list.$(OBJEXT) sc_warts2pcap_OBJECTS = $(am_sc_warts2pcap_OBJECTS) sc_warts2pcap_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_warts2pcap_SOURCES) DIST_SOURCES = $(sc_warts2pcap_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_warts2pcap_SOURCES = sc_warts2pcap.c ../../mjl_list.c sc_warts2pcap_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_warts2pcap.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_warts2pcap/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_warts2pcap/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_warts2pcap$(EXEEXT): $(sc_warts2pcap_OBJECTS) $(sc_warts2pcap_DEPENDENCIES) $(EXTRA_sc_warts2pcap_DEPENDENCIES) @rm -f sc_warts2pcap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_warts2pcap_OBJECTS) $(sc_warts2pcap_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_warts2pcap.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_warts2json/.cvsignore000644 001751 000000 00000000057 12172055121 022052 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_warts2json scamper-cvs-20171204/utils/sc_warts2json/Makefile.am000644 001751 000000 00000000437 12177530303 022115 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_warts2json sc_warts2json_SOURCES = \ sc_warts2json.c \ ../../utils.c sc_warts2json_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_warts2json.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_warts2json/sc_warts2json.1000644 001751 000000 00000002733 12577420003 022744 0ustar00mjlwheel000000 000000 .\" .\" sc_warts2json.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2013 The Regents of the University of California .\" All rights reserved .\" .\" $Id: sc_warts2json.1,v 1.5 2015/09/20 02:54:59 mjl Exp $ .\" .\" nroff -man sc_warts2json.1 .\" groff -man -Tascii sc_warts2json.1 | man2html -title sc_warts2json.1 .\" .Dd July 18, 2013 .Dt SC_WARTS2JSON 1 .Os .Sh NAME .Nm sc_warts2json .Nd JSON dump of information contained in a warts file. .Sh SYNOPSIS .Nm .Op Ar .Sh DESCRIPTION The .Nm utility provides a JSON dump of information contained in a sequence of warts files. The output is the same as that which would have been provided by scamper if the JSON output option had been chosen instead of the warts output option when the data was collected. .Sh EXAMPLES The command: .Pp .in +.3i sc_warts2json file1.warts file2.warts .in -.3i .Pp will decode and print the contents of file1.warts, followed by the contents of file2.warts. .Pp The command: .Pp .in +.3i gzcat file1.warts.gz | sc_warts2json .in -.3i .Pp will print the contents of the uncompressed file supplied on stdin. .Sh SEE ALSO .Xr scamper 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2text 1 .Sh AUTHORS .Nm was written by Matthew Luckie . The JSON output format for traceroute and ping was built on an initial prototype provided by Brian Hammond of Internap Network Services Corporation. The JSON output format for tbit and dealias was implemented by Matthew Luckie. scamper-cvs-20171204/utils/sc_warts2json/sc_warts2json.c000644 001751 000000 00000006175 13130370745 023035 0ustar00mjlwheel000000 000000 /* * sc_warts2json * * $Id: sc_warts2json.c,v 1.7 2017/07/09 09:05:41 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2013 The Regents of the University of California * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_warts2json.c,v 1.7 2017/07/09 09:05:41 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_file.h" #include "scamper_addr.h" #include "scamper_list.h" #include "ping/scamper_ping.h" #include "trace/scamper_trace.h" #include "dealias/scamper_dealias.h" #include "tbit/scamper_tbit.h" #include "utils.h" int main(int argc, char *argv[]) { uint16_t types[] = { SCAMPER_FILE_OBJ_CYCLE_START, SCAMPER_FILE_OBJ_CYCLE_STOP, SCAMPER_FILE_OBJ_PING, SCAMPER_FILE_OBJ_TRACE, SCAMPER_FILE_OBJ_DEALIAS, SCAMPER_FILE_OBJ_TBIT, }; scamper_file_t *in, *out; scamper_file_filter_t *filter; char **files = NULL; int filec; uint16_t type; void *data; int i; if((out = scamper_file_openfd(STDOUT_FILENO, NULL, 'w', "json")) == NULL) { fprintf(stderr, "could not associate stdout\n"); return -1; } filter = scamper_file_filter_alloc(types, sizeof(types)/sizeof(uint16_t)); if(filter == NULL) { fprintf(stderr, "could not allocate filter\n"); return -1; } filec = argc - 1; if(filec > 0) files = argv + 1; for(i=0; i<=filec; i++) { if(filec == 0) { if((in = scamper_file_openfd(STDIN_FILENO,"-",'r',"warts")) == NULL) { fprintf(stderr, "could not use stdin\n"); return -1; } } else if(i < filec) { if((in = scamper_file_open(files[i], 'r', NULL)) == NULL) { fprintf(stderr, "could not open %s: %s\n", files[i], strerror(errno)); return -1; } } else break; while(scamper_file_read(in, filter, &type, (void *)&data) == 0) { if(data == NULL) break; /* EOF */ if(scamper_file_write_obj(out, type, data) != 0) return -1; if(type == SCAMPER_FILE_OBJ_PING) scamper_ping_free(data); else if(type == SCAMPER_FILE_OBJ_TRACE) scamper_trace_free(data); else if(type == SCAMPER_FILE_OBJ_DEALIAS) scamper_dealias_free(data); else if(type == SCAMPER_FILE_OBJ_TBIT) scamper_tbit_free(data); } scamper_file_close(in); } scamper_file_filter_free(filter); scamper_file_close(out); return 0; } scamper-cvs-20171204/utils/sc_warts2json/Makefile.in000644 001751 000000 00000056242 13211200066 022121 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_warts2json$(EXEEXT) subdir = utils/sc_warts2json ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_warts2json_OBJECTS = sc_warts2json.$(OBJEXT) \ ../../utils.$(OBJEXT) sc_warts2json_OBJECTS = $(am_sc_warts2json_OBJECTS) sc_warts2json_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_warts2json_SOURCES) DIST_SOURCES = $(sc_warts2json_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_warts2json_SOURCES = \ sc_warts2json.c \ ../../utils.c sc_warts2json_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_warts2json.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_warts2json/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_warts2json/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_warts2json$(EXEEXT): $(sc_warts2json_OBJECTS) $(sc_warts2json_DEPENDENCIES) $(EXTRA_sc_warts2json_DEPENDENCIES) @rm -f sc_warts2json$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_warts2json_OBJECTS) $(sc_warts2json_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_warts2json.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_warts2csv/.cvsignore000644 001751 000000 00000000056 12452150730 021676 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_warts2csv scamper-cvs-20171204/utils/sc_warts2csv/Makefile.am000644 001751 000000 00000000377 12442372410 021740 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_warts2csv sc_warts2csv_SOURCES = \ sc_warts2csv.c \ ../../utils.c sc_warts2csv_LDADD = ../../scamper/libscamperfile.la CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_warts2csv/sc_warts2csv.c000644 001751 000000 00000006626 13131350352 022473 0ustar00mjlwheel000000 000000 /* * sc_warts2csv.c * * Copyright (C) 2014 The Regents of the University of California * * $Id: sc_warts2csv.c,v 1.3 2017/07/12 07:34:02 mjl Exp $ * * Authors: Vaibhav Bajpai, Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_warts2csv.c,v 1.3 2017/07/12 07:34:02 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_file.h" #include "scamper_addr.h" #include "scamper_list.h" #include "trace/scamper_trace.h" #include "utils.h" static void csv_trace(scamper_trace_t *trace) { scamper_trace_hop_t *hop; int i, hopc = 0; char src[128], dst[128], addr[128], rtt[32], type[32], stop[32]; const char *tptr, *sptr; for(i=trace->firsthop-1; ihop_count; i++) { for(hop=trace->hops[i]; hop != NULL; hop = hop->hop_next) { hopc++; break; } } if(hopc == 0) goto done; printf("version;userID;timestamp;src;dst;method;stop;ttl;hopaddr;rtt\n"); scamper_addr_tostr(trace->dst, dst, sizeof(dst)); scamper_addr_tostr(trace->src, src, sizeof(src)); tptr = scamper_trace_type_tostr(trace, type, sizeof(type)); sptr = scamper_trace_stop_tostr(trace, stop, sizeof(stop)); for(i=trace->firsthop-1; ihop_count; i++) { for(hop=trace->hops[i]; hop != NULL; hop=hop->hop_next) { printf("scamper.%s;%u;%d;%s;%s;%s;%s;%u;%s;%s\n", PACKAGE_VERSION, trace->userid, (int)trace->start.tv_sec, src, dst, tptr, sptr, hop->hop_probe_ttl, scamper_addr_tostr(hop->hop_addr,addr,sizeof(addr)), timeval_tostr_us(&hop->hop_rtt, rtt, sizeof(addr))); } } done: scamper_trace_free(trace); return; } int main(int argc, char *argv[]) { uint16_t types[] = { SCAMPER_FILE_OBJ_TRACE, }; scamper_file_t *in; scamper_file_filter_t *filter; char **files = NULL; int filec; uint16_t type; void *data; int i; filter = scamper_file_filter_alloc(types, sizeof(types)/sizeof(uint16_t)); if(filter == NULL) { fprintf(stderr, "could not allocate filter\n"); return -1; } filec = argc - 1; if(filec > 0) files = argv + 1; for(i=0; i<=filec; i++) { if(filec == 0) { if((in = scamper_file_openfd(STDIN_FILENO,"-",'r',"warts")) == NULL) { fprintf(stderr, "could not use stdin\n"); return -1; } } else if(i < filec) { if((in = scamper_file_open(files[i], 'r', NULL)) == NULL) { fprintf(stderr, "could not open %s: %s\n", files[i], strerror(errno)); return -1; } } else break; while(scamper_file_read(in, filter, &type, (void *)&data) == 0) { if(data == NULL) break; /* EOF */ if(type == SCAMPER_FILE_OBJ_TRACE) csv_trace(data); } scamper_file_close(in); } scamper_file_filter_free(filter); return 0; } scamper-cvs-20171204/utils/sc_warts2csv/Makefile.in000644 001751 000000 00000050233 13211200066 021735 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_warts2csv$(EXEEXT) subdir = utils/sc_warts2csv ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_warts2csv_OBJECTS = sc_warts2csv.$(OBJEXT) ../../utils.$(OBJEXT) sc_warts2csv_OBJECTS = $(am_sc_warts2csv_OBJECTS) sc_warts2csv_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_warts2csv_SOURCES) DIST_SOURCES = $(sc_warts2csv_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_warts2csv_SOURCES = \ sc_warts2csv.c \ ../../utils.c sc_warts2csv_LDADD = ../../scamper/libscamperfile.la CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_warts2csv/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_warts2csv/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_warts2csv$(EXEEXT): $(sc_warts2csv_OBJECTS) $(sc_warts2csv_DEPENDENCIES) $(EXTRA_sc_warts2csv_DEPENDENCIES) @rm -f sc_warts2csv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_warts2csv_OBJECTS) $(sc_warts2csv_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_warts2csv.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_uptime/.cvsignore000644 001751 000000 00000000053 13126106607 021243 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_uptime scamper-cvs-20171204/utils/sc_uptime/Makefile.am000644 001751 000000 00000000635 13134520436 021304 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_uptime sc_uptime_SOURCES = \ sc_uptime.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_patricia.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c sc_uptime_LDADD = ../../scamper/libscamperfile.la -lsqlite3 man_MANS = sc_uptime.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_uptime/sc_uptime.1000644 001751 000000 00000013314 13143246770 021326 0ustar00mjlwheel000000 000000 .\" .\" sc_uptime.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2017 Matthew Luckie .\" All rights reserved .\" .\" $Id: sc_uptime.1,v 1.8 2017/08/11 06:26:00 mjl Exp $ .\" .Dd July 2, 2017 .Dt SC_UPTIME 1 .Os .Sh NAME .Nm sc_uptime .Nd scamper driver to infer reboot windows for systems with IPv6 addresses. .Sh SYNOPSIS .Nm .Bk -words .Op Fl a Ar addressfile .Op Fl d Ar dbfile .Op Fl l Ar logfile .Op Fl o Ar outfile .Op Fl O Ar option .Op Fl p Ar port .Op Fl S Ar srcaddr .Op Fl U Ar unix-socket .Ek .Pp .Nm .Bk -words .Op Fl i .Op Fl d Ar dbfile .Op Fl O Ar option .Op Ar .Ek .Pp .Nm .Bk -words .Op Fl r .Op Fl d Ar dbfile .Op Fl O Ar option .Op Ar ip ... .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility provides the ability to connect to a running .Xr scamper 1 instance and use it to collect data for inferring if and when a system with an IPv6 address rebooted. .Nm induces each system to send fragmented ICMP echo replies, with the goal of obtaining an incrementing Identifier (ID) field in the fragmentation header. If the system assigns ID values from a counter, and the counter resets to zero, the system rebooted in the interval between probes. Note, the technique does not work if the system does not send ICMP6 fragments, if fragments are blocked, or if the system assigns ID values randomly. .Nm implements a scalable algorithm to avoid probing systems that assign ID values at random or are unresponsive. Further information about the algorithm is found in the "see also" section. The supported options to .Nm are as follows: .Bl -tag -width Ds .It Fl a Ar addressfile specifies the name of the input file which consists of a sequence of IPv6 addresses to probe for reboots, one address per line. Any new addresses are added to the sqlite3 database for subsequent processing. Any addresses in the sqlite3 database but not in the addressfile continue to be probed. .It Fl d Ar dbfile specifies the name of the output sqlite3 database file to use .It Fl i specifies that the IPID samples in the supplied .Xr warts 5 files should be imported into the sqlite3 database. .It Fl l Ar logfile specifies the name of a file to log progress output from .Nm generated at run time. .It Fl o Ar outfile specifies the name of the output file to be written. The output file will use the .Xr warts 5 format. .It Fl O Ar options allows the behavior of .Nm to be further tailored. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy create-db: create and initialise a brand new sqlite3 database. Use this option the first time .Nm is run and a state database or a data database has not been created. .It .Sy safe-db: when importing into the data database, use safe operations. By default, .Nm enables optimizations that will speed up bulk data importing, at the expense of possible database corruption in the event power is lost during the import. .It .Sy vacuum-db: perform a database vacuum before doing any operations. .El .It Fl p Ar port specifies the port on the local host where .Xr scamper 1 is accepting control socket connections. .It Fl r specifies that .Nm should use the IPID samples in the sqlite3 database to infer reboots. .It Fl S Ar srcaddr specifies the unicast IPv6 source address to use in probes. This option is recommended when the prober has multiple or changing IPv6 addresses, as some probed systems maintain an IPID counter related to the source IPv6 address of the prober. If the source address of probes changes, the returned IPID sequence could have a discontinuity unrelated to a reboot of the probed system. .It Fl U Ar unix-socket specifies the name of a unix domain socket where .Xr scamper 1 is accepting control socket connections. .El .\"""""""""""" .Sh EXAMPLES Given a set of IPv6 addresses contained in a file named addressfile.txt and a scamper process listening on port 31337 configured to probe at 30 packets per second started as follows: .Pp .Dl scamper -P 31337 -p 30 .Pp the following command will create a sqlite3 database named state.sqlite to record probe state within, probe the addresses contained in addrs.txt once to collect raw data that can be used to infer reboot windows, and store the raw data in out1.warts: .Pp .Dl sc_uptime -p 31337 -O create-db -d state.sqlite -a addrs.txt -o out1.warts .Pp To infer reboot windows, .Nm must be run in rounds. The next time .Nm is run, use: .Pp .Dl sc_uptime -p 31337 -O create-db -d state.sqlite -o out2.warts .Pp Import the IPID samples from out1.warts and out2.warts into a separate probe database: .Pp .Dl sc_uptime -i -O create-db -d data.sqlite out1.warts out2.warts .Pp Infer reboots across all imported data: .Pp .Dl sc_uptime -r -d data.sqlite .Pp To infer reboots just for IPv6 address 2001:DB8::1, use: .Pp .Dl sc_uptime -r -d data.sqlite 2001:DB8::1 .Pp .\"""""""""""" .Sh HINTS Store the state.sqlite file on a memory file system to improve speed and reduce disk wear. In between invocations of .Nm , copy the state.sqlite file to disk. You can store probe data in the same database used to maintain state, but you should use a separate database. To obtain better performance, import the data into a time-series database. .Pp .Sh NOTES .Nm will only probe addresses in 2000::/3. .\"""""""""""" .Sh SEE ALSO .Xr scamper 1 , .Xr sc_ally 1 , .Xr sc_ipiddump 1 , .Xr sc_speedtrap 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2text 1 , .Xr sc_warts2json 1 , .Xr sqlite 1 , .Xr warts 5 , .Rs .%A "M. Luckie" .%A "R. Beverly" .%T "The Impact of Router Outages on the AS-level Internet" .%O "Proc. ACM/SIGCOMM Conference 2017" .Re .Rs .%A "R. Beverly" .%A "M. Luckie" .%A "L. Mosley" .%A "k claffy" .%T "Measuring and Characterizing IPv6 Router Availability" .%O "Proc. PAM 2015" .Re .Sh AUTHORS .Nm was written by Matthew Luckie and Robert Beverly. scamper-cvs-20171204/utils/sc_uptime/sc_uptime.c000644 001751 000000 00000132363 13146637770 021425 0ustar00mjlwheel000000 000000 /* * sc_uptime: system to probe routers to identify reboot events * * $Id: sc_uptime.c,v 1.17 2017/08/21 20:18:00 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2015 The Regents of the University of California * Copyright (C) 2017 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_uptime.c,v 1.17 2017/08/21 20:18:00 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include #include "scamper_addr.h" #include "scamper_list.h" #include "ping/scamper_ping.h" #include "scamper_file.h" #include "scamper_writebuf.h" #include "scamper_linepoll.h" #include "mjl_list.h" #include "mjl_patricia.h" #include "mjl_heap.h" #include "utils.h" #define OPT_HELP 0x0001 #define OPT_DBFILE 0x0002 #define OPT_OUTFILE 0x0004 #define OPT_PORT 0x0008 #define OPT_UNIX 0x0010 #define OPT_LOG 0x0020 #define OPT_ADDRFILE 0x0100 #define OPT_OPTIONS 0x0200 #define OPT_SRCADDR 0x0400 #define OPT_IMPORT 0x0800 #define OPT_REBOOTS 0x1000 #define OPT_ALL 0xffff static patricia_t *tree = NULL; static slist_t *list = NULL; static uint32_t options = 0; static unsigned int port = 0; static char *unix_name = NULL; static scamper_writebuf_t *scamper_wb = NULL; static int scamper_fd = -1; static scamper_linepoll_t *scamper_lp = NULL; static scamper_writebuf_t *decode_wb = NULL; static scamper_file_t *decode_in = NULL; static int decode_in_fd = -1; static int decode_out_fd = -1; static char *dbfile = NULL; static char *addrfile = NULL; static char *outfile_name = NULL; static char *srcaddr = NULL; static scamper_file_t *outfile = NULL; static scamper_file_filter_t *ffilter = NULL; static int data_left = 0; static int more = 0; static int probing = 0; static int fudge = 65535; static int create_db = 0; static int safe_db = 0; static int vacuum_db = 0; static struct timeval now; static FILE *logfile = NULL; static heap_t *waiting = NULL; static sqlite3 *db = NULL; static sqlite3_stmt *st_class = NULL; static char **opt_args = NULL; static int opt_argc = 0; #define CLASS_NONE 0 #define CLASS_UNRESP 1 #define CLASS_RANDOM 2 #define CLASS_INCR 3 typedef struct sc_dst { sqlite3_int64 id; scamper_addr_t *addr; int class; uint8_t flags; uint32_t last_ipid; uint32_t last_tx; int loss; patricia_node_t *tree_node; } sc_dst_t; typedef struct sc_ipid { uint32_t tx; uint32_t ipid; } sc_ipid_t; typedef struct sc_reboot { uint32_t left; uint32_t right; } sc_reboot_t; typedef struct sc_wait { struct timeval tv; sc_dst_t *dst; } sc_wait_t; static void usage(uint32_t opt_mask) { fprintf(stderr, "usage: sc_uptime [-a addrfile] [-d dbfile] [-l log] [-o outfile]\n" " [-O option] [-p port] [-S srcaddr] [-U unix]\n" "\n" " sc_uptime [-i] [-d dbfile] [-O option] file.warts\n" "\n" " sc_uptime [-r] [-d dbfile] [-O option] [ip1 .. ipN]\n" "\n"); if(opt_mask == 0) fprintf(stderr, " sc_uptime -?\n\n"); if(opt_mask & OPT_HELP) fprintf(stderr, " -? give an overview of the usage of sc_uptime\n"); if(opt_mask & OPT_ADDRFILE) fprintf(stderr, " -a input address file\n"); if(opt_mask & OPT_DBFILE) fprintf(stderr, " -d sqlite db file\n"); if(opt_mask & OPT_IMPORT) fprintf(stderr, " -i import samples into database\n"); if(opt_mask & OPT_LOG) fprintf(stderr, " -l output logfile\n"); if(opt_mask & OPT_OUTFILE) fprintf(stderr, " -o output warts file\n"); if(opt_mask & OPT_OPTIONS) { fprintf(stderr, " -O options\n"); fprintf(stderr, " create-db: initialise sqlite3 database\n"); fprintf(stderr, " safe-db: use safe sqlite3 operations\n"); fprintf(stderr, " vacuum-db: vacuum the database before use\n"); } if(opt_mask & OPT_REBOOTS) fprintf(stderr, " -r infer reboots from samples in database\n"); if(opt_mask & OPT_SRCADDR) fprintf(stderr, " -S IPv6 unicast source address for probes\n"); if(opt_mask & OPT_PORT) fprintf(stderr, " -p port to find scamper on\n"); if(opt_mask & OPT_UNIX) fprintf(stderr, " -U unix domain to find scamper on\n"); return; } static int check_options(int argc, char *argv[]) { scamper_addr_t *sa; char *opts = "?a:d:il:o:O:p:rS:U:"; char *opt_port = NULL, *opt_unix = NULL, *opt_log = NULL; char *opt_srcaddr = NULL, *opt_dbfile = NULL; long lo; int ch; while((ch = getopt(argc, argv, opts)) != -1) { switch(ch) { case 'a': options |= OPT_ADDRFILE; addrfile = optarg; break; case 'd': options |= OPT_DBFILE; opt_dbfile = optarg; break; case 'i': options |= OPT_IMPORT; break; case 'l': options |= OPT_LOG; opt_log = optarg; break; case 'o': options |= OPT_OUTFILE; outfile_name = optarg; break; case 'O': if(strcasecmp(optarg, "create-db") == 0) create_db = 1; else if(strcasecmp(optarg, "safe-db") == 0) safe_db = 1; else if(strcasecmp(optarg, "vacuum-db") == 0) vacuum_db = 1; else { usage(OPT_OPTIONS); return -1; } break; case 'p': options |= OPT_PORT; opt_port = optarg; break; case 'r': options |= OPT_REBOOTS; break; case 'U': options |= OPT_UNIX; opt_unix = optarg; break; case 'S': options |= OPT_SRCADDR; opt_srcaddr = optarg; break; case '?': default: usage(OPT_ALL); return -1; } } if(options == 0 || countbits32(options & (OPT_IMPORT|OPT_REBOOTS|OPT_OUTFILE)) != 1) { usage(0); return -1; } if(create_db != 0 && vacuum_db != 0) { usage(OPT_OPTIONS); return -1; } /* importing warts files into a database */ if(options & OPT_IMPORT) { if((options & OPT_DBFILE) == 0) { usage(OPT_DBFILE|OPT_IMPORT); return -1; } dbfile = opt_dbfile; if(argc - optind < 1) { usage(OPT_IMPORT); return -1; } opt_args = argv + optind; opt_argc = argc - optind; return 0; } /* infer reboots from imported database samples */ if(options & OPT_REBOOTS) { if((options & OPT_DBFILE) == 0 || create_db != 0) { usage(OPT_DBFILE|OPT_REBOOTS); return -1; } dbfile = opt_dbfile; opt_args = argv + optind; opt_argc = argc - optind; return 0; } if((options & OPT_OUTFILE) == 0 || (options & OPT_DBFILE) == 0 || (options & (OPT_PORT|OPT_UNIX)) == 0 || (options & (OPT_PORT|OPT_UNIX)) == (OPT_PORT|OPT_UNIX) || argc - optind > 0) { usage(OPT_DBFILE|OPT_OUTFILE|OPT_PORT|OPT_UNIX); return -1; } dbfile = opt_dbfile; if(options & OPT_PORT) { if(string_tolong(opt_port, &lo) != 0 || lo < 1 || lo > 65535) { usage(OPT_PORT); return -1; } port = lo; } else if(options & OPT_UNIX) { unix_name = opt_unix; } if(opt_srcaddr != NULL) { if((sa = scamper_addr_resolve(AF_INET6, opt_srcaddr)) == NULL || scamper_addr_isunicast(sa) != 1) { usage(OPT_SRCADDR); if(sa != NULL) scamper_addr_free(sa); return -1; } scamper_addr_free(sa); srcaddr = opt_srcaddr; } if(opt_log != NULL) { if((logfile = fopen(opt_log, "w")) == NULL) { usage(OPT_LOG); fprintf(stderr, "could not open %s\n", opt_log); return -1; } } return 0; } static void logprint(char *format, ...) { va_list ap; char msg[131072]; va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); if(logfile != NULL) { fprintf(logfile, "%ld: %s", (long int)now.tv_sec, msg); fflush(logfile); } else { fprintf(stdout, "%ld: %s", (long int)now.tv_sec, msg); } return; } static int sc_dst_bit(const sc_dst_t *dst, int bit) { return scamper_addr_bit(dst->addr, bit); } static int sc_dst_fbd(const sc_dst_t *a, const sc_dst_t *b) { return scamper_addr_fbd(a->addr, b->addr); } static int sc_dst_cmp(sc_dst_t *a, sc_dst_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static sc_dst_t *sc_dst_find(scamper_addr_t *addr) { sc_dst_t fm; fm.addr = addr; return (sc_dst_t *)patricia_find(tree, &fm); } static void sc_dst_free(sc_dst_t *dst) { if(dst->addr != NULL) scamper_addr_free(dst->addr); free(dst); return; } static void sc_wait_free(sc_wait_t *wt) { if(wt->dst != NULL) sc_dst_free(wt->dst); free(wt); return; } static int sc_wait_cmp(const void *a, const void *b) { return timeval_cmp(&((sc_wait_t *)b)->tv, &((sc_wait_t *)a)->tv); } static int sc_wait(sc_dst_t *dst) { sc_wait_t *w; if((w = malloc_zero(sizeof(sc_wait_t))) == NULL) return -1; timeval_add_s(&w->tv, &now, 1); w->dst = dst; if(heap_insert(waiting, w) == NULL) return -1; return 0; } static int do_method(void) { char cmd[256], buf[128]; size_t off = 0; sc_wait_t *w; sc_dst_t *dst; if(more < 1) return 0; if((w = heap_head_item(waiting)) != NULL && timeval_cmp(&now, &w->tv) >= 0) { heap_remove(waiting); dst = w->dst; free(w); } else if((dst = slist_head_pop(list)) == NULL) return 0; scamper_addr_tostr(dst->addr, buf, sizeof(buf)); if((dst->tree_node = patricia_insert(tree, dst)) == NULL) { fprintf(stderr, "could not insert %s into tree\n", buf); return -1; } /* form the ping command */ string_concat(cmd, sizeof(cmd), &off, "ping -O dl -s 1300 -M 1280"); if(srcaddr != NULL) string_concat(cmd, sizeof(cmd), &off, " -S %s", srcaddr); if(dst->class != CLASS_INCR) string_concat(cmd, sizeof(cmd), &off, " -c 6 %s\n", buf); else string_concat(cmd, sizeof(cmd), &off, " -c 2 -o 1 -O tbt %s\n", buf); if(scamper_writebuf_send(scamper_wb, cmd, off) != 0) { fprintf(stderr, "could not send %s\n", cmd); return -1; } probing++; more--; logprint("p %d, w %d, l %d : %s", probing, heap_count(waiting), slist_count(list), cmd); return 0; } static int ipid_inseq2(uint64_t a, uint64_t b) { assert(fudge > 0); if(a == b) return 0; if(a > b) b += 0x100000000ULL; if(b - a > fudge) return 0; return 1; } static int ipid_inseq3(uint64_t a, uint64_t b, uint64_t c) { if(a == b || b == c || a == c) return 0; if(a > b) b += 0x100000000ULL; if(a > c) c += 0x100000000ULL; if(fudge != 0) { if(b - a > fudge || c - b > fudge) return 0; } else { if(a > b || b > c) return 0; } return 1; } static int ipid_incr(sc_ipid_t *ipids, int ipidc) { int i; if(ipidc < 3) return 0; for(i=2; i= min) break; } *next = next_min + (u32 % upper); return 0; } /* * db_update * * sql = "update state_dsts set class=?,next=?,last_ipid=?,last_tx=?,loss=? " * "where id=?"; * */ static int db_update(sc_dst_t *dst) { int next; sqlite3_reset(st_class); sqlite3_clear_bindings(st_class); sqlite3_bind_int(st_class, 1, dst->class); if(dst->class != CLASS_INCR) { /* probe again in 7-14 days time */ if(next_random(&next, 7 * 24 * 60 * 60, 14 * 24 * 60 * 60) != 0) { fprintf(stderr, "could not get next_random\n"); return -1; } sqlite3_bind_int(st_class, 2, now.tv_sec + next); } else { /* * probe approx every hour for 24 hours after losing at least 10 * over 2 hours */ if(dst->loss > 10 && now.tv_sec - dst->last_tx > (2 * 60 * 60) && now.tv_sec - dst->last_tx < (24 * 60 * 60)) { sqlite3_bind_int(st_class, 2, now.tv_sec + (60 * 60)); } else { sqlite3_bind_int(st_class, 2, 0); } } sqlite3_bind_int64(st_class, 3, dst->last_ipid); sqlite3_bind_int64(st_class, 4, dst->last_tx); sqlite3_bind_int(st_class, 5, dst->loss); sqlite3_bind_int64(st_class, 6, dst->id); if(sqlite3_step(st_class) != SQLITE_DONE) { fprintf(stderr, "could not execute st_class %lld:%d\n", dst->id, dst->class); return -1; } return 0; } static int do_decoderead_ping(scamper_ping_t *ping) { scamper_ping_reply_t *reply; sc_ipid_t ipids[10]; int i, rc = 0, ipidc = 0, replyc = 0, freedst = 1; sc_dst_t *dst; char buf[128]; scamper_addr_tostr(ping->dst, buf, sizeof(buf)); if((dst = sc_dst_find(ping->dst)) == NULL) { fprintf(stderr, "could not find dst %s\n", buf); return -1; } patricia_remove_node(tree, dst->tree_node); dst->tree_node = NULL; for(i=0; iping_sent; i++) { if((reply = ping->ping_replies[i]) == NULL) continue; if(SCAMPER_PING_REPLY_IS_ICMP_ECHO_REPLY(reply) == 0) continue; replyc++; if(reply->flags & SCAMPER_PING_REPLY_FLAG_REPLY_IPID) { if(ipidc == 10) break; ipids[ipidc].ipid = reply->reply_ipid32; ipids[ipidc].tx = reply->tx.tv_sec; ipidc++; } } logprint("%s %d %d\n", buf, replyc, ipidc); if(dst->class != CLASS_INCR) { if(ipidc == 0) { dst->class = CLASS_UNRESP; } else if(ipidc >= 3) { if(ipid_incr(ipids, ipidc) != 0) dst->class = CLASS_INCR; else dst->class = CLASS_RANDOM; } dst->loss = 0; } else if(ipidc > 0) { if(ipid_inseq2(dst->last_ipid, ipids[0].ipid) == 0) { dst->class = CLASS_NONE; sc_wait(dst); freedst = 0; } dst->loss = 0; } else if(ipidc == 0) { dst->loss++; if(dst->loss > 10 && now.tv_sec - dst->last_tx > (24 * 60 * 60)) { dst->class = CLASS_UNRESP; } } /* * update the last time we received an IPID value if we got one in * sequence */ if(ipidc > 0 && dst->class == CLASS_INCR) { dst->last_ipid = ipids[ipidc-1].ipid; dst->last_tx = ipids[ipidc-1].tx; } db_update(dst); scamper_ping_free(ping); if(freedst != 0) sc_dst_free(dst); return rc; } static int do_decoderead(void) { void *data; uint16_t type; /* try and read a traceroute from the warts decoder */ if(scamper_file_read(decode_in, ffilter, &type, &data) != 0) { fprintf(stderr, "do_decoderead: scamper_file_read errno %d\n", errno); return -1; } if(data == NULL) return 0; probing--; if(scamper_file_write_obj(outfile, type, data) != 0) { fprintf(stderr, "do_decoderead: could not write obj %d\n", type); return -1; } if(type == SCAMPER_FILE_OBJ_PING) return do_decoderead_ping(data); return -1; } static int do_scamperread_line(void *param, uint8_t *buf, size_t linelen) { char *head = (char *)buf; uint8_t uu[64]; size_t uus; long lo; /* skip empty lines */ if(head[0] == '\0') return 0; /* if currently decoding data, then pass it to uudecode */ if(data_left > 0) { uus = sizeof(uu); if(uudecode_line(head, linelen, uu, &uus) != 0) { fprintf(stderr, "could not uudecode_line\n"); return -1; } if(uus != 0) scamper_writebuf_send(decode_wb, uu, uus); data_left -= (linelen + 1); return 0; } /* feedback letting us know that the command was accepted */ if(linelen >= 2 && strncasecmp(head, "OK", 2) == 0) return 0; /* if the scamper process is asking for more tasks, give it more */ if(linelen == 4 && strncasecmp(head, "MORE", linelen) == 0) { more++; if(do_method() != 0) return -1; return 0; } /* new piece of data */ if(linelen > 5 && strncasecmp(head, "DATA ", 5) == 0) { if(string_isnumber(head+5) == 0 || string_tolong(head+5, &lo) != 0) { fprintf(stderr, "could not parse %s\n", head); return -1; } data_left = lo; return 0; } /* feedback letting us know that the command was not accepted */ if(linelen >= 3 && strncasecmp(head, "ERR", 3) == 0) { more++; if(do_method() != 0) return -1; return 0; } fprintf(stderr, "unknown response '%s'\n", head); return -1; } static int do_scamperread(void) { ssize_t rc; uint8_t buf[512]; if((rc = read(scamper_fd, buf, sizeof(buf))) > 0) { scamper_linepoll_handle(scamper_lp, buf, rc); return 0; } else if(rc == 0) { close(scamper_fd); scamper_fd = -1; return 0; } else if(errno == EINTR || errno == EAGAIN) { return 0; } fprintf(stderr, "could not read: errno %d\n", errno); return -1; } /* * do_scamperconnect * * allocate socket and connect to scamper process listening on the port * specified. */ static int do_scamperconnect(void) { struct sockaddr_un sun; struct sockaddr_in sin; struct in_addr in; if(options & OPT_PORT) { inet_aton("127.0.0.1", &in); sockaddr_compose((struct sockaddr *)&sin, AF_INET, &in, port); if((scamper_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { fprintf(stderr, "could not allocate new socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sin, sizeof(sin)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } return 0; } else if(options & OPT_UNIX) { if(sockaddr_compose_un((struct sockaddr *)&sun, unix_name) != 0) { fprintf(stderr, "could not build sockaddr_un\n"); return -1; } if((scamper_fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { fprintf(stderr, "could not allocate unix domain socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sun, sizeof(sun)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } return 0; } else return -1; if(fcntl_set(scamper_fd, O_NONBLOCK) == -1) { fprintf(stderr, "could not set nonblock on scamper_fd\n"); return -1; } return 0; } static int addrfile_line(char *line, void *param) { sqlite3_stmt *stmt = param; scamper_addr_t *sa = NULL; sc_dst_t *dst; char buf[256]; if(line[0] == '#') return 0; if((sa = scamper_addr_resolve(AF_INET6, line)) == NULL) { fprintf(stderr, "could not resolve %s\n", line); return 0; } if(scamper_addr_isunicast(sa) != 1 || patricia_find(tree, sa) != NULL) { scamper_addr_free(sa); return 0; } scamper_addr_tostr(sa, buf, sizeof(buf)); sqlite3_clear_bindings(stmt); sqlite3_reset(stmt); sqlite3_bind_text(stmt, 1, buf, strlen(buf), SQLITE_TRANSIENT); if(sqlite3_step(stmt) != SQLITE_DONE || patricia_insert(tree, sa) == NULL) { scamper_addr_free(sa); return -1; } scamper_addr_use(sa); if((dst = malloc_zero(sizeof(sc_dst_t))) == NULL) return -1; dst->id = sqlite3_last_insert_rowid(db); dst->addr = sa; dst->class = CLASS_NONE; if(slist_tail_push(list, dst) == NULL) { fprintf(stderr, "could not put %s on list: %s\n", buf, strerror(errno)); return -1; } return 0; } static int do_sqlite_open(void) { struct stat sb; char *errmsg; int rc; rc = stat(dbfile, &sb); if(options & OPT_REBOOTS) { if(rc != 0) { fprintf(stderr, "db %s does not exist\n", dbfile); return -1; } } else { if(create_db != 0 && (rc == 0 || errno != ENOENT)) { fprintf(stderr, "will not create a db called %s\n", dbfile); return -1; } else if(create_db == 0 && rc != 0) { fprintf(stderr, "db %s does not exist, use -O create-db\n", dbfile); return -1; } } if((rc = sqlite3_open(dbfile, &db)) != SQLITE_OK) { fprintf(stderr, "could not open %s: %s\n", dbfile, sqlite3_errstr(rc)); return -1; } if(vacuum_db != 0) sqlite3_exec(db, "vacuum", NULL, NULL, &errmsg); return 0; } static int do_sqlite_state(void) { static const char *create_sql = "create table \"state_dsts\" (" "\"id\" INTEGER PRIMARY KEY, " "\"addr\" TEXT NOT NULL, " "\"class\" INTEGER NOT NULL, " "\"next\" INTEGER NOT NULL, " "\"last_ipid\" INTEGER, " "\"last_tx\" INTEGER, " "\"loss\" INTEGER)"; const char *sql; const unsigned char *addr; sqlite3_stmt *stmt; sqlite3_int64 id; scamper_addr_t *sa; sc_dst_t *dst; char *errmsg; int next, rc; if(do_sqlite_open() != 0) return -1; if(create_db != 0 && sqlite3_exec(db, create_sql, NULL, NULL, &errmsg) != SQLITE_OK) { fprintf(stderr, "could not execute create sql: %s\n", errmsg); return -1; } if(addrfile != NULL && (tree = patricia_alloc((patricia_bit_t)scamper_addr_bit, (patricia_cmp_t)scamper_addr_cmp, (patricia_fbd_t)scamper_addr_fbd)) == NULL) { fprintf(stderr, "could not allocate patricia\n"); goto err; } sql = "select id,addr,next,class,last_ipid,last_tx,loss from state_dsts"; if((rc = sqlite3_prepare_v2(db,sql,strlen(sql)+1,&stmt,NULL)) != SQLITE_OK) { fprintf(stderr, "%s: could not prepare sql: %s\n", __func__, sqlite3_errstr(rc)); goto err; } while((rc = sqlite3_step(stmt)) == SQLITE_ROW) { id = sqlite3_column_int64(stmt, 0); addr = sqlite3_column_text(stmt, 1); next = sqlite3_column_int(stmt, 2); if((sa = scamper_addr_resolve(AF_INET6, (const char *)addr)) == NULL) { fprintf(stderr, "could not resolve %s\n", addr); continue; } if(scamper_addr_isunicast(sa) != 1) { scamper_addr_free(sa); continue; } if(tree != NULL && patricia_insert(tree, scamper_addr_use(sa)) == NULL) { fprintf(stderr, "could not insert %s\n", addr); scamper_addr_free(sa); goto err; } /* * if the time to probe next parameter is set, but we haven't * reached the timeout yet, then skip this address */ if(next != 0 && now.tv_sec < next) { scamper_addr_free(sa); continue; } if((dst = malloc_zero(sizeof(sc_dst_t))) == NULL) { fprintf(stderr, "could not malloc dst\n"); goto err; } dst->id = id; dst->addr = sa; sa = NULL; dst->class = sqlite3_column_int(stmt, 3); if(dst->class == CLASS_INCR) { dst->last_ipid = sqlite3_column_int64(stmt, 4); dst->last_tx = sqlite3_column_int64(stmt, 5); dst->loss = sqlite3_column_int(stmt, 6); } if(slist_tail_push(list, dst) == NULL) { fprintf(stderr, "could not put %s on list: %s\n", addr, strerror(errno)); goto err; } } sqlite3_finalize(stmt); if(addrfile != NULL) { sqlite3_exec(db, "begin", NULL, NULL, NULL); sql = "insert into state_dsts(addr,class,next) values(?,0,0)"; rc = sqlite3_prepare_v2(db, sql, strlen(sql)+1, &stmt, NULL); if(rc != SQLITE_OK || file_lines(addrfile, addrfile_line, stmt) != 0) { sqlite3_finalize(stmt); sqlite3_exec(db, "commit", NULL, NULL, NULL); goto err; } sqlite3_exec(db, "commit", NULL, NULL, NULL); sqlite3_finalize(stmt); patricia_free_cb(tree, (patricia_free_t)scamper_addr_free); tree = NULL; } slist_shuffle(list); sql = "update state_dsts set class=?,next=?,last_ipid=?,last_tx=?,loss=? " "where id=?"; rc = sqlite3_prepare_v2(db, sql, strlen(sql)+1, &st_class, NULL); if(rc != SQLITE_OK) { fprintf(stderr, "%s: could not prepare %s: %s\n", __func__, sql, sqlite3_errstr(rc)); goto err; } return 0; err: if(tree != NULL) { patricia_free_cb(tree, (patricia_free_t)scamper_addr_free); tree = NULL; } return -1; } static int up_data(void) { struct timeval tv, *tv_ptr; fd_set rfds, wfds, *wfdsp; sc_wait_t *w; int pair[2]; int nfds; random_seed(); gettimeofday_wrap(&now); if((list = slist_alloc()) == NULL || do_sqlite_state() != 0 || do_scamperconnect() != 0 || (outfile = scamper_file_open(outfile_name, 'w', "warts")) == NULL || (waiting = heap_alloc(sc_wait_cmp)) == NULL || (scamper_wb = scamper_writebuf_alloc()) == NULL || (scamper_lp = scamper_linepoll_alloc(do_scamperread_line,NULL)) == NULL || (decode_wb = scamper_writebuf_alloc()) == NULL || (tree = patricia_alloc((patricia_bit_t)sc_dst_bit, (patricia_cmp_t)sc_dst_cmp, (patricia_fbd_t)sc_dst_fbd)) == NULL || socketpair(AF_UNIX, SOCK_STREAM, 0, pair) != 0 || (decode_in = scamper_file_openfd(pair[0], NULL, 'r', "warts")) == NULL || fcntl_set(pair[0], O_NONBLOCK) == -1 || fcntl_set(pair[1], O_NONBLOCK) == -1) return -1; decode_in_fd = pair[0]; decode_out_fd = pair[1]; scamper_writebuf_send(scamper_wb, "attach\n", 7); for(;;) { /* * need to set a timeout on select if scamper's processing window is * not full and there is a trace in the waiting queue. */ tv_ptr = NULL; if(more > 0) { gettimeofday_wrap(&now); /* * if there is something ready to probe now, then try and * do it. */ w = heap_head_item(waiting); if(slist_count(list) > 0 || (w != NULL && timeval_cmp(&w->tv, &now) <= 0)) { if(do_method() != 0) return -1; } /* * if we could not send a new command just yet, but scamper * wants one, then wait for an appropriate length of time. */ w = heap_head_item(waiting); if(more > 0 && tv_ptr == NULL && w != NULL) { tv_ptr = &tv; if(timeval_cmp(&w->tv, &now) > 0) timeval_diff_tv(&tv, &now, &w->tv); else memset(&tv, 0, sizeof(tv)); } } nfds = 0; FD_ZERO(&rfds); FD_ZERO(&wfds); wfdsp = NULL; if(scamper_fd < 0 && decode_in_fd < 0) break; if(scamper_fd >= 0) { FD_SET(scamper_fd, &rfds); if(nfds < scamper_fd) nfds = scamper_fd; if(scamper_writebuf_len(scamper_wb) > 0) { FD_SET(scamper_fd, &wfds); wfdsp = &wfds; } } if(decode_in_fd >= 0) { FD_SET(decode_in_fd, &rfds); if(nfds < decode_in_fd) nfds = decode_in_fd; } if(decode_out_fd >= 0 && scamper_writebuf_len(decode_wb) > 0) { FD_SET(decode_out_fd, &wfds); wfdsp = &wfds; if(nfds < decode_out_fd) nfds = decode_out_fd; } if(patricia_count(tree) == 0 && slist_count(list) == 0 && heap_count(waiting) == 0) { logprint("done\n"); break; } if(select(nfds+1, &rfds, wfdsp, NULL, tv_ptr) < 0) { if(errno == EINTR) continue; fprintf(stderr, "select error\n"); break; } gettimeofday_wrap(&now); if(more > 0) { if(do_method() != 0) return -1; } if(scamper_fd >= 0) { if(FD_ISSET(scamper_fd, &rfds) && do_scamperread() != 0) return -1; if(wfdsp != NULL && FD_ISSET(scamper_fd, wfdsp) && scamper_writebuf_write(scamper_fd, scamper_wb) != 0) return -1; } if(decode_in_fd >= 0) { if(FD_ISSET(decode_in_fd, &rfds) && do_decoderead() != 0) return -1; } if(decode_out_fd >= 0) { if(wfdsp != NULL && FD_ISSET(decode_out_fd, wfdsp) && scamper_writebuf_write(decode_out_fd, decode_wb) != 0) return -1; } } return 0; } static int up_import(void) { static const char *create_sql[] = { /* destination table */ "create table \"data_dsts\" (" "\"id\" INTEGER PRIMARY KEY," "\"addr\" TEXT NOT NULL)", /* file table */ "create table \"data_files\" (" "\"filename\" TEXT UNIQUE NOT NULL)", /* sample table */ "create table \"data_samples\" (" "\"dst_id\" INTEGER NOT NULL," "\"ipid\" INTEGER NOT NULL," "\"tx_sec\" INTEGER NOT NULL," "\"tx_usec\" INTEGER NOT NULL," "\"rx_sec\" INTEGER NOT NULL," "\"rx_usec\" INTEGER NOT NULL)", /* indexes */ "create index data_samples_select on data_samples(dst_id,ipid,tx_sec)", "create index data_files_filename on data_files(filename)", "create index data_dsts_addr on data_dsts(addr)", }; sqlite3_stmt *stmt = NULL; sqlite3_stmt *st_filename_sel = NULL; sqlite3_stmt *st_filename_ins = NULL; sqlite3_stmt *st_addr_ins = NULL; sqlite3_stmt *st_sample_ins = NULL; sqlite3_int64 id; scamper_file_t *in; scamper_ping_t *ping; scamper_ping_reply_t *r; const unsigned char *addr; scamper_addr_t *sa; struct timeval tv; const char *sql, *ptr; char buf[128]; sc_dst_t *dst; uint16_t j, type; void *data; char *errmsg; int i, x, rc = -1, rx; if(do_sqlite_open() != 0) goto done; if(create_db != 0) { for(i=0; iid = id; dst->addr = sa; sa = NULL; if((dst->tree_node = patricia_insert(tree, dst)) == NULL) { fprintf(stderr, "could not insert %s into tree\n", addr); goto done; } } sqlite3_finalize(stmt); stmt = NULL; /* prepare the sql statements */ sql = "select filename from data_files where filename=?"; x = sqlite3_prepare_v2(db, sql, strlen(sql)+1, &st_filename_sel, NULL); if(x != SQLITE_OK) { fprintf(stderr, "%s: could not prepare sql: %s\n", __func__, sqlite3_errstr(x)); goto done; } sql = "insert into data_files(filename) values(?)"; x = sqlite3_prepare_v2(db, sql, strlen(sql)+1, &st_filename_ins, NULL); if(x != SQLITE_OK) { fprintf(stderr, "%s: could not prepare sql: %s\n", __func__, sqlite3_errstr(x)); goto done; } sql = "insert into data_dsts(addr) values(?)"; x = sqlite3_prepare_v2(db, sql, strlen(sql)+1, &st_addr_ins, NULL); if(x != SQLITE_OK) { fprintf(stderr, "%s: could not prepare sql: %s\n", __func__, sqlite3_errstr(x)); goto done; } sql = "insert into data_samples(dst_id,ipid,tx_sec,tx_usec,rx_sec,rx_usec)" " values(?,?,?,?,?,?)"; x = sqlite3_prepare_v2(db, sql, strlen(sql)+1, &st_sample_ins, NULL); if(x != SQLITE_OK) { fprintf(stderr, "%s: could not prepare sql: %s\n", __func__, sqlite3_errstr(x)); goto done; } /* import all the files */ for(i=0; idst)) == NULL) { if((dst = malloc_zero(sizeof(sc_dst_t))) == NULL) { fprintf(stderr, "could not malloc dst\n"); goto done; } dst->addr = scamper_addr_use(ping->dst); if((dst->tree_node = patricia_insert(tree, dst)) == NULL) { fprintf(stderr, "could not insert dst\n"); goto done; } scamper_addr_tostr(ping->dst, buf, sizeof(buf)); sqlite3_clear_bindings(st_addr_ins); sqlite3_reset(st_addr_ins); sqlite3_bind_text(st_addr_ins,1,buf,strlen(buf),SQLITE_STATIC); sqlite3_step(st_addr_ins); dst->id = sqlite3_last_insert_rowid(db); } rx = 0; for(j=0; jping_sent; j++) { r = ping->ping_replies[j]; if(r != NULL && SCAMPER_PING_REPLY_IS_ICMP_ECHO_REPLY(r)) { rx++; sqlite3_clear_bindings(st_sample_ins); sqlite3_reset(st_sample_ins); sqlite3_bind_int(st_sample_ins, 1, dst->id); if(r->flags & SCAMPER_PING_REPLY_FLAG_REPLY_IPID) sqlite3_bind_int64(st_sample_ins, 2, r->reply_ipid32); else sqlite3_bind_int(st_sample_ins, 2, -1); timeval_add_tv3(&tv, &r->tx, &r->rtt); sqlite3_bind_int(st_sample_ins, 3, r->tx.tv_sec); sqlite3_bind_int(st_sample_ins, 4, r->tx.tv_usec); sqlite3_bind_int(st_sample_ins, 5, tv.tv_sec); sqlite3_bind_int(st_sample_ins, 6, tv.tv_usec); sqlite3_step(st_sample_ins); } } if(rx == 0) { sqlite3_clear_bindings(st_sample_ins); sqlite3_reset(st_sample_ins); sqlite3_bind_int(st_sample_ins, 1, dst->id); sqlite3_bind_int(st_sample_ins, 2, -2); sqlite3_bind_int(st_sample_ins, 3, ping->start.tv_sec); sqlite3_bind_int(st_sample_ins, 4, ping->start.tv_usec); sqlite3_bind_int(st_sample_ins, 5, 0); sqlite3_bind_int(st_sample_ins, 6, 0); sqlite3_step(st_sample_ins); } scamper_ping_free(ping); } scamper_file_close(in); sqlite3_clear_bindings(st_filename_ins); sqlite3_reset(st_filename_ins); sqlite3_bind_text(st_filename_ins, 1, ptr, strlen(ptr), SQLITE_STATIC); sqlite3_step(st_filename_ins); sqlite3_exec(db, "commit", NULL, NULL, NULL); } rc = 0; done: if(stmt != NULL) sqlite3_finalize(stmt); if(st_filename_sel != NULL) sqlite3_finalize(st_filename_sel); if(st_filename_ins != NULL) sqlite3_finalize(st_filename_ins); if(st_addr_ins != NULL) sqlite3_finalize(st_addr_ins); if(st_sample_ins != NULL) sqlite3_finalize(st_sample_ins); if(rc == 0) sqlite3_exec(db, "PRAGMA optimize", NULL, NULL, &errmsg); return rc; } static int up_reboots_arerandom(sc_ipid_t **samples, int samplec, int l, int r) { uint32_t posdiff_min, u32; double sum = 0, mean, abs; int posdiffc = 0; int ipidc = 0; int i; if(l < 0) l = 0; if(r > samplec) r = samplec; for(i=l; iipid <= samples[i]->ipid) { u32 = samples[i+1]->ipid - samples[i]->ipid; if(posdiffc == 0 || u32 < posdiff_min) posdiff_min = u32; posdiffc++; } else { u32 = samples[i]->ipid - samples[i+1]->ipid; } sum += u32; ipidc++; } if(r-l < 2) return 0; if(posdiffc == 0) return 0; if(posdiff_min < 1000) return 0; if(ipidc == posdiffc) return 0; if(((double)ipidc) - posdiffc / 1.0 / posdiffc > 0.5) return 1; mean = sum / ipidc; if(mean < 2147483648) abs = 2147483648 - mean; else abs = mean - 2147483648; if(abs < 100000) return 1; return 0; } static int up_reboots_inference(sc_ipid_t **samples, int samplec, int i, uint32_t min_ipid, uint64_t max_expected_ipid) { uint32_t ipid = samples[i]->ipid; uint32_t last_ipid = samples[i-1]->ipid; uint32_t tx = samples[i]->tx; uint32_t last_tx = samples[i-1]->tx; uint32_t fudge = 65536; uint32_t diff; if(tx - last_tx < 60) return 0; if(tx - last_tx > (7 * 24 * 60 * 60)) return 0; if(ipid < last_ipid) { /* counter wrap */ if(max_expected_ipid >= 0xFFFFFFFFULL && (max_expected_ipid & 0xFFFFFFFFULL) > ipid) return 0; if(ipid < min_ipid) diff = min_ipid - ipid; else diff = ipid - min_ipid; if(diff < fudge && ipid > fudge) return 0; if(up_reboots_arerandom(samples, samplec, i, i + 10) == 0 && up_reboots_arerandom(samples, samplec, i-10, i-1) == 0) return 1; } /* cyclic reboots with a higher IPID than expected, based on velocity */ else if(ipid > max_expected_ipid + fudge) { if(up_reboots_arerandom(samples, samplec, i, i+10) == 0) return 1; } return 0; } static int up_reboots_doone(sc_dst_t *dst, slist_t *samplist, slist_t *reboots) { double velocity = 0, sample_velocity, coverage, reboots_per_day; uint64_t expected_ipid; sc_ipid_t **samples = NULL; sc_reboot_t *reboot; slist_node_t *sn; uint32_t last_tx, last_ipid, min_ipid, tx, ipid; uint32_t threshold = 0; int samplec = slist_count(samplist); int i; if(samplec < 10) return 0; if((samples = malloc_zero(sizeof(sc_ipid_t *) * samplec)) == NULL) goto err; i = 0; for(sn=slist_head_node(samplist); sn != NULL; sn=slist_node_next(sn)) samples[i++] = slist_node_item(sn); last_tx = samples[0]->tx; last_ipid = samples[0]->ipid; min_ipid = samples[0]->ipid; for(i=1; itx; ipid = samples[i]->ipid; sample_velocity = 0.01; if(tx > last_tx && ipid > last_ipid) sample_velocity = ((double)(ipid - last_ipid)) / (tx - last_tx); expected_ipid = last_ipid + ((tx-last_tx) * 10 * velocity); if(up_reboots_inference(samples, samplec, i, min_ipid, expected_ipid)) { min_ipid = ipid; velocity = 0; sample_velocity = 0.01; if(tx - last_tx > threshold) { if((reboot = malloc(sizeof(sc_reboot_t))) == NULL) goto err; reboot->left = last_tx; reboot->right = tx; if(slist_tail_push(reboots, reboot) == NULL) { free(reboot); goto err; } } } last_tx = tx; last_ipid = ipid; if(ipid < min_ipid) min_ipid = ipid; velocity = (0.8 * velocity) + (0.2 * sample_velocity); } coverage = ((double)(samples[samplec-1]->tx-samples[0]->tx)) / (60*60*24); reboots_per_day = slist_count(reboots) / coverage; if(coverage > 100 && reboots_per_day > 5) { while((reboot = slist_head_pop(reboots)) != NULL) free(reboot); } free(samples); return 0; err: if(samples != NULL) free(samples); return -1; } /* * up_reboots * * test cases: * 1. 2001:128c:53f:2::2 (cyclic reboot) * 2. large fudge b/c of things like 2a01:3e0:fff0:400::22 * 3. 2001:1a68:a:3000::136 (fast moving counter) * 4. 2001:428:c02:10:0:16:0:2 (16bit counter?) * 5. 2001:fe0:4775:11f::1 (multiple counters?) * 6. 2001:7f8:1f::4:4134:31:0 (counter wrap) */ static int up_reboots(void) { slist_t *addrs = NULL; slist_t *samples = NULL; slist_t *reboots = NULL; sqlite3_stmt *st = NULL; sc_ipid_t *sample; sc_reboot_t *reboot; const char *sql, *ptr; const unsigned char *addr; char buf[256]; sc_dst_t *dst; sqlite3_int64 tx_sec, ipid; int i, x, rc = -1; if(do_sqlite_open() != 0) return -1; if((addrs = slist_alloc()) == NULL) goto done; if(opt_argc > 0) { sql = "select id from data_dsts where addr=?"; x = sqlite3_prepare_v2(db, sql, strlen(sql)+1, &st, NULL); if(x != SQLITE_OK) { fprintf(stderr, "%s: could not prepare sql: %s\n", __func__, sqlite3_errstr(x)); goto done; } for(i=0; iid = sqlite3_column_int64(st, 0); if((dst->addr = scamper_addr_resolve(AF_INET6, ptr)) == NULL) { fprintf(stderr, "%s not an ipv6 address\n", ptr); sc_dst_free(dst); goto done; } if(slist_tail_push(addrs, dst) == NULL) { fprintf(stderr, "could not push %s to list\n", ptr); sc_dst_free(dst); goto done; } } } else { sql = "select id, addr from data_dsts"; x = sqlite3_prepare_v2(db, sql, strlen(sql)+1, &st, NULL); if(x != SQLITE_OK) { fprintf(stderr, "%s: could not prepare sql: %s\n", __func__, sqlite3_errstr(x)); goto done; } while((x = sqlite3_step(st)) == SQLITE_ROW) { addr = sqlite3_column_text(st, 1); if((dst = malloc_zero(sizeof(sc_dst_t))) == NULL) { fprintf(stderr, "could not malloc dst %s\n", addr); goto done; } dst->id = sqlite3_column_int64(st, 0); dst->addr = scamper_addr_resolve(AF_INET6, (const char *)addr); if(dst->addr == NULL) { fprintf(stderr, "%s not an ipv6 address\n", addr); sc_dst_free(dst); goto done; } if(slist_tail_push(addrs, dst) == NULL) { fprintf(stderr, "could not push %s to list\n", addr); sc_dst_free(dst); goto done; } } } sqlite3_finalize(st); st = NULL; if((samples = slist_alloc()) == NULL) { fprintf(stderr, "could not alloc samples list\n"); goto done; } if((reboots = slist_alloc()) == NULL) { fprintf(stderr, "could not alloc reboots list\n"); goto done; } sql = "select tx_sec, ipid from data_samples where dst_id=?" "order by tx_sec, ipid"; if((x = sqlite3_prepare_v2(db, sql, strlen(sql)+1, &st, NULL)) != SQLITE_OK) { fprintf(stderr, "%s: could not prepare sql: %s\n", __func__, sqlite3_errstr(x)); goto done; } while((dst = slist_head_pop(addrs)) != NULL) { scamper_addr_tostr(dst->addr, buf, sizeof(buf)); sqlite3_clear_bindings(st); sqlite3_reset(st); sqlite3_bind_int(st, 1, dst->id); while((x = sqlite3_step(st)) == SQLITE_ROW) { tx_sec = sqlite3_column_int64(st, 0); ipid = sqlite3_column_int64(st, 1); if(ipid < 0) continue; if((sample = malloc(sizeof(sc_ipid_t))) == NULL) { fprintf(stderr, "could not malloc sample\n"); goto done; } sample->tx = tx_sec; sample->ipid = ipid; if(slist_tail_push(samples, sample) == NULL) { fprintf(stderr, "could not push sample to list\n"); goto done; } } up_reboots_doone(dst, samples, reboots); while((sample = slist_head_pop(samples)) != NULL) free(sample); if(slist_count(reboots) > 0) { printf("%s", scamper_addr_tostr(dst->addr, buf, sizeof(buf))); while((reboot = slist_head_pop(reboots)) != NULL) { printf(" %u,%u", reboot->left, reboot->right); free(reboot); } printf("\n"); } sc_dst_free(dst); } rc = 0; done: sqlite3_finalize(st); slist_free(reboots); slist_free(samples); slist_free(addrs); return rc; } static int up_init(void) { uint16_t types[] = {SCAMPER_FILE_OBJ_PING}; int typec = sizeof(types) / sizeof(uint16_t); if((ffilter = scamper_file_filter_alloc(types, typec)) == NULL) return -1; return 0; } static void cleanup(void) { if(tree != NULL) patricia_free_cb(tree, (patricia_free_t)sc_dst_free); if(list != NULL) slist_free_cb(list, (slist_free_t)sc_dst_free); if(waiting != NULL) heap_free(waiting, (heap_free_t)sc_wait_free); if(scamper_wb != NULL) scamper_writebuf_free(scamper_wb); if(scamper_lp != NULL) scamper_linepoll_free(scamper_lp, 0); if(decode_wb != NULL) scamper_writebuf_free(decode_wb); if(outfile != NULL) scamper_file_close(outfile); if(decode_in != NULL) scamper_file_close(decode_in); if(ffilter != NULL) scamper_file_filter_free(ffilter); if(logfile != NULL) fclose(logfile); if(st_class != NULL) sqlite3_finalize(st_class); if(db != NULL) sqlite3_close(db); if(srcaddr != NULL) free(srcaddr); if(decode_in_fd != -1) close(decode_in_fd); if(decode_out_fd != -1) close(decode_out_fd); if(scamper_fd != -1) close(scamper_fd); return; } int main(int argc, char *argv[]) { #if defined(DMALLOC) free(malloc(1)); #endif atexit(cleanup); if(check_options(argc, argv) != 0) return -1; if(up_init() != 0) return -1; if(options & OPT_IMPORT) return up_import(); if(options & OPT_REBOOTS) return up_reboots(); return up_data(); } scamper-cvs-20171204/utils/sc_uptime/Makefile.in000644 001751 000000 00000061217 13211200065 021305 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_uptime$(EXEEXT) subdir = utils/sc_uptime ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_uptime_OBJECTS = sc_uptime.$(OBJEXT) ../../utils.$(OBJEXT) \ ../../mjl_heap.$(OBJEXT) ../../mjl_list.$(OBJEXT) \ ../../mjl_patricia.$(OBJEXT) \ ../../scamper/scamper_linepoll.$(OBJEXT) \ ../../scamper/scamper_writebuf.$(OBJEXT) sc_uptime_OBJECTS = $(am_sc_uptime_OBJECTS) sc_uptime_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_uptime_SOURCES) DIST_SOURCES = $(sc_uptime_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_uptime_SOURCES = \ sc_uptime.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_patricia.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c sc_uptime_LDADD = ../../scamper/libscamperfile.la -lsqlite3 man_MANS = sc_uptime.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_uptime/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_uptime/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_heap.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_patricia.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../scamper/$(am__dirstamp): @$(MKDIR_P) ../../scamper @: > ../../scamper/$(am__dirstamp) ../../scamper/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../scamper/$(DEPDIR) @: > ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_linepoll.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_writebuf.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) sc_uptime$(EXEEXT): $(sc_uptime_OBJECTS) $(sc_uptime_DEPENDENCIES) $(EXTRA_sc_uptime_DEPENDENCIES) @rm -f sc_uptime$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_uptime_OBJECTS) $(sc_uptime_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) -rm -f ../../scamper/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_heap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_patricia.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_linepoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_writebuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_uptime.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) -rm -f ../../scamper/$(DEPDIR)/$(am__dirstamp) -rm -f ../../scamper/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_tracediff/.cvsignore000644 001751 000000 00000000056 11600705667 021700 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_tracediff scamper-cvs-20171204/utils/sc_tracediff/Makefile.am000644 001751 000000 00000000463 12177530303 021727 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_tracediff sc_tracediff_SOURCES = \ sc_tracediff.c \ ../../utils.c \ ../../mjl_splaytree.c sc_tracediff_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_tracediff.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_tracediff/sc_tracediff.1000644 001751 000000 00000005477 12577420002 022401 0ustar00mjlwheel000000 000000 .\" .\" sc_tracediff.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2011 University of Waikato .\" All rights reserved .\" .\" $Id: sc_tracediff.1,v 1.6 2015/09/20 02:54:58 mjl Exp $ .\" .Dd April 21, 2011 .Dt SC_TRACEDIFF 1 .Os .Sh NAME .Nm sc_tracediff .Nd display traceroute paths where the path has changed. .Sh SYNOPSIS .Nm .Bk -words .Op Fl a .Op Fl m Ar method .Op Fl n file1.warts file2.warts .Sh DESCRIPTION The .Nm utility displays pairs of traceroutes to a destination where the path has changed. It takes two warts files as input and displays paths where a hop differs by its address. The options are as follows: .Bl -tag -width Ds .It Fl a dump all traceroute pairs regardless of whether they have changed. .It Fl m Ar method specifies the method used to match pairs of traceroutes together. If .Ar dst is specified, traceroutes are matched if the destination IP address of both traces are the same. If .Ar userid is specified, traceroutes are matched if the userid field of both traces are the same. If .Ar dstuserid is specified, traceroutes are matched if the destination IP address and userid fields are the same. By default, the destination IP address is used. .It Fl n names should be reported instead of IP addresses, where possible. .El .Pp .Nm can be useful in network monitoring to identify when a forward IP path has changed. In this scenario, it is recommended that Paris traceroute is used with the same UDP source and destination ports for each execution of scamper so that only paths that have changed are identified, not merely alternate paths visible due to per-flow load-balancing. By default scamper uses a source port based on the process ID, which will change with each execution of scamper. .Sh EXAMPLES The command: .Pp .in +.3i scamper -O warts -o file1.warts -c 'trace -P udp-paris -s 31337' -f list.txt .in -.3i .Pp collects the forward IP paths towards a set of IP addresses found in list.txt using 31337 as the UDP source port value. If the above command is adjusted to subsequently collect file2.warts, then we can identify paths that have subsequently changed with the command: .Pp .in +.3i sc_tracediff file1.warts file2.warts .in -.3i .Pp If Paris traceroute with ICMP probes is preferred, then the following invocation of scamper is appropriate: .Pp .in +.3i scamper -O warts -o file1.warts -c 'trace -P icmp-paris -d 31337' -f list.txt .in -.3i .Pp In this case, scamper uses 31337 as the ICMP checksum value in each probe. .Sh SEE ALSO .Xr scamper 1 , .Rs .%A "B. Augustin" .%A "X. Cuvellier" .%A "B. Orgogozo" .%A "F. Viger" .%A "T. Friedman" .%A "M. Latapy" .%A "C. Magnien" .%A "R. Teixeira" .%T "Avoiding traceroute anomalies with Paris traceroute" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2006" .Re .Sh AUTHOR .Nm was written by Matthew Luckie . scamper-cvs-20171204/utils/sc_tracediff/sc_tracediff.c000644 001751 000000 00000027351 12551363252 022463 0ustar00mjlwheel000000 000000 /* * sc_tracediff * * $Id: sc_tracediff.c,v 1.12 2015/07/15 04:50:50 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2011 The University of Waikato * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_tracediff.c,v 1.12 2015/07/15 04:50:50 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_list.h" #include "scamper_addr.h" #include "scamper_file.h" #include "trace/scamper_trace.h" #include "mjl_splaytree.h" #include "utils.h" #define OPT_NAMES 0x0001 #define OPT_ALLPAIRS 0x0002 #define MATCH_DST 0 #define MATCH_USERID 1 #define MATCH_DSTUSERID 2 typedef struct tracepair { scamper_trace_t *traces[2]; int tracec; splaytree_node_t *node; } tracepair_t; static splaytree_t *pairs = NULL; static char **files = NULL; static int filec = 0; static uint32_t options = 0; static int match = MATCH_DST; static void usage(void) { fprintf(stderr, "usage: sc_tracediff [-an] [-m ] file1.warts file2.warts\n"); return; } static int check_options(int argc, char *argv[]) { int i; while((i = getopt(argc, argv, "am:n?")) != -1) { switch(i) { case 'a': options |= OPT_ALLPAIRS; break; case 'm': if(strcasecmp(optarg, "dst") == 0) match = MATCH_DST; else if(strcasecmp(optarg, "userid") == 0) match = MATCH_USERID; else if(strcasecmp(optarg, "dstuserid") == 0) match = MATCH_DSTUSERID; else return -1; break; case 'n': options |= OPT_NAMES; break; case '?': default: usage(); return -1; } } filec = argc - optind; if(filec != 2) { usage(); return -1; } files = argv + optind; return 0; } static char *addr_toname(const scamper_addr_t *addr, char *buf, size_t len) { struct sockaddr *sa = NULL; struct sockaddr_in in4; struct sockaddr_in6 in6; socklen_t sl; if(SCAMPER_ADDR_TYPE_IS_IPV4(addr)) { sockaddr_compose((struct sockaddr *)&in4, AF_INET, addr->addr, 0); sa = (struct sockaddr *)&in4; } else if(SCAMPER_ADDR_TYPE_IS_IPV6(addr)) { sockaddr_compose((struct sockaddr *)&in6, AF_INET6, addr->addr, 0); sa = (struct sockaddr *)&in6; } if(sa == NULL) return NULL; sl = sockaddr_len(sa); if(getnameinfo(sa, sl, buf, len, NULL, 0, NI_NAMEREQD) != 0) return NULL; return buf; } static char *hop_tostr(const scamper_trace_t *trace, int i, char *buf, size_t *len_out) { scamper_trace_hop_t *hop; char addr[128]; size_t len = *len_out, off = 0; if(ifirsthop-1 || trace->hop_count <= i) { string_concat(buf, len, &off, "-"); goto done; } else if((hop = trace->hops[i]) == NULL) { string_concat(buf, len, &off, "*"); goto done; } if((options & OPT_NAMES) == 0 || addr_toname(hop->hop_addr, addr, sizeof(addr)) == NULL) scamper_addr_tostr(hop->hop_addr, addr, sizeof(addr)); string_concat(buf, len, &off, "%s", addr); if(SCAMPER_TRACE_HOP_IS_ICMP_TTL_EXP(hop) || SCAMPER_TRACE_HOP_IS_ICMP_ECHO_REPLY(hop) || SCAMPER_TRACE_HOP_IS_TCP(hop)) { goto done; } if(hop->hop_addr->type == SCAMPER_ADDR_TYPE_IPV4) { if(hop->hop_icmp_type == ICMP_UNREACH) { if(hop->hop_icmp_code == ICMP_UNREACH_FILTER_PROHIB) string_concat(buf, len, &off, " !X"); else if(hop->hop_icmp_code == ICMP_UNREACH_HOST) string_concat(buf, len, &off, " !H"); else if(hop->hop_icmp_code == ICMP_UNREACH_NEEDFRAG) string_concat(buf, len, &off, " !F"); else if(hop->hop_icmp_code == ICMP_UNREACH_SRCFAIL) string_concat(buf, len, &off, " !S"); else if(hop->hop_icmp_code == ICMP_UNREACH_PROTOCOL) string_concat(buf, len, &off, " !P"); else if(hop->hop_icmp_code == ICMP_UNREACH_NET) string_concat(buf, len, &off, " !N"); else if(hop->hop_icmp_code != ICMP_UNREACH_PORT) string_concat(buf, len, &off, " !<%d>", hop->hop_icmp_code); } else { string_concat(buf, len, &off, " !<%d,%d>", hop->hop_icmp_type, hop->hop_icmp_code); } } else if(hop->hop_addr->type == SCAMPER_ADDR_TYPE_IPV6) { if(hop->hop_icmp_type == ICMP6_DST_UNREACH) { if(hop->hop_icmp_code == ICMP6_DST_UNREACH_ADDR) string_concat(buf, len, &off, " !A"); else if(hop->hop_icmp_code == ICMP6_DST_UNREACH_BEYONDSCOPE) string_concat(buf, len, &off, " !S"); else if(hop->hop_icmp_code == ICMP6_DST_UNREACH_ADMIN) string_concat(buf, len, &off, " !P"); else if(hop->hop_icmp_code == ICMP6_DST_UNREACH_NOROUTE) string_concat(buf, len, &off, " !N"); else if(hop->hop_icmp_code != ICMP6_DST_UNREACH_NOPORT) string_concat(buf, len, &off, " !<%d>", hop->hop_icmp_code); } else if(hop->hop_icmp_type == ICMP6_PACKET_TOO_BIG) { string_concat(buf, len, &off, " !F"); } else { string_concat(buf, len, &off, " !<%d,%d>", hop->hop_icmp_type, hop->hop_icmp_code); } } done: *len_out = off; return buf; } static void tracepair_onremove(tracepair_t *pair) { pair->node = NULL; return; } static void tracepair_free(tracepair_t *pair) { int i; for(i=0; itraces[i] != NULL) scamper_trace_free(pair->traces[i]); free(pair); return; } static int match_dst(const scamper_trace_t *a, const scamper_trace_t *b) { return scamper_addr_cmp(a->dst, b->dst); } static int match_userid(const scamper_trace_t *a, const scamper_trace_t *b) { return b->userid - a->userid; } static int match_dstuserid(const scamper_trace_t *a, const scamper_trace_t *b) { int i; if((i = match_dst(a, b)) != 0) return i; return match_userid(a, b); } static int tracepair_cmp(const tracepair_t *tpa, const tracepair_t *tpb) { static int (*const mf[])(const scamper_trace_t *,const scamper_trace_t *) = { match_dst, match_userid, match_dstuserid, }; const scamper_trace_t *a = NULL, *b = NULL; int i; for(i=0; itraces[i] != NULL) { a = tpa->traces[i]; break; } } assert(i != filec); assert(a != NULL); for(i=0; itraces[i] != NULL) { b = tpb->traces[i]; break; } } assert(i != filec); assert(b != NULL); return mf[match](a, b); } static void tracepair_dump(const tracepair_t *pair) { scamper_trace_t *trace; struct tm *tm; time_t tt; uint8_t min_ttl; uint8_t max_ttl; int i, k; size_t w, ws[2]; char fs[32], a[256], b[256]; /* there needs to be two traces for a pairwise comparison */ if(pair->tracec != 2) return; /* print the header of the traceroute */ trace = pair->traces[0]; for(i=1; itracec; i++) if(scamper_addr_cmp(trace->dst, pair->traces[i]->dst) != 0) break; w = 0; string_concat(a, sizeof(a), &w, "traceroute "); if(i == pair->tracec) string_concat(a, sizeof(a), &w, "from %s ", scamper_addr_tostr(trace->src, b, sizeof(b))); string_concat(a, sizeof(a), &w, "to %s", scamper_addr_tostr(trace->dst, b, sizeof(b))); if(options & OPT_NAMES && addr_toname(trace->dst, b, sizeof(b)) != NULL) string_concat(a, sizeof(a), &w, " (%s)", b); printf("%s\n", a); max_ttl = 0; min_ttl = 0; for(k=0; ktracec; k++) { trace = pair->traces[k]; if(max_ttl < trace->hop_count) max_ttl = trace->hop_count; if(min_ttl == 0 || min_ttl > trace->firsthop) min_ttl = trace->firsthop; } for(k=0; ktracec; k++) { ws[k] = 8; trace = pair->traces[0]; for(i=0; ihop_count; i++) { w = sizeof(a); hop_tostr(trace, i, a, &w); if(w > ws[k]) ws[k] = w; } } snprintf(fs, sizeof(fs), " %%-%ds %%-%ds\n", (int)ws[0], (int)ws[1]); tt = pair->traces[0]->start.tv_sec; tm = localtime(&tt); snprintf(a, sizeof(a), "%02d:%02d:%02d",tm->tm_hour,tm->tm_min,tm->tm_sec); tt = pair->traces[1]->start.tv_sec; tm = localtime(&tt); snprintf(b, sizeof(b), "%02d:%02d:%02d",tm->tm_hour,tm->tm_min,tm->tm_sec); printf(fs, a, b); snprintf(fs, sizeof(fs), "%%2d %%-%ds %%-%ds\n", (int)ws[0], (int)ws[1]); for(i=min_ttl-1; itraces[0], i, a, &ws[0]), hop_tostr(pair->traces[1], i, b, &ws[1])); } return; } static int tracepair_isdiff(const tracepair_t *pair) { scamper_trace_t *a = pair->traces[0]; scamper_trace_t *b = pair->traces[1]; scamper_trace_t *x = NULL; int i, hopc; if(a->hop_count < b->hop_count) hopc = a->hop_count; else hopc = b->hop_count; for(i=0; ihops[i] == NULL || b->hops[i] == NULL) continue; if(scamper_addr_cmp(a->hops[i]->hop_addr, b->hops[i]->hop_addr) != 0) return 1; } if(hopc < a->hop_count) x = a; else if(hopc < b->hop_count) x = b; if(x != NULL) { for(i=hopc; ihop_count; i++) if(x->hops[i] != NULL) return 1; } return 0; } static void tracepair_process(const tracepair_t *pair) { if((options & OPT_ALLPAIRS) || tracepair_isdiff(pair)) tracepair_dump(pair); return; } int main(int argc, char *argv[]) { scamper_file_t *file[2]; scamper_file_filter_t *filter; scamper_trace_t *trace; tracepair_t *pair, fm; uint16_t type = SCAMPER_FILE_OBJ_TRACE; char buf[256]; int i, filec_open; #ifdef _WIN32 WSADATA wsaData; WSAStartup(MAKEWORD(2,2), &wsaData); #endif if(check_options(argc, argv) != 0) goto err; if((filter = scamper_file_filter_alloc(&type, 1)) == NULL) { fprintf(stderr, "could not allocate filter\n"); goto err; } memset(file, 0, sizeof(file)); for(i=0; itraces[i] = trace; pair->tracec = 1; if((pair->node = splaytree_insert(pairs, pair)) == NULL) goto err; } else { if(pair->traces[i] != NULL) { fprintf(stderr, "repeated trace for %s\n", scamper_addr_tostr(trace->dst, buf, sizeof(buf))); goto err; } pair->traces[i] = trace; pair->tracec++; } if(pair->tracec != filec) continue; splaytree_remove_node(pairs, pair->node); tracepair_process(pair); tracepair_free(pair); } } return 0; err: return -1; } scamper-cvs-20171204/utils/sc_tracediff/Makefile.in000644 001751 000000 00000056553 13211200065 021740 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_tracediff$(EXEEXT) subdir = utils/sc_tracediff ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_tracediff_OBJECTS = sc_tracediff.$(OBJEXT) ../../utils.$(OBJEXT) \ ../../mjl_splaytree.$(OBJEXT) sc_tracediff_OBJECTS = $(am_sc_tracediff_OBJECTS) sc_tracediff_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_tracediff_SOURCES) DIST_SOURCES = $(sc_tracediff_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_tracediff_SOURCES = \ sc_tracediff.c \ ../../utils.c \ ../../mjl_splaytree.c sc_tracediff_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_tracediff.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_tracediff/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_tracediff/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_splaytree.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_tracediff$(EXEEXT): $(sc_tracediff_OBJECTS) $(sc_tracediff_DEPENDENCIES) $(EXTRA_sc_tracediff_DEPENDENCIES) @rm -f sc_tracediff$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_tracediff_OBJECTS) $(sc_tracediff_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_splaytree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_tracediff.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_tbitblind/.cvsignore000644 001751 000000 00000000056 12577233207 021724 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_tbitblind scamper-cvs-20171204/utils/sc_tbitblind/Makefile.am000644 001751 000000 00000000533 12577415530 021761 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_tbitblind sc_tbitblind_SOURCES = \ sc_tbitblind.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c sc_tbitblind_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_tbitblind.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_tbitblind/sc_tbitblind.1000644 001751 000000 00000011610 13027351160 022432 0ustar00mjlwheel000000 000000 .\" .\" sc_tbitblind.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2015 Matthew Luckie .\" All rights reserved .\" .\" $Id: sc_tbitblind.1,v 1.5 2016/12/24 01:42:08 mjl Exp $ .\" .Dd September 19, 2015 .Dt SC_TBITBLIND 1 .Os .Sh NAME .Nm sc_tbitblind .Nd scamper driver to test systems for resilience to blind TCP attacks. .Sh SYNOPSIS .Nm .Bk -words .Op Fl r .Op Fl a Ar addressfile .Op Fl A Ar application .Op Fl c Ar completed-file .Op Fl l Ar limit-per-file .Op Fl o Ar output-file .Op Fl O Ar options .Op Fl p Ar scamper-port .Op Fl t Ar log-file .Op Fl T Ar ttl .Op Fl w Ar wait-between .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility provides the ability to connect to a running .Xr scamper 1 instance and use that instance to test systems for resilience to blind TCP attacks, with the output written to a file in warts format. The utility tests a given system for regular TCP behavior, and then tests the system for response to reset, SYN, and data packets that could have come from a blind attacker because the sequence number is not the next sequence number value expected by the receiver (the reset and SYN cases) or the acknowledgment value covers data ahead or behind the receiver's point in their sequence number space (the data cases). The utility also tests the system's response to a connection that advertises support for window scaling, TCP timestamps, and Selective Acknowledgments (SACK). .Pp The options are as follows: .Bl -tag -width Ds .It Fl ? prints a list of command line options and a synopsis of each. .It Fl a Ar addressfile specifies the name of the input file which constists of a sequence of systems to test, one system per line. .It Fl A Ar application specifies the type of application to simulate while testing the system. Options are HTTP and BGP. .It Fl c Ar completed-file specifies the name of a file to record IP addresses that have been tested. .It Fl l Ar limit-per-file specifies the number of tbit objects to record per warts file, before opening a new file and placing new objects. .It Fl o Ar output-file specifies the name of the file to be written. The output file will use the warts format. .It Fl O Ar options allows the behavior of .Nm to be further tailored. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy noshuffle: do not shuffle the order of the input list or the order of the tests. .El .It Fl p Ar scamper-port specifies the port on the local host where .Xr scamper 1 is accepting control socket connections. .It Fl r causes the random number generator used to shuffle tests be seeded. .It Fl t Ar log-file specifies the name of a file to log progress output from .Nm generated at run time. .It Fl T Ar ttl specifies the IP-TTL to use with the blind TCP tests. .It Fl w Ar wait-between specifies the length of time to wait between any two TCP tests to one system. .El .Sh EXAMPLES .Pp Use of this driver requires a scamper instance listening on a port for commands, which has been configured to use the IPFW firewall rules 1 to 100, as follows: .Pp .Dl scamper -P 31337 -F ipfw:1-100 .Pp To test a set of web servers specified in a file named webservers.txt and formatted as follows: .Pp .in +.3i .nf 1,example.com 1263 192.0.2.1 http://www.example.com/ 1,example.com 1263 2001:DB8::1 http://www.example.com/ 1,example.com 1263 2001:DB8::2 https://www.example.com/ .fi .in -.3i .Pp the following command will test all servers for resilience to blind TCP attacks and record raw data into webservers_00.warts, webservers_01.warts, etc: .Pp .Dl sc_tbitblind -a webservers.txt -p 31337 -o webservers .Pp The webservers.txt file is required to be formatted as above. The format is: numeric ID to pass to tbit, a label for the webserver, the size of the object to be fetched, the IP address to contact, and the URL to use. .Pp To test a set of BGP routers specified in bgprouters.txt and formatted as follows: .Pp .in +.3i .nf 192.0.2.2 65000 192.0.2.2 65001 .fi .in -.3i .Pp the following command will test all BGP routers for resilience to blind TCP attacks, without shuffling the test order, waiting 180 seconds between tests, and record raw data into bgprouters_00.warts, bgprouters_01.warts, etc: .Pp .Dl sc_tbitblind -a bgprouters.txt -p 31337 -o bgprouters -A bgp -O noshuffle -w 180 .Pp The bgprouters.txt file is required to be formatted as above. The format of that file is: IP address to establish a BGP session with, and the ASN to use. .Sh SEE ALSO .Rs .%A "M. Luckie" .%A "R. Beverly" .%A "T. Wu" .%A "M. Allman" .%A "k. claffy" .%T "Resilience of Deployed TCP to Blind Attacks" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2015" .Re .Xr scamper 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2json 1 , .Xr warts 5 .Sh AUTHORS .Nm was written by Matthew Luckie . Tiange Wu contributed an initial implementation of the blind in-window TBIT test to scamper, and Robert Beverly contributed support for testing BGP routers. scamper-cvs-20171204/utils/sc_tbitblind/sc_tbitblind.c000644 001751 000000 00000052442 12660436566 022544 0ustar00mjlwheel000000 000000 /* * sc_tbitblind : scamper driver to collect data on receiver response to * : packets that might have been sent by a blind in-window * : attacker. * * Authors : Matthew Luckie, Robert Beverly. * * Copyright (C) 2015 The Regents of the University of California * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_tbitblind.c,v 1.4 2016/02/15 21:04:54 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "tbit/scamper_tbit.h" #include "scamper_file.h" #include "mjl_list.h" #include "mjl_splaytree.h" #include "mjl_heap.h" #include "utils.h" static uint32_t options = 0; static splaytree_t *tree = NULL; static slist_t *list = NULL; static heap_t *heap = NULL; static int scamper_fd = -1; static char *readbuf = NULL; static size_t readbuf_len = 0; static int port = 31337; static char *addressfile = NULL; static char *outfile_name = NULL; static scamper_file_t *outfile = NULL; static int outfile_obj = 0; static int outfile_i = 0; static int ttl = 0; static int wait_between = 0; static int limit = 10000; static int tbit_app = SCAMPER_TBIT_APP_HTTP; static int noshuffle = 0; static scamper_file_filter_t *decode_filter = NULL; static scamper_file_t *decode_in = NULL; static int decode_in_fd = -1; static int decode_out_fd = -1; static int data_left = 0; static char cmd[512]; static int more = 0; static int probing = 0; static FILE *text = NULL; static FILE *comp = NULL; static struct timeval now; static char *methods[] = { "-t blind-rst", "-t blind-rst -o -70000", "-t blind-syn", "-t blind-syn -o -70000", "-t blind-data", "-t blind-data -o 70000", }; static const int methodc = sizeof(methods) / sizeof(char *); #define MODE_ICW 0 #define MODE_BLIND 1 #define MODE_FP 2 #define MODE_LAST 2 typedef struct target { scamper_addr_t *addr; struct timeval next; int mode; union { char *url; uint16_t asn; } un; slist_t *methods; uint16_t sport; heap_node_t *hn; splaytree_node_t *tn; } target_t; #define OPT_HELP 0x0001 #define OPT_ADDRESSFILE 0x0002 #define OPT_OUTFILE 0x0004 #define OPT_PORT 0x0008 #define OPT_TEXT 0x0010 #define OPT_LIMIT 0x0020 #define OPT_COMPLETED 0x0080 #define OPT_RANDOM 0x0100 #define OPT_WAIT 0x0200 #define OPT_OPTIONS 0x0400 #define OPT_APPTYPE 0x0800 #define OPT_TTL 0x1000 /* XXX: need to handle -? */ static void usage(uint32_t opt_mask) { fprintf(stderr, "usage: sc_tbitblind [-?r] [-a addressfile] [-o outfile] [-p port]\n" " [-A app] [-c comp] [-l limit] [-t logfile] [-T ttl]\n" " [-O options] [-w wait]\n"); return; } static int check_options(int argc, char *argv[]) { int ch; long lo; char *opts = "A:a:c:l:o:O:p:rt:T:w:"; char *opt_port = NULL, *opt_text = NULL, *opt_limit = NULL; char *opt_wait = NULL, *opt_comp = NULL; char *opt_apptype = NULL, *opt_ttl = NULL; uint32_t mandatory = OPT_ADDRESSFILE | OPT_OUTFILE | OPT_PORT; while((ch = getopt(argc, argv, opts)) != -1) { switch(ch) { case 'a': options |= OPT_ADDRESSFILE; addressfile = optarg; break; case 'A': options |= OPT_APPTYPE; opt_apptype = optarg; break; case 'c': options |= OPT_COMPLETED; opt_comp = optarg; break; case 'l': options |= OPT_LIMIT; opt_limit = optarg; break; case 'o': options |= OPT_OUTFILE; outfile_name = optarg; break; case 'O': if(strcasecmp(optarg, "noshuffle") == 0) noshuffle = 1; else { usage(OPT_OPTIONS); return -1; } break; case 'p': options |= OPT_PORT; opt_port = optarg; break; case 'r': options |= OPT_RANDOM; break; case 't': options |= OPT_TEXT; opt_text = optarg; break; case 'T': options |= OPT_TTL; opt_ttl = optarg; break; case 'w': options |= OPT_WAIT; opt_wait = optarg; break; case '?': default: usage(0xffffffff); return -1; } } /* these options are mandatory */ if((options & mandatory) != mandatory) { if(options == 0) usage(0); else usage(mandatory); return -1; } /* find out which port scamper can be found listening on */ if(string_tolong(opt_port, &lo) != 0 || lo < 1 || lo > 65535) { usage(OPT_PORT); return -1; } port = lo; if(opt_limit != NULL) { if(string_tolong(opt_limit, &lo) != 0 || lo < 1 || lo > 10000) { usage(OPT_LIMIT); return -1; } limit = lo; } outfile_obj = limit; if(opt_wait != NULL) { if(string_tolong(opt_wait, &lo) != 0 || lo < 1 || lo > 180) { usage(OPT_WAIT); return -1; } wait_between = lo; } if(opt_text != NULL) { if((text = fopen(opt_text, "w")) == NULL) { usage(OPT_TEXT); fprintf(stderr, "could not open %s\n", opt_text); return -1; } } if(opt_apptype != NULL) { if(strcasecmp(opt_apptype, "http") == 0) tbit_app = SCAMPER_TBIT_APP_HTTP; else if(strcasecmp(opt_apptype, "bgp") == 0) tbit_app = SCAMPER_TBIT_APP_BGP; else { usage(OPT_APPTYPE); return -1; } } if(wait_between == 0) { if(tbit_app == SCAMPER_TBIT_APP_HTTP) wait_between = 60; else if(tbit_app == SCAMPER_TBIT_APP_BGP) wait_between = 180; } if(opt_ttl != NULL) { if(string_tolong(opt_ttl, &lo) != 0 || lo < 1 || lo > 255) { usage(OPT_TTL); return -1; } ttl = lo; } if(opt_comp != NULL) { if((comp = fopen(opt_comp, "a")) == NULL) { usage(OPT_COMPLETED); fprintf(stderr, "could not open %s\n", opt_comp); return -1; } } return 0; } static void print(char *format, ...) { va_list ap; char time[32], msg[512]; struct tm *tm; time_t t; va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); t = now.tv_sec; if((tm = localtime(&t)) != NULL) { snprintf(time, sizeof(time), "[%02d:%02d:%02d:%03ld]", tm->tm_hour, tm->tm_min, tm->tm_sec, (long int)now.tv_usec / 1000); } else { snprintf(time, sizeof(time), "[%12ld]", (long int)now.tv_sec); } printf("%s %s", time, msg); if(text != NULL) { fprintf(text, "%s %s", time, msg); fflush(text); } return; } static int target_next_cmp(const void *va, const void *vb) { const target_t *a = va; const target_t *b = vb; return timeval_cmp(&b->next, &a->next); } static int target_addr_cmp(const void *va, const void *vb) { const target_t *a = va; const target_t *b = vb; return scamper_addr_cmp(a->addr, b->addr); } static void target_onremove(void *ptr) { target_t *target = ptr; target->hn = NULL; return; } static void target_free(target_t *target) { if(target == NULL) return; if(tbit_app == SCAMPER_TBIT_APP_HTTP && target->un.url != NULL) free(target->un.url); if(target->hn != NULL) heap_delete(heap, target->hn); if(target->tn != NULL) splaytree_remove_node(tree, target->tn); if(target->addr != NULL) scamper_addr_free(target->addr); if(target->methods != NULL) slist_free(target->methods); free(target); return; } static int do_method(void) { target_t *target; char addr[128]; size_t off = 0; char *m = NULL; int i; if(more < 1) return 0; if((target = heap_head_item(heap)) != NULL && timeval_cmp(&target->next, &now) <= 0) { target = heap_remove(heap); } else if((target = slist_head_pop(list)) != NULL) { if((target->methods = slist_alloc()) == NULL) return -1; for(i=0; imethods, methods[i]) == NULL) return -1; if(noshuffle == 0) slist_shuffle(target->methods); } else { return 0; } if(target->tn == NULL && (target->tn=splaytree_insert(tree,target)) == NULL) { return -1; } if(target->mode == MODE_ICW) m = "-t icw"; else if(target->mode == MODE_BLIND) m = slist_head_pop(target->methods); else if(target->mode == MODE_FP) m = "-t null -w 2 -O tcpts -O sack"; if(m == NULL) return -1; if(tbit_app == SCAMPER_TBIT_APP_HTTP) { if(string_firstof_char(target->un.url, '\'') == NULL) string_concat(cmd,sizeof(cmd),&off, "tbit -u '%s'", target->un.url); else string_concat(cmd,sizeof(cmd),&off, "tbit -u \"%s\"", target->un.url); if(ttl != 0) string_concat(cmd,sizeof(cmd),&off, " -T %d", ttl); } else if(tbit_app == SCAMPER_TBIT_APP_BGP) { string_concat(cmd, sizeof(cmd), &off, "tbit -p bgp -T %d -b %d", ttl == 0 ? 69 : ttl, target->un.asn); } else return -1; string_concat(cmd, sizeof(cmd), &off, " %s -s %d %s\n", m, target->sport, scamper_addr_tostr(target->addr, addr, sizeof(addr))); write_wrap(scamper_fd, cmd, NULL, off); probing++; more--; print("p %d/%d, v %d : %s", probing, splaytree_count(tree), slist_count(list), cmd); return 0; } static int parse_list(char *str, void *param) { char *ip, *url, *asn, *ptr = str; target_t *target; long lo; if(str[0] == '#' || str[0] == '\0') return 0; if(tbit_app == SCAMPER_TBIT_APP_HTTP) { /* position in the list */ while(*ptr != ',' && *ptr != '\0') ptr++; if(*ptr == '\0') return -1; *ptr = '\0'; ptr++; while(*ptr != ' ' && *ptr != '\0') ptr++; if(*ptr == '\0') return -1; ptr++; /* size of the object */ while(*ptr != ' ' && *ptr != '\0') ptr++; if(*ptr == '\0') return -1; *ptr = '\0'; ptr++; ip = ptr; while(*ptr != ' ' && *ptr != '\0') ptr++; if(*ptr == '\0') return -1; *ptr = '\0'; ptr++; url = ptr; /* skip over urls with ' in them */ if(string_firstof_char(url, '\'') != NULL && string_firstof_char(url, '\"') != NULL) return 0; if((target = malloc_zero(sizeof(target_t))) == NULL || (target->un.url = strdup(url)) == NULL) return -1; target->addr = scamper_addr_resolve(AF_UNSPEC, ip); target->sport = 1050; } else if(tbit_app == SCAMPER_TBIT_APP_BGP) { /* ipaddress asn */ ip = ptr; while(*ptr != ' ' && *ptr != '\0') ptr++; *ptr = '\0'; ptr++; asn = ptr; while(*ptr != ' ' && *ptr != '\0') ptr++; *ptr = '\0'; if(string_tolong(asn, &lo) != 0 || lo < 1 || lo > 65535) return -1; if((target = malloc_zero(sizeof(target_t))) == NULL) return -1; target->addr = scamper_addr_resolve(AF_UNSPEC, ip); target->sport = 1050; target->un.asn = lo; target->mode = MODE_BLIND; } else return -1; if(splaytree_insert(tree, target) == NULL || slist_tail_push(list, target) == NULL) return -1; return 0; } /* * do_scamperconnect * * allocate socket and connect to scamper process listening on the port * specified. */ static int do_scamperconnect(void) { struct sockaddr_in sin; struct in_addr in; inet_aton("127.0.0.1", &in); sockaddr_compose((struct sockaddr *)&sin, AF_INET, &in, port); if((scamper_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { fprintf(stderr, "could not allocate new socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sin, sizeof(sin)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } return 0; } /* * do_scamperread * * the fd for the scamper process is marked as readable, so do a read * on it. */ static int do_scamperread(void) { ssize_t rc; uint8_t uu[64]; char *ptr, *head; char buf[512]; void *tmp; long l; size_t i, uus, linelen; if((rc = read(scamper_fd, buf, sizeof(buf))) > 0) { if(readbuf_len == 0) { if((readbuf = memdup(buf, rc)) == NULL) { return -1; } readbuf_len = rc; } else { if((tmp = realloc(readbuf, readbuf_len + rc)) != NULL) { readbuf = tmp; memcpy(readbuf+readbuf_len, buf, rc); readbuf_len += rc; } else return -1; } } else if(rc == 0) { close(scamper_fd); scamper_fd = -1; } else if(errno == EINTR || errno == EAGAIN) { return 0; } else { fprintf(stderr, "could not read: errno %d\n", errno); return -1; } /* process whatever is in the readbuf */ if(readbuf_len == 0) { goto done; } head = readbuf; for(i=0; i 0) { uus = sizeof(uu); if(uudecode_line(head, linelen, uu, &uus) != 0) { fprintf(stderr, "could not uudecode_line\n"); goto err; } if(uus != 0) write_wrap(decode_out_fd, uu, NULL, uus); data_left -= (linelen + 1); } /* if the scamper process is asking for more tasks, give it more */ else if(linelen == 4 && strncasecmp(head, "MORE", linelen) == 0) { if(more != 0) { fprintf(stderr, "lost syncrhonisation\n"); goto err; } more++; } /* new piece of data */ else if(linelen > 5 && strncasecmp(head, "DATA ", 5) == 0) { l = strtol(head+5, &ptr, 10); if(*ptr != '\n' || l < 1) { head[linelen] = '\0'; fprintf(stderr, "could not parse %s\n", head); goto err; } data_left = l; } /* feedback letting us know that the command was accepted */ else if(linelen >= 2 && strncasecmp(head, "OK", 2) == 0) { /* err, nothing to do */ } /* feedback letting us know that the command was not accepted */ else if(linelen == 3 && strncasecmp(head, "ERR", 3) == 0) { goto err; } else { head[linelen] = '\0'; fprintf(stderr, "unknown response '%s'\n", head); goto err; } head = &readbuf[i+1]; } } if(head != &readbuf[readbuf_len]) { readbuf_len = &readbuf[readbuf_len] - head; ptr = memdup(head, readbuf_len); free(readbuf); readbuf = ptr; } else { readbuf_len = 0; free(readbuf); readbuf = NULL; } done: return 0; err: return -1; } /* * do_files * * open a socketpair that can be used to feed warts data into one end and * have the scamper_file routines decode it via the other end. * * also open a file to send the binary warts data file to. */ static int do_files(void) { uint16_t types[] = {SCAMPER_FILE_OBJ_TBIT}; int pair[2]; if((decode_filter = scamper_file_filter_alloc(types, 1)) == NULL) { return -1; } /* * setup a socketpair that is used to decode warts from a binary input. * pair[0] is used to write to the file, while pair[1] is used by * the scamper_file_t routines to parse the warts data. */ if(socketpair(AF_UNIX, SOCK_STREAM, 0, pair) != 0) { return -1; } decode_in_fd = pair[0]; decode_out_fd = pair[1]; if((decode_in = scamper_file_openfd(decode_in_fd,NULL,'r',"warts")) == NULL) { return -1; } if(fcntl_set(decode_in_fd, O_NONBLOCK) == -1) { return -1; } return 0; } static int process_tbit(target_t *target, scamper_tbit_t *tbit) { char buf[128]; int rc = -1; target->sport++; if(target->mode == MODE_BLIND) { if(slist_count(target->methods) == 0) target->mode++; } else { target->mode++; } if(target->mode > MODE_LAST) goto completed; /* wait before we try again, by default a minute */ timeval_add_s(&target->next, &now, wait_between); if((target->hn = heap_insert(heap, target)) == NULL) { fprintf(stderr, "process_tbit: could not insert into heap"); goto done; } rc = 0; done: scamper_tbit_free(tbit); return rc; completed: if(comp != NULL) { fprintf(comp, "%s\n", scamper_addr_tostr(target->addr,buf,sizeof(buf))); fflush(comp); } target_free(target); scamper_tbit_free(tbit); return 0; } static int do_decoderead(void) { scamper_tbit_t *tbit = NULL; target_t *target, findme; void *data; uint16_t type; char buf[1024]; int rc; if(scamper_file_read(decode_in, decode_filter, &type, &data) != 0) { fprintf(stderr, "do_decoderead: scamper_file_read errno %d\n", errno); return -1; } if(data == NULL) { return 0; } probing--; /* rotate the file if necessary */ if(outfile_obj >= limit) { if(outfile != NULL) { scamper_file_close(outfile); outfile = NULL; } outfile_obj = 0; snprintf(buf, sizeof(buf), "%s_%02d.warts", outfile_name, outfile_i++); if((outfile = scamper_file_open(buf, 'w', "warts")) == NULL) return -1; } if(type == SCAMPER_FILE_OBJ_TBIT) { tbit = (scamper_tbit_t *)data; findme.addr = tbit->dst; if(scamper_file_write_tbit(outfile, tbit) != 0) return -1; outfile_obj++; } else return -1; if((target = splaytree_find(tree, &findme)) == NULL) { fprintf(stderr, "do_decoderead: could not find dst %s\n", scamper_addr_tostr(findme.addr, buf, sizeof(buf))); goto err; } if(tbit != NULL) rc = process_tbit(target, tbit); else rc = -1; return rc; err: if(tbit != NULL) scamper_tbit_free(tbit); return -1; } static void cleanup(void) { if(tree != NULL) { splaytree_free(tree, NULL); tree = NULL; } if(list != NULL) { slist_free(list); list = NULL; } if(heap != NULL) { heap_free(heap, NULL); heap = NULL; } if(decode_in != NULL) { scamper_file_close(decode_in); decode_in = NULL; } if(decode_filter != NULL) { scamper_file_filter_free(decode_filter); decode_filter = NULL; } if(text != NULL) { fclose(text); text = NULL; } if(outfile != NULL) { scamper_file_close(outfile); outfile = NULL; } return; } int main(int argc, char *argv[]) { struct timeval tv, *tv_ptr; target_t *target; fd_set rfds; int nfds; #if defined(DMALLOC) free(malloc(1)); #endif atexit(cleanup); if(check_options(argc, argv) != 0) return -1; if((tree = splaytree_alloc(target_addr_cmp)) == NULL) return -1; if((heap = heap_alloc(target_next_cmp)) == NULL) return -1; heap_onremove(heap, target_onremove); if((list = slist_alloc()) == NULL) return -1; if(file_lines(addressfile, parse_list, NULL) != 0) return -1; splaytree_empty(tree, NULL); if((options & OPT_RANDOM) != 0) { random_seed(); if(noshuffle == 0) slist_shuffle(list); } if(do_scamperconnect() != 0) return -1; if(do_files() != 0) return -1; /* attach */ snprintf(cmd, sizeof(cmd), "attach\n"); if(write_wrap(scamper_fd, cmd, NULL, 7) != 0) { fprintf(stderr, "could not attach to scamper process\n"); return -1; } for(;;) { nfds = 0; FD_ZERO(&rfds); if(scamper_fd < 0 && decode_in_fd < 0) break; if(scamper_fd >= 0) { FD_SET(scamper_fd, &rfds); if(nfds < scamper_fd) nfds = scamper_fd; } if(decode_in_fd >= 0) { FD_SET(decode_in_fd, &rfds); if(nfds < decode_in_fd) nfds = decode_in_fd; } if(splaytree_count(tree) == 0 && slist_count(list) == 0) break; tv_ptr = NULL; gettimeofday_wrap(&tv); if(more > 0) { if(slist_count(list) > 0) { memset(&tv, 0, sizeof(tv)); tv_ptr = &tv; } else if((target = heap_head_item(heap)) != NULL) { if(timeval_cmp(&tv, &target->next) <= 0) timeval_diff_tv(&tv, &tv, &target->next); else memset(&tv, 0, sizeof(tv)); tv_ptr = &tv; } } if(select(nfds+1, &rfds, NULL, NULL, tv_ptr) < 0) { if(errno == EINTR) continue; break; } gettimeofday_wrap(&now); if(FD_ISSET(decode_in_fd, &rfds)) { if(do_decoderead() != 0) return -1; } if(FD_ISSET(scamper_fd, &rfds)) { if(do_scamperread() != 0) return -1; } if(more > 0) { do_method(); } } return 0; } scamper-cvs-20171204/utils/sc_tbitblind/Makefile.in000644 001751 000000 00000057406 13211200065 021762 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_tbitblind$(EXEEXT) subdir = utils/sc_tbitblind ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_tbitblind_OBJECTS = sc_tbitblind.$(OBJEXT) ../../utils.$(OBJEXT) \ ../../mjl_heap.$(OBJEXT) ../../mjl_list.$(OBJEXT) \ ../../mjl_splaytree.$(OBJEXT) sc_tbitblind_OBJECTS = $(am_sc_tbitblind_OBJECTS) sc_tbitblind_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_tbitblind_SOURCES) DIST_SOURCES = $(sc_tbitblind_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_tbitblind_SOURCES = \ sc_tbitblind.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c sc_tbitblind_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_tbitblind.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_tbitblind/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_tbitblind/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_heap.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_splaytree.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_tbitblind$(EXEEXT): $(sc_tbitblind_OBJECTS) $(sc_tbitblind_DEPENDENCIES) $(EXTRA_sc_tbitblind_DEPENDENCIES) @rm -f sc_tbitblind$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_tbitblind_OBJECTS) $(sc_tbitblind_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_heap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_splaytree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_tbitblind.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_speedtrap/.cvsignore000644 001751 000000 00000000056 12171630447 021735 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_speedtrap scamper-cvs-20171204/utils/sc_speedtrap/Makefile.am000644 001751 000000 00000001001 13052255413 021753 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_speedtrap sc_speedtrap_SOURCES = \ sc_speedtrap.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c sc_speedtrap_CFLAGS = @PTHREAD_CFLAGS@ sc_speedtrap_LDFLAGS = @PTHREAD_CFLAGS@ sc_speedtrap_LDADD = ../../scamper/libscamperfile.la @PTHREAD_LIBS@ man_MANS = sc_speedtrap.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_speedtrap/sc_speedtrap.1000644 001751 000000 00000010462 13020627573 022475 0ustar00mjlwheel000000 000000 .\" .\" sc_speedtrap.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2013 The Regents of the University of California .\" All rights reserved .\" .\" $Id: sc_speedtrap.1,v 1.5 2016/12/03 20:47:55 mjl Exp $ .\" .Dd August 18, 2013 .Dt SC_SPEEDTRAP 1 .Os .Sh NAME .Nm sc_speedtrap .Nd scamper driver to resolve aliases for a set of IPv6 interfaces. .Sh SYNOPSIS .Nm .Bk -words .Op Fl I .Op Fl a Ar addressfile .Op Fl A Ar aliasfile .Op Fl l Ar logfile .Op Fl o Ar outfile .Op Fl p Ar port .Op Fl s Ar stop .Op Fl S Ar skipfile .Op Fl U Ar unix-socket .Ek .Pp .Nm .Bk -words .Op Fl d Ar dump .Op Ar .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility provides the ability to connect to a running .Xr scamper 1 instance and use it to collect data for alias resolution of a set of IPv6 addresses using the "speedtrap" technique. .Nm induces each address to send fragmented ICMP echo replies, with the goal of obtaining an incrementing Identifier (ID) field in the fragmentation header. If two addresses are aliases, they will return ICMP echo replies with a monotonically increasing value in the ID field because the ID field is implemented as a counter shared amongst all interfaces. .Nm implements a scalable algorithm to quickly determine which addresses are aliases. Further information about the algorithm is found in the "see also" section. The supported options to .Nm are as follows: .Bl -tag -width Ds .It Fl a Ar addressfile specifies the name of the input file which consists of a sequence of IPv6 addresses to resolve for aliases, one address per line. .It Fl A Ar aliasfile specifies the name of an output file which will receive pairs of aliases, one address-pair per line. .It Fl d Ar dump specifies the number identifying an analysis task to conduct. Valid dump numbers are 1-3. See the examples section. .It Fl I specifies that the addressfile contains only interfaces known to send fragmentation headers containing incrementing values. .It Fl l Ar logfile specifies the name of a file to log output from .Nm generated at run time. .It Fl o Ar outfile specifies the name of the output file to be written. The output file will use the warts format. .It Fl p Ar port specifies the port on the local host where .Xr scamper 1 is accepting control socket connections. .It Fl s Ar stop specifies the step at which .Nm should halt. The available steps are "classify", "descend", "overlap", "descend2", "candidates", and "ally". .It Fl S Ar skipfile specifies the name of an input file which contains known aliases that do not need to be resolved, one address-pair per line. .It Fl U Ar unix-socket specifies the name of a unix domain socket where .Xr scamper 1 is accepting control socket connections. .El .\"""""""""""" .Sh EXAMPLES Given a set of IPv6 addresses contained in a file named addressfile.txt and a scamper process listening on port 31337 configured to probe at 30 packets per second started as follows: .Pp .Dl scamper -P 31337 -p 30 .Pp the following command will resolve the addresses for aliases, store the raw measurements in outfile1.warts, and record the interface-pairs that are aliases in aliases.txt: .Pp .Dl sc_speedtrap -p 31337 -a addressfile.txt -o outfile1.warts -A aliases.txt .Pp The next example is useful when inferring aliases from multiple vantage points. Given the output of aliases.txt from a previous measurement, the following will resolve the addressfile for aliases, skipping those in aliases.txt, and appending the new aliases to aliases.txt: .Pp .Dl sc_speedtrap -p 31337 -a addressfile.txt -o outfile2.warts -A aliases.txt -S aliases.txt .Pp To obtain a transitive closure of routers from an input warts file: .Pp .Dl sc_speedtrap -d 1 outfile1.warts .Pp To obtain a list of the interfaces probed and their IPID behaviour: .Pp .Dl sc_speedtrap -d 2 outfile1.warts .Pp To obtain statistics of how many probes are sent in each stage, and how long the stage takes: .Pp .Dl sc_speedtrap -d 3 outfile1.warts .\"""""""""""" .Sh SEE ALSO .Rs .%A "M. Luckie" .%A "R. Beverly" .%A "W. Brinkmeyer" .%A "k. claffy" .%T "Speedtrap: Internet-scale IPv6 Alias Resolution" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2013" .Re .Xr scamper 1 , .Xr sc_ally 1 , .Xr sc_ipiddump 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2text 1 , .Xr sc_warts2json 1 , .Sh AUTHORS .Nm was written by Matthew Luckie . scamper-cvs-20171204/utils/sc_speedtrap/sc_speedtrap.c000644 001751 000000 00000201626 13130625635 022562 0ustar00mjlwheel000000 000000 /* * sc_speedtrap * * $Id: sc_speedtrap.c,v 1.40 2017/07/10 07:24:13 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2013-2015 The Regents of the University of California * Copyright (C) 2016 The University of Waikato * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_speedtrap.c,v 1.40 2017/07/10 07:24:13 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #ifdef HAVE_PTHREAD #include #endif #include "scamper_addr.h" #include "scamper_list.h" #include "ping/scamper_ping.h" #include "dealias/scamper_dealias.h" #include "scamper_linepoll.h" #include "scamper_writebuf.h" #include "scamper_file.h" #include "mjl_list.h" #include "mjl_splaytree.h" #include "mjl_heap.h" #include "utils.h" #define OPT_HELP 0x0001 #define OPT_ADDRFILE 0x0002 #define OPT_OUTFILE 0x0004 #define OPT_PORT 0x0008 #define OPT_STOP 0x0010 #define OPT_LOG 0x0020 #define OPT_UNIX 0x0040 #define OPT_SKIPFILE 0x0080 #define OPT_ALIASFILE 0x0100 #define OPT_DUMP 0x0200 #define OPT_INCR 0x0400 #define OPT_THREADC 0x0800 #define OPT_ALL 0xffff typedef struct sc_targetipid sc_targetipid_t; typedef struct sc_skippair { scamper_addr_t *a; scamper_addr_t *b; } sc_skippair_t; /* * sc_target * * keep a set of IPID samples for a given interface address. */ typedef struct sc_target { scamper_addr_t *addr; /* the interface being probed */ slist_t *samples; /* collected samples */ sc_targetipid_t *last; /* last IPID sample */ void *data; /* pointer to targetset or classify state */ int attempt; /* how many times we've tried this probe */ splaytree_node_t *tree_node; } sc_target_t; /* * sc_targetipid * * an IPID sample, including tx and rx timestamps. */ struct sc_targetipid { sc_target_t *target; struct timeval tx, rx; uint32_t ipid; }; /* * sc_targetset * * state kept when probing a set of addresses that we need to detangle */ typedef struct sc_targetset { slist_t *targets; slist_node_t *next; struct timeval min, max; slist_t *blocked; dlist_node_t *node; int attempt; slist_node_t *s1, *s2; } sc_targetset_t; typedef struct sc_wait { struct timeval tv; union { void *ptr; sc_target_t *target; sc_targetset_t *targetset; } un; } sc_wait_t; typedef struct sc_addr2ptr { scamper_addr_t *addr; void *ptr; } sc_addr2ptr_t; /* * sc_routerset * * keep a set of routers. the tree contains sc_addr2ptr_t, the list * contains a list of routers. */ typedef struct sc_routerset { splaytree_t *tree; dlist_t *list; } sc_routerset_t; typedef struct sc_dump { char *descr; int (*proc_ping)(const scamper_ping_t *ping); int (*proc_ally)(const scamper_dealias_t *dealias); void (*finish)(void); } sc_dump_t; /* declare dump functions used for dump_funcs[] below */ static int process_1_ping(const scamper_ping_t *); static int process_1_ally(const scamper_dealias_t *); static void finish_1(void); static int process_2_ping(const scamper_ping_t *); static int process_3_ping(const scamper_ping_t *); static int process_3_ally(const scamper_dealias_t *); static void finish_3(void); static uint32_t options = 0; static char *addressfile = NULL; static unsigned int port = 0; static char *unix_name = NULL; static splaytree_t *targets = NULL; static slist_t *probelist = NULL; static slist_t *incr = NULL; static heap_t *waiting = NULL; static splaytree_t *skiptree = NULL; static char *skipfile = NULL; static int scamper_fd = -1; static scamper_linepoll_t *scamper_lp = NULL; static scamper_writebuf_t *scamper_wb = NULL; static char *outfile_name = NULL; static scamper_file_t *outfile = NULL; static scamper_file_filter_t *ffilter = NULL; static scamper_file_t *decode_in = NULL; static int decode_in_fd = -1; static int decode_out_fd = -1; static scamper_writebuf_t *decode_wb = NULL; static int data_left = 0; static int more = 0; static int probing = 0; static int mode = 0; static struct timeval now; static FILE *logfile = NULL; static FILE *aliasfile = NULL; static int fudge = 65535; static slist_t *descend = NULL; static dlist_t *overlap_act = NULL; static slist_t *candidates = NULL; static const char *step_names[] = {"classify","descend","overlap", "descend2","candidates","ally"}; static int step_namec = sizeof(step_names)/sizeof(char *); static char *stop_stepname = NULL; static int stop_stepid = 0; static uint32_t *pairwise_uint32 = NULL; static sc_targetipid_t **pairwise_tipid = NULL; static int pairwise_max = 0; #ifdef HAVE_PTHREAD static pthread_mutex_t targets_sn_mutex; static slist_t *targets_sn = NULL; static pthread_mutex_t rset_mutex; static long threadc = -1; #endif static int dump_id = 0; static int dump_stop = 0; static char **dump_files; static int dump_filec = 0; static const sc_dump_t dump_funcs[] = { {NULL, NULL, NULL, NULL}, {"dump transitive closure", process_1_ping, process_1_ally, finish_1}, {"dump interface classification", process_2_ping, NULL, NULL}, {"summary table of per-stage statistics", process_3_ping, process_3_ally, finish_3}, }; static int dump_funcc = sizeof(dump_funcs) / sizeof(sc_dump_t); #define MODE_CLASSIFY 0 #define MODE_DESCEND 1 #define MODE_OVERLAP 2 #define MODE_DESCEND2 3 #define MODE_CANDIDATES 4 #define MODE_ALLY 5 static void usage(uint32_t opt_mask) { int i; fprintf(stderr, "usage: sc_speedtrap [-a addressfile] [-o outfile] [-p port] [-U unix]\n" " [-I] [-A aliasfile] [-l log] [-s stop] [-S skipfile]\n" #ifdef HAVE_PTHREAD " [-t thread-count]\n" #endif "\n" " sc_speedtrap [-d dump] file1.warts .. fileN.warts\n" "\n"); if(opt_mask == 0) fprintf(stderr, " sc_speedtrap -?\n\n"); if(opt_mask & OPT_HELP) fprintf(stderr, " -? give an overview of the usage of sc_speedtrap\n"); if(opt_mask & OPT_ADDRFILE) fprintf(stderr, " -a input addressfile\n"); if(opt_mask & OPT_DUMP) { fprintf(stderr, " -d dump selection\n"); for(i=1; i 0) { usage(OPT_ADDRFILE|OPT_OUTFILE|OPT_PORT|OPT_UNIX); return -1; } if(options & OPT_PORT) { if(string_tolong(opt_port, &lo) != 0 || lo < 1 || lo > 65535) { usage(OPT_PORT); return -1; } port = lo; } else if(options & OPT_UNIX) { unix_name = opt_unix; } #ifdef HAVE_PTHREAD if(opt_threadc != NULL) { if(string_tolong(opt_threadc, &lo) != 0 || lo < 0) { usage(OPT_THREADC); return -1; } threadc = lo; } #endif if(opt_aliasfile != NULL) { if(gethostname(hostname, sizeof(hostname)) != 0) { usage(OPT_ALIASFILE); fprintf(stderr, "could not gethostname\n"); return -1; } if((aliasfile = fopen(opt_aliasfile, "a")) == NULL) { usage(OPT_ALIASFILE); fprintf(stderr, "could not open %s\n", opt_aliasfile); return -1; } gettimeofday_wrap(&now); tt = now.tv_sec; fprintf(aliasfile, "# %s %s", hostname, asctime(localtime(&tt))); fflush(aliasfile); } if(stop_stepname != NULL) { for(i=0; i dump_funcc) { usage(OPT_DUMP); return -1; } dump_id = lo; dump_files = argv + optind; dump_filec = argc - optind; } return 0; } static int mode_ok(int m) { if(stop_stepname == NULL) return 1; if(m > stop_stepid) return 0; return 1; } static int slist_count_cmp(const slist_t *a, const slist_t *b) { int al = slist_count(a), bl = slist_count(b); if(al > bl) return -1; if(al < bl) return 1; if(a < b) return -1; if(a > b) return 1; return 0; } static int tree_to_slist(void *ptr, void *entry) { slist_tail_push((slist_t *)ptr, entry); return 0; } static void hms(int x, int *h, int *m, int *s) { *s = x % 60; x -= *s; x /= 60; *m = x % 60; x -= *m; *h = x / 60; return; } static void logprint(char *format, ...) { va_list ap; char msg[131072]; if(logfile != NULL) { va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); fprintf(logfile, "%ld: %s", (long int)now.tv_sec, msg); fflush(logfile); } return; } static int uint32_cmp(const void *va, const void *vb) { const uint32_t a = *((uint32_t *)va); const uint32_t b = *((uint32_t *)vb); if(a < b) return -1; if(a > b) return 1; return 0; } static int uint32_find(uint32_t *a, size_t len, uint32_t u32) { if(bsearch(&u32, a, len, sizeof(uint32_t), uint32_cmp) != NULL) return 1; return 0; } static int ipid_inseq3(uint64_t a, uint64_t b, uint64_t c) { if(a == b || b == c || a == c) return 0; if(a > b) b += 0x100000000ULL; if(a > c) c += 0x100000000ULL; if(a > b || b > c) return 0; if(fudge != 0 && (b - a > fudge || c - b > fudge)) return 0; return 1; } static int ipid_incr(uint32_t *ipids, int ipidc) { int i; if(ipidc < 3) return 0; for(i=2; iaddr != NULL) scamper_addr_free(a2p->addr); free(a2p); return; } static sc_addr2ptr_t *sc_addr2ptr_find(splaytree_t *tree, scamper_addr_t *addr) { sc_addr2ptr_t fm; fm.addr = addr; return splaytree_find(tree, &fm); } static int sc_addr2ptr_add(splaytree_t *tree, scamper_addr_t *addr, void *ptr) { sc_addr2ptr_t *a2p = NULL; if((a2p = malloc_zero(sizeof(sc_addr2ptr_t))) == NULL) goto err; a2p->addr = scamper_addr_use(addr); a2p->ptr = ptr; if(splaytree_insert(tree, a2p) == NULL) goto err; return 0; err: if(a2p != NULL) sc_addr2ptr_free(a2p); return -1; } static int sc_addr2ptr_cmp(const sc_addr2ptr_t *a, const sc_addr2ptr_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static int ping_read(const scamper_ping_t *ping, uint32_t *ipids, int *ipidc, int *replyc) { scamper_ping_reply_t *reply; int i, maxipidc = *ipidc; *ipidc = 0; *replyc = 0; for(i=0; iping_sent; i++) { if((reply = ping->ping_replies[i]) == NULL) continue; if(SCAMPER_PING_REPLY_IS_ICMP_ECHO_REPLY(reply) == 0) continue; (*replyc)++; if(reply->flags & SCAMPER_PING_REPLY_FLAG_REPLY_IPID) { if(*ipidc == maxipidc) return -1; ipids[*ipidc] = reply->reply_ipid32; (*ipidc)++; } } return 0; } static splaytree_t *d1_tree = NULL; static int process_1_ping(const scamper_ping_t *ping) { uint32_t ipids[10]; slist_t *list = NULL; int ipidc, replyc; if(ping->userid != 0) return 0; ipidc = sizeof(ipids) / sizeof(uint32_t); if(ping_read(ping, ipids, &ipidc, &replyc) != 0) return -1; if(ipid_incr(ipids, ipidc) == 0) return 0; if(d1_tree == NULL && (d1_tree = splaytree_alloc((splaytree_cmp_t)sc_addr2ptr_cmp)) == NULL) return -1; if(sc_addr2ptr_find(d1_tree, ping->dst) != NULL) return 0; if((list = slist_alloc()) == NULL || slist_tail_push(list, scamper_addr_use(ping->dst)) == NULL || sc_addr2ptr_add(d1_tree, ping->dst, list) != 0) goto err; return 0; err: if(list != NULL) slist_free_cb(list, (slist_free_t)scamper_addr_free); return -1; } static int process_1_ally(const scamper_dealias_t *dealias) { const scamper_dealias_ally_t *ally = dealias->data; sc_addr2ptr_t *a2p_a, *a2p_b, *a2p_x; slist_t *list_a, *list_b, *list_x; scamper_addr_t *a = ally->probedefs[0].dst; scamper_addr_t *b = ally->probedefs[1].dst; scamper_addr_t *x; if(dealias->result != SCAMPER_DEALIAS_RESULT_ALIASES) return 0; a2p_a = sc_addr2ptr_find(d1_tree, a); a2p_b = sc_addr2ptr_find(d1_tree, b); if(a2p_a != NULL && a2p_b != NULL) { list_a = a2p_a->ptr; list_b = a2p_b->ptr; if(list_a == list_b) return 0; while((x = slist_head_pop(list_b)) != NULL) { if(slist_tail_push(list_a, x) == NULL) goto err; a2p_x = sc_addr2ptr_find(d1_tree, x); a2p_x->ptr = list_a; } slist_free(list_b); } else if(a2p_a != NULL) { list_a = a2p_a->ptr; if(slist_tail_push(list_a, scamper_addr_use(b)) == NULL || sc_addr2ptr_add(d1_tree, b, list_a) != 0) goto err; } else if(a2p_b != NULL) { list_b = a2p_b->ptr; if(slist_tail_push(list_b, scamper_addr_use(a)) == NULL || sc_addr2ptr_add(d1_tree, a, list_b) != 0) goto err; } else { if((list_x = slist_alloc()) == NULL || slist_tail_push(list_x, scamper_addr_use(a)) == NULL || slist_tail_push(list_x, scamper_addr_use(b)) == NULL || sc_addr2ptr_add(d1_tree, a, list_x) != 0 || sc_addr2ptr_add(d1_tree, b, list_x) != 0) goto err; } return 0; err: return -1; } static void finish_1(void) { scamper_addr_t *addr; sc_addr2ptr_t *a2p; slist_t *a2ps = NULL; slist_t *sets = NULL; slist_t *addrs = NULL; slist_t *last; char buf[128]; int x; if((a2ps = slist_alloc()) == NULL || (sets = slist_alloc()) == NULL) return; splaytree_inorder(d1_tree, tree_to_slist, a2ps); splaytree_free(d1_tree, NULL); while((a2p = slist_head_pop(a2ps)) != NULL) { slist_tail_push(sets, a2p->ptr); a2p->ptr = NULL; sc_addr2ptr_free(a2p); } slist_free(a2ps); last = NULL; slist_qsort(sets, (slist_cmp_t)slist_count_cmp); while((addrs = slist_head_pop(sets)) != NULL) { if(last == addrs) continue; slist_qsort(addrs, (slist_cmp_t)scamper_addr_human_cmp); x = 0; while((addr = slist_head_pop(addrs)) != NULL) { if(x != 0) printf(" "); printf("%s", scamper_addr_tostr(addr, buf, sizeof(buf))); scamper_addr_free(addr); x++; } printf("\n"); slist_free(addrs); last = addrs; } slist_free(sets); return; } static int process_2_ping(const scamper_ping_t *ping) { uint32_t ipids[10]; int ipidc, replyc; char buf[64]; if(ping->userid != 0) { dump_stop = 1; return 0; } ipidc = sizeof(ipids) / sizeof(uint32_t); if(ping_read(ping, ipids, &ipidc, &replyc) != 0) return -1; scamper_addr_tostr(ping->dst, buf, sizeof(buf)); if(ipidc == 0) { if(replyc == 0) printf("%s unresponsive\n", buf); else if(replyc == 1) printf("%s gone-silent\n", buf); else printf("%s no-frags\n", buf); } else if(ipidc < 3) printf("%s insuff-ipids\n", buf); else if(ipid_incr(ipids, ipidc) == 0) printf("%s random\n", buf); else printf("%s incr\n", buf); return 0; } static int d3_states_probec[6]; static struct timeval d3_states_first[6]; static struct timeval d3_states_last[6]; static int process_3_ping(const scamper_ping_t *ping) { uint32_t id = ping->userid; if(timeval_cmp(&d3_states_first[id], &ping->start) > 0 || d3_states_first[id].tv_sec == 0) timeval_cpy(&d3_states_first[id], &ping->start); if(timeval_cmp(&d3_states_last[id], &ping->start) < 0) timeval_cpy(&d3_states_last[id], &ping->start); d3_states_probec[id] += ping->ping_sent; return 0; } static int process_3_ally(const scamper_dealias_t *dealias) { uint32_t id = 5; d3_states_probec[id] += dealias->probec; if(timeval_cmp(&d3_states_first[id], &dealias->start) > 0 || d3_states_first[id].tv_sec == 0) timeval_cpy(&d3_states_first[id], &dealias->start); if(timeval_cmp(&d3_states_last[id], &dealias->start) < 0) timeval_cpy(&d3_states_last[id], &dealias->start); return 0; } static void finish_3(void) { int h, m, s, i, sum_time = 0, sum_probes = 0; struct timeval tv; for(i=0; i<6; i++) { timeval_diff_tv(&tv, &d3_states_first[i], &d3_states_last[i]); hms(tv.tv_sec, &h, &m, &s); assert((h * 3600) + (m * 60) + s == tv.tv_sec); printf("%d: %d %d:%02d:%02d\n", i, d3_states_probec[i], h, m, s); sum_time += tv.tv_sec; sum_probes += d3_states_probec[i]; } hms(sum_time, &h, &m, &s); printf("total: %d %d:%02d:%02d\n", sum_probes, h, m, s); return; } static int sc_wait_target(struct timeval *tv, sc_target_t *target) { sc_wait_t *w; if((w = malloc_zero(sizeof(sc_wait_t))) == NULL) return -1; timeval_cpy(&w->tv, tv); w->un.target = target; if(heap_insert(waiting, w) == NULL) return -1; return 0; } static int sc_wait_targetset(struct timeval *tv, sc_targetset_t *targetset) { sc_wait_t *w; if((w = malloc_zero(sizeof(sc_wait_t))) == NULL) return -1; timeval_cpy(&w->tv, tv); w->un.targetset = targetset; if(heap_insert(waiting, w) == NULL) return -1; return 0; } static void sc_wait_free(sc_wait_t *w) { free(w); return; } static void sc_target_set(sc_target_t *tg, int attempt, void *data) { tg->attempt = attempt; tg->data = data; return; } static int sc_wait_cmp(const sc_wait_t *a, const sc_wait_t *b) { return timeval_cmp(&b->tv, &a->tv); } static int sc_target_addr_cmp(const sc_target_t *a, const sc_target_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static int sc_target_ipid_cmp(const sc_target_t *a, const sc_target_t *b) { assert(a->last != NULL); assert(b->last != NULL); if(a->last->ipid > b->last->ipid) return -1; if(a->last->ipid < b->last->ipid) return 1; return 0; } static sc_target_t *sc_target_findtree(scamper_addr_t *addr) { sc_target_t fm; fm.addr = addr; return splaytree_find(targets, &fm); } static void sc_target_detachtree(sc_target_t *tg) { if(tg->tree_node != NULL) { splaytree_remove_node(targets, tg->tree_node); tg->tree_node = NULL; } return; } static sc_targetipid_t *sc_target_sample(sc_target_t *tg, sc_targetipid_t *x) { sc_targetipid_t *ti; if((ti = memdup(x, sizeof(sc_targetipid_t))) == NULL) { fprintf(stderr, "%s: could not memdup sample: %s\n", __func__, strerror(errno)); return NULL; } ti->target = tg; if(slist_tail_push(tg->samples, ti) == NULL) { fprintf(stderr, "%s: could not push sample: %s\n", __func__, strerror(errno)); free(ti); return NULL; } tg->last = ti; return ti; } static sc_target_t *sc_target_free(sc_target_t *tg) { if(tg == NULL) return NULL; if(tg->samples != NULL) slist_free_cb(tg->samples, free); if(tg->tree_node != NULL) splaytree_remove_node(targets, tg->tree_node); if(tg->addr != NULL) scamper_addr_free(tg->addr); free(tg); return NULL; } static int sc_target_new(char *addr, void *param) { splaytree_t *tree = param; sc_target_t *target = NULL; scamper_addr_t *a; if(addr[0] == '#' || addr[0] == '\0') return 0; if((a = scamper_addr_resolve(AF_INET6, addr)) == NULL) { fprintf(stderr, "could not resolve '%s'\n", addr); goto err; } /* * make sure the address is in 2000::/3 * and is not already in the probelist */ if(scamper_addr_isunicast(a) != 1 || splaytree_find(tree, a) != NULL) { scamper_addr_free(a); return 0; } /* make a note that the address is in the list to be probed */ if(splaytree_insert(tree, a) == NULL) goto err; scamper_addr_use(a); if((target = malloc_zero(sizeof(sc_target_t))) == NULL || (target->samples = slist_alloc()) == NULL) goto err; target->addr = a; a = NULL; if(slist_tail_push(probelist, target) == NULL || ((options & OPT_INCR) && slist_tail_push(incr, target) == NULL)) { fprintf(stderr, "could push '%s'\n", addr); goto err; } return 0; err: if(a != NULL) scamper_addr_free(a); if(target != NULL) { if(target->addr != NULL) scamper_addr_free(target->addr); free(target); } return -1; } static int sc_skippair_cmp(const sc_skippair_t *a, const sc_skippair_t *b) { int rc; if((rc = scamper_addr_cmp(a->a, b->a)) != 0) return rc; return scamper_addr_cmp(a->b, b->b); } static int sc_skippair_test(scamper_addr_t *a, scamper_addr_t *b) { sc_skippair_t fm; if(scamper_addr_cmp(a, b) < 0) { fm.a = a; fm.b = b; } else { fm.a = b; fm.b = a; } if(splaytree_find(skiptree, &fm) == NULL) return 0; return 1; } static void sc_skippair_free(sc_skippair_t *pair) { if(pair == NULL) return; if(pair->a != NULL) scamper_addr_free(pair->a); if(pair->b != NULL) scamper_addr_free(pair->b); free(pair); return; } static int sc_skippair_add(scamper_addr_t *a, scamper_addr_t *b) { sc_skippair_t *pair = NULL; if((pair = malloc_zero(sizeof(sc_skippair_t))) == NULL) return -1; if(scamper_addr_cmp(a, b) < 0) { pair->a = scamper_addr_use(a); pair->b = scamper_addr_use(b); } else { pair->a = scamper_addr_use(b); pair->b = scamper_addr_use(a); } if(splaytree_insert(skiptree, pair) == NULL) { sc_skippair_free(pair); return -1; } return 0; } static int sc_skippair_new(char *line, void *param) { scamper_addr_t *a = NULL, *b = NULL; char *astr, *bstr, *ptr; if(line[0] == '#' || line[0] == '\0') return 0; astr = ptr = line; while(*ptr != '\0' && isspace((int)*ptr) == 0) ptr++; if(*ptr == '\0') goto err; *ptr = '\0'; ptr++; while(isspace((int)*ptr) != 0) ptr++; bstr = ptr; while(*ptr != '\0' && isspace((int)*ptr) == 0) ptr++; *ptr = '\0'; if((a = scamper_addr_resolve(AF_INET6, astr)) == NULL) { fprintf(stderr, "could not resolve '%s'\n", astr); goto err; } if((b = scamper_addr_resolve(AF_INET6, bstr)) == NULL) { fprintf(stderr, "could not resolve '%s'\n", bstr); goto err; } if(sc_skippair_test(a, b) == 0 && sc_skippair_add(a, b) != 0) goto err; scamper_addr_free(a); scamper_addr_free(b); return 0; err: if(a != NULL) scamper_addr_free(a); if(b != NULL) scamper_addr_free(b); return -1; } static int sc_targetipid_tx_cmp(const sc_targetipid_t *a, const sc_targetipid_t *b) { return timeval_cmp(&a->tx, &b->tx); } static void sc_targetset_print(const sc_targetset_t *ts) { sc_target_t *tg; slist_node_t *ss; size_t off = 0; char a[64], buf[131072]; string_concat(buf, sizeof(buf), &off, "%p:", ts); for(ss=slist_head_node(ts->targets); ss != NULL; ss=slist_node_next(ss)) { tg = slist_node_item(ss); string_concat(buf, sizeof(buf), &off, " %s", scamper_addr_tostr(tg->addr, a, sizeof(a))); } logprint("%s\n", buf); return; } static int sc_targetset_targetcount_cmp(const sc_targetset_t *a, const sc_targetset_t *b) { int ac = slist_count(a->targets); int bc = slist_count(b->targets); if(ac > bc) return -1; if(ac < bc) return 1; return 0; } static int sc_targetset_min_cmp(const sc_targetset_t *a, const sc_targetset_t *b) { return timeval_cmp(&a->min, &b->min); } static void sc_targetset_free(sc_targetset_t *ts) { if(ts == NULL) return; if(ts->targets != NULL) slist_free(ts->targets); if(ts->blocked != NULL) slist_free(ts->blocked); free(ts); return; } static sc_targetset_t *sc_targetset_alloc(void) { sc_targetset_t *ts; if((ts = malloc_zero(sizeof(sc_targetset_t))) == NULL || (ts->targets = slist_alloc()) == NULL || (ts->blocked = slist_alloc()) == NULL) { sc_targetset_free(ts); return NULL; } return ts; } static void sc_routerset_free(sc_routerset_t *set) { if(set == NULL) return; if(set->tree != NULL) splaytree_free(set->tree, (splaytree_free_t)sc_addr2ptr_free); if(set->list != NULL) dlist_free(set->list); free(set); return; } static sc_routerset_t *sc_routerset_alloc(void) { sc_routerset_t *set = NULL; if((set = malloc_zero(sizeof(sc_routerset_t))) == NULL || (set->tree = splaytree_alloc((splaytree_cmp_t)sc_addr2ptr_cmp)) == NULL || (set->list = dlist_alloc()) == NULL) { sc_routerset_free(set); return NULL; } return set; } static int sc_routerset_do(sc_routerset_t *set, sc_target_t *a, sc_target_t *b) { sc_addr2ptr_t *a2ts, *a2ts_a, *a2ts_b; sc_targetset_t *ts, *tsa, *tsb; sc_target_t *tg; a2ts_a = sc_addr2ptr_find(set->tree, a->addr); a2ts_b = sc_addr2ptr_find(set->tree, b->addr); if(a2ts_a != NULL && a2ts_b != NULL) { tsa = a2ts_a->ptr; tsb = a2ts_b->ptr; if(tsa != tsb) { while((tg = slist_head_pop(tsb->targets)) != NULL) { if(slist_tail_push(tsa->targets, tg) == NULL) return -1; a2ts = sc_addr2ptr_find(set->tree, tg->addr); a2ts->ptr = tsa; } dlist_node_pop(set->list, tsb->node); sc_targetset_free(tsb); } } else if(a2ts_a != NULL) { ts = a2ts_a->ptr; if(slist_tail_push(ts->targets, b) == NULL || sc_addr2ptr_add(set->tree, b->addr, ts) != 0) return -1; } else if(a2ts_b != NULL) { ts = a2ts_b->ptr; if(slist_tail_push(ts->targets, a) == NULL || sc_addr2ptr_add(set->tree, a->addr, ts) != 0) return -1; } else { if((ts = sc_targetset_alloc()) == NULL || (ts->node = dlist_tail_push(set->list, ts)) == NULL || slist_tail_push(ts->targets, a) == NULL || slist_tail_push(ts->targets, b) == NULL || sc_addr2ptr_add(set->tree, a->addr, ts) != 0 || sc_addr2ptr_add(set->tree, b->addr, ts) != 0) return -1; } return 0; } static int sample_overlap(const sc_targetipid_t *a, const sc_targetipid_t *b) { int rc = timeval_cmp(&a->tx, &b->tx); if(rc < 0) { if(timeval_cmp(&a->rx, &b->tx) <= 0) return 0; } else if(rc > 0) { if(timeval_cmp(&b->rx, &a->tx) <= 0) return 0; } return 1; } static int pairwise_test(sc_targetipid_t **tis, int tc, uint32_t *pairwise_u32) { sc_targetipid_t *ti, *st[2][2]; sc_target_t *x = tis[0]->target; int si, sj, ipidc = 0; int i, rc = 0; st[0][0] = NULL; st[0][1] = NULL; st[1][0] = NULL; st[1][1] = NULL; for(i=0; iipid) != 0) return 0; pairwise_u32[ipidc++] = ti->ipid; qsort(pairwise_u32, ipidc, sizeof(uint32_t), uint32_cmp); if(ti->target == x) { si = 0; sj = 1; } else { si = 1; sj = 0; } if(st[si][1] == NULL || st[sj][1] == NULL) goto next; if(timeval_cmp(&st[si][1]->tx, &st[sj][1]->tx) > 0) { if(ipid_inseq3(st[sj][1]->ipid, st[si][1]->ipid, ti->ipid) == 0 && sample_overlap(st[sj][1], st[si][1]) == 0 && sample_overlap(st[si][1], ti) == 0) return 0; goto next; } if(sample_overlap(st[si][1], st[sj][1]) || sample_overlap(st[sj][1], ti)) { if(sample_overlap(st[sj][1], ti) && st[sj][0] != NULL && timeval_cmp(&st[si][1]->tx, &st[sj][0]->tx) < 0 && sample_overlap(st[si][1], st[sj][0]) == 0 && ipid_inseq3(st[si][1]->ipid, st[sj][0]->ipid, ti->ipid) == 0) return 0; goto next; } if(ipid_inseq3(st[si][1]->ipid, st[sj][1]->ipid, ti->ipid) == 1) rc = 1; else return 0; next: st[si][0] = st[si][1]; st[si][1] = ti; } return rc; } static int pairwise(sc_target_t *ta, sc_target_t *tb) { slist_node_t *ss; size_t len; int tc; tc = slist_count(ta->samples) + slist_count(tb->samples); if(tc > pairwise_max) { len = tc * sizeof(sc_targetipid_t *); if(realloc_wrap((void **)&pairwise_tipid, len) != 0) return -1; len = tc * sizeof(uint32_t); if(realloc_wrap((void **)&pairwise_uint32, len) != 0) return -1; pairwise_max = tc; } tc = 0; for(ss=slist_head_node(ta->samples); ss!=NULL; ss=slist_node_next(ss)) pairwise_tipid[tc++] = slist_node_item(ss); for(ss=slist_head_node(tb->samples); ss!=NULL; ss=slist_node_next(ss)) pairwise_tipid[tc++] = slist_node_item(ss); array_qsort((void **)pairwise_tipid, tc, (array_cmp_t)sc_targetipid_tx_cmp); return pairwise_test(pairwise_tipid, tc, pairwise_uint32); } #ifdef HAVE_PTHREAD static void *pairwise_all_thread(void *param) { sc_routerset_t *rset = param; sc_targetipid_t **pairwise_tipid = NULL; uint32_t *pairwise_uint32 = NULL; int pairwise_max = 0; int rset_mutex_held = 0; slist_node_t *sa, *sb, *ss; sc_target_t *ta, *tb; slist_t *list; size_t len; int tc; if((list = slist_alloc()) == NULL) return NULL; for(;;) { pthread_mutex_lock(&targets_sn_mutex); for(;;) { if((sa = slist_head_pop(targets_sn)) == NULL) break; ta = slist_node_item(sa); if(slist_count(ta->samples) > 0) break; } pthread_mutex_unlock(&targets_sn_mutex); if(sa == NULL) break; for(sb=slist_node_next(sa); sb != NULL; sb=slist_node_next(sb)) { tb = slist_node_item(sb); if(slist_count(tb->samples) == 0) continue; tc = slist_count(ta->samples) + slist_count(tb->samples); if(tc > pairwise_max) { len = tc * sizeof(sc_targetipid_t *); if(realloc_wrap((void **)&pairwise_tipid, len) != 0) goto done; len = tc * sizeof(uint32_t); if(realloc_wrap((void **)&pairwise_uint32, len) != 0) goto done; pairwise_max = tc; } tc = 0; for(ss=slist_head_node(ta->samples); ss!=NULL; ss=slist_node_next(ss)) pairwise_tipid[tc++] = slist_node_item(ss); for(ss=slist_head_node(tb->samples); ss!=NULL; ss=slist_node_next(ss)) pairwise_tipid[tc++] = slist_node_item(ss); array_qsort((void **)pairwise_tipid, tc, (array_cmp_t)sc_targetipid_tx_cmp); if(pairwise_test(pairwise_tipid, tc, pairwise_uint32) != 0 && slist_tail_push(list, tb) == NULL) goto done; } if(slist_count(list) > 0) { /* so merge the addresses into a router */ pthread_mutex_lock(&rset_mutex); rset_mutex_held = 1; while((tb = slist_head_pop(list)) != NULL) if(sc_routerset_do(rset, ta, tb) != 0) goto done; pthread_mutex_unlock(&rset_mutex); rset_mutex_held = 0; } } done: if(rset_mutex_held != 0) pthread_mutex_unlock(&rset_mutex); if(pairwise_tipid != NULL) free(pairwise_tipid); if(pairwise_uint32 != NULL) free(pairwise_uint32); if(list != NULL) slist_free(list); return NULL; } #endif static int pairwise_all(slist_t *targets, slist_t *sets) { sc_routerset_t *rset = NULL; slist_node_t *sa, *sb; sc_target_t *ta, *tb; sc_targetset_t *ts; #if defined(HAVE_PTHREAD) pthread_t *threads = NULL; int targets_sn_mutex_ok = 0; int rset_mutex_ok = 0; long i, threadn; #endif #if defined(HAVE_PTHREAD) && defined(_SC_NPROCESSORS_ONLN) if(threadc == -1) { if((i = sysconf(_SC_NPROCESSORS_ONLN)) < 1) threadc = 1; else threadc = i; } #endif if((rset = sc_routerset_alloc()) == NULL) goto err; #if defined(HAVE_PTHREAD) if(threadc < 2) { #endif for(sa=slist_head_node(targets); sa != NULL; sa=slist_node_next(sa)) { ta = slist_node_item(sa); if(slist_count(ta->samples) == 0) continue; for(sb=slist_node_next(sa); sb != NULL; sb=slist_node_next(sb)) { tb = slist_node_item(sb); if(slist_count(tb->samples) == 0) continue; if(pairwise(ta, tb) != 1) continue; if(sc_routerset_do(rset, ta, tb) != 0) goto err; } } #if defined(HAVE_PTHREAD) } else { /* construct a list of slist_node_t pointing to targets */ if((targets_sn = slist_alloc()) == NULL) goto err; for(sa=slist_head_node(targets); sa != NULL; sa=slist_node_next(sa)) slist_tail_push(targets_sn, sa); /* create a thread pool to work over the targets */ if((threads = malloc(sizeof(pthread_t) * threadc)) == NULL) goto err; if(pthread_mutex_init(&targets_sn_mutex, NULL) != 0) goto err; targets_sn_mutex_ok = 1; if(pthread_mutex_init(&rset_mutex, NULL) != 0) goto err; rset_mutex_ok = 1; for(threadn=0; threadnlist)) != NULL) { sc_targetset_print(ts); if(slist_tail_push(sets, ts) == NULL) goto err; } sc_routerset_free(rset); return 0; err: if(rset != NULL) sc_routerset_free(rset); #if defined(HAVE_PTHREAD) if(threads != NULL) { for(i=0; imin.tv_sec, (int)ts->min.tv_usec, ts->max.tv_sec, (int)ts->max.tv_usec); for(so=slist_head_node(ts->targets); so != NULL; so=slist_node_next(so)) { tg = slist_node_item(so); ti = slist_node_item(slist_tail_node(tg->samples)); logprint("%d.%06d %d.%06d %s %08x\n", ti->tx.tv_sec, (int)ti->tx.tv_usec, ti->rx.tv_sec, (int)ti->rx.tv_usec, scamper_addr_tostr(tg->addr, buf, sizeof(buf)), ti->ipid); } } return; } static void sc_targetset_nextpair(sc_targetset_t *ts) { sc_target_t *t1, *t2; for(;;) { if(ts->s1 == NULL) { ts->s1 = slist_head_node(ts->targets); ts->s2 = slist_node_next(ts->s1); } else { if((ts->s2 = slist_node_next(ts->s2)) == NULL) { if((ts->s1 = slist_node_next(ts->s1)) == NULL || (ts->s2 = slist_node_next(ts->s1)) == NULL) { ts->s1 = ts->s2 = NULL; } } } if(ts->s1 == NULL) break; t1 = slist_node_item(ts->s1); t2 = slist_node_item(ts->s2); if(sc_skippair_test(t1->addr, t2->addr) != 0) continue; if(pairwise(t1, t2) == 1) break; } ts->attempt = 0; return; } static int test_ping6(sc_target_t *target, char *cmd, size_t len) { size_t off = 0; char buf[64]; string_concat(cmd, len, &off, "ping -O dl -U %d -c 6 -s 1300 -M 1280 %s\n", mode, scamper_addr_tostr(target->addr, buf, sizeof(buf))); return off; } static int test_ping1(sc_target_t *target, char *cmd, size_t len) { size_t off = 0; char buf[64]; string_concat(cmd, len, &off, "ping -O dl -O tbt -U %d -c 2 -o 1 -s 1300 -M 1280 %s\n", mode, scamper_addr_tostr(target->addr, buf, sizeof(buf))); return off; } static sc_target_t *target_classify(void) { return slist_head_pop(probelist); } static sc_target_t *target_descend(void) { return slist_head_pop(probelist); } static sc_target_t *target_overlap(void) { sc_targetset_t *ts, *tt; sc_target_t *tg; dlist_node_t *dn; slist_node_t *sn; for(;;) { if((ts = slist_head_pop(probelist)) == NULL) return NULL; for(dn=dlist_head_node(overlap_act); dn != NULL; dn=dlist_node_next(dn)) { tt = dlist_node_item(dn); if(timeval_cmp(&ts->min, &tt->max) < 0) break; } if(dn == NULL) break; if(slist_tail_push(tt->blocked, ts) == NULL) return NULL; } if((ts->node = dlist_tail_push(overlap_act, ts)) == NULL) return NULL; slist_qsort(ts->targets, (slist_cmp_t)sc_target_ipid_cmp); sn = slist_head_node(ts->targets); tg = slist_node_item(sn); sc_target_set(tg, 0, ts); ts->next = slist_node_next(sn); return tg; } static sc_target_t *target_descend2(void) { return slist_head_pop(probelist); } static sc_target_t *target_candidates(void) { sc_targetset_t *ts; sc_target_t *tg; if((ts = slist_head_pop(probelist)) == NULL) return NULL; slist_qsort(ts->targets, (slist_cmp_t)sc_target_ipid_cmp); ts->s1 = slist_head_node(ts->targets); ts->s2 = NULL; tg = slist_node_item(ts->s1); sc_target_set(tg, 0, ts); return tg; } static sc_targetset_t *targetset_ally(void) { sc_targetset_t *ts; for(;;) { if((ts = slist_head_pop(probelist)) == NULL) break; sc_targetset_nextpair(ts); if(ts->s1 != NULL) return ts; sc_targetset_free(ts); } return NULL; } static int do_method_ping(void) { static int (*const test_func[])(sc_target_t *, char *, size_t) = { test_ping6, test_ping1, test_ping1, test_ping1, test_ping1, }; static sc_target_t * (*const target_func[])(void) = { target_classify, target_descend, target_overlap, target_descend2, target_candidates, }; sc_target_t *tg; sc_wait_t *w; char buf[128]; size_t off; if((w = heap_head_item(waiting)) != NULL && timeval_cmp(&now, &w->tv) >= 0) { heap_remove(waiting); tg = w->un.target; sc_wait_free(w); } else if((tg = target_func[mode]()) == NULL) return 0; if((tg->tree_node = splaytree_insert(targets, tg)) == NULL) { fprintf(stderr, "could not add %s to tree\n", scamper_addr_tostr(tg->addr, buf, sizeof(buf))); return -1; } if((off = test_func[mode](tg, buf, sizeof(buf))) == -1) { fprintf(stderr, "something went wrong\n"); return -1; } write_wrap(scamper_fd, buf, NULL, off); probing++; more--; logprint("p %d, w %d, l %d : %s", probing, heap_count(waiting), slist_count(probelist), buf); return 0; } static int do_method_ally(void) { sc_targetset_t *ts; sc_target_t *tg; sc_wait_t *w; char cmd[192], addr[64]; size_t off = 0; if((w = heap_head_item(waiting)) != NULL && timeval_cmp(&now, &w->tv) >= 0) { heap_remove(waiting); ts = w->un.targetset; sc_wait_free(w); } else if((ts = targetset_ally()) == NULL) return 0; tg = slist_node_item(ts->s1); if((tg->tree_node = splaytree_insert(targets, tg)) == NULL) { fprintf(stderr, "could not add %s to tree\n", scamper_addr_tostr(tg->addr, addr, sizeof(addr))); return -1; } sc_target_set(tg, 0, ts); string_concat(cmd, sizeof(cmd), &off, "dealias -U %d -m ally -W 1000 -p '%s' %s", mode, "-P icmp-echo -s 1300 -M 1280", scamper_addr_tostr(tg->addr, addr, sizeof(addr))); tg = slist_node_item(ts->s2); string_concat(cmd, sizeof(cmd), &off, " %s\n", scamper_addr_tostr(tg->addr, addr, sizeof(addr))); write_wrap(scamper_fd, cmd, NULL, off); probing++; more--; logprint("p %d, w %d, l %d : %s", probing, heap_count(waiting), slist_count(probelist), cmd); return 0; } static int do_method(void) { int rc; if(more < 1) return 0; if(mode != MODE_ALLY) rc = do_method_ping(); else rc = do_method_ally(); return rc; } static int isdone(void) { if(splaytree_count(targets) != 0 || slist_count(probelist) != 0 || heap_count(waiting) != 0) return 0; return 1; } static int finish_classify(void) { slist_node_t *sn; sc_target_t *target; /* * can only move beyond classification stage if there is nothing * left to probe */ if(isdone() == 0) return 0; /* * can only move into descend mode if speedtrap is told to continue * after classification stage */ if(mode_ok(MODE_DESCEND) == 0) return 0; mode = MODE_DESCEND; /* put all the targets on the probelist, with their state re-set */ for(sn=slist_head_node(incr); sn != NULL; sn=slist_node_next(sn)) { target = slist_node_item(sn); sc_target_set(target, 0, NULL); slist_tail_push(probelist, target); } /* probe in order of IPIDs observed */ slist_qsort(probelist, (slist_cmp_t)sc_target_ipid_cmp); if((descend = slist_alloc()) == NULL) return -1; return 0; } static int reply_classify(sc_target_t *target, sc_targetipid_t *p, uint16_t ipidc, uint16_t rxd) { char addr[64]; uint16_t u16; scamper_addr_tostr(target->addr, addr, sizeof(addr)); /* no responses at all: unresponsive */ if(rxd == 0) { logprint("%s unresponsive\n", addr); sc_target_free(target); goto done; } /* less than three IPID samples, sort of unresponsive */ if(ipidc < 3) { logprint("%s ipidc %d\n", addr, ipidc); sc_target_free(target); goto done; } /* check for an incrementing sequence: any break and we're done */ for(u16=0; u16+2 < ipidc; u16++) { if(ipid_inseq3(p[u16].ipid, p[u16+1].ipid, p[u16+2].ipid) == 0) { logprint("%s not inseq %d\n", addr, u16); sc_target_free(target); goto done; } } logprint("%s incr\n", addr); if(sc_target_sample(target, &p[ipidc-1]) == NULL) return -1; slist_tail_push(incr, target); done: return finish_classify(); } static int finish_descend(void) { sc_targetipid_t *ti; sc_targetset_t *ts; struct timeval tv; /* can only move beyond descend stage if there is nothing left to probe */ if(isdone() == 0) return 0; /* * can only move into descend mode if speedtrap is told to continue * after descend stage */ if(mode_ok(MODE_OVERLAP) == 0) return 0; mode = MODE_OVERLAP; slist_qsort(descend, (slist_cmp_t)sc_targetipid_tx_cmp); ts = NULL; while((ti = slist_head_pop(descend)) != NULL) { if(ts == NULL || timeval_cmp(&tv, &ti->tx) <= 0) { timeval_cpy(&tv, &ti->rx); if((ts = sc_targetset_alloc()) == NULL || slist_tail_push(probelist, ts) == NULL) return -1; timeval_cpy(&ts->min, &ti->tx); timeval_cpy(&ts->max, &ti->rx); } else { if(timeval_cmp(&ts->max, &ti->rx) < 0) timeval_cpy(&ts->max, &ti->rx); } slist_tail_push(ts->targets, ti->target); } slist_free(descend); descend = NULL; overlap_dump(); return 0; } static int reply_descend(sc_target_t *target, sc_targetipid_t *ipids, uint16_t ipidc, uint16_t rxd) { sc_targetipid_t *ti; struct timeval tv; if(ipidc == 0) { if(target->attempt >= 2) goto done; target->attempt++; timeval_add_s(&tv, &now, 1); if(sc_wait_target(&tv, target) != 0) return -1; return 0; } if((ti = sc_target_sample(target, &ipids[0])) == NULL) return -1; if(slist_tail_push(descend, ti) == NULL) return -1; done: return finish_descend(); } static int finish_overlap(void) { sc_target_t *target; slist_node_t *sn; /* can only move beyond overlap stage if there is nothing left to probe */ if(isdone() == 0) return 0; /* * can only move into descend2 mode if speedtrap is told to continue * after overlap stage */ if(mode_ok(MODE_DESCEND2) == 0) return 0; mode = MODE_DESCEND2; for(sn=slist_head_node(incr); sn != NULL; sn=slist_node_next(sn)) { target = slist_node_item(sn); sc_target_set(target, 0, NULL); if(target->last != NULL) slist_tail_push(probelist, target); } slist_qsort(probelist, (slist_cmp_t)sc_target_ipid_cmp); return 0; } static int reply_overlap(sc_target_t *target, sc_targetipid_t *ipids, uint16_t ipidc, uint16_t rxd) { sc_targetipid_t *ti; sc_targetset_t *ts, *tt; sc_target_t *tg; struct timeval tv; if(ipidc == 0) { if(target->attempt >= 2) goto done; target->attempt++; timeval_add_s(&tv, &now, 1); if(sc_wait_target(&tv, target) != 0) return -1; return 0; } if((ti = sc_target_sample(target, &ipids[0])) == NULL) return -1; done: ts = target->data; if(ts->next != NULL) { tg = slist_node_item(ts->next); sc_target_set(tg, 0, ts); ts->next = slist_node_next(ts->next); timeval_add_s(&tv, &now, 1); if(sc_wait_target(&tv, tg) != 0) return -1; } else { if(slist_count(ts->blocked) > 0) { while((tt = slist_head_pop(ts->blocked)) != NULL) slist_tail_push(probelist, tt); slist_qsort(probelist, (slist_cmp_t)sc_targetset_min_cmp); } dlist_node_pop(overlap_act, ts->node); sc_targetset_free(ts); } return finish_overlap(); } static int finish_descend2(void) { sc_targetset_t *ts; slist_t *list = NULL; int tc; if(isdone() == 0) return 0; if(mode_ok(MODE_CANDIDATES) == 0) goto done; mode = MODE_CANDIDATES; if((list = slist_alloc()) == NULL || pairwise_all(incr, list) != 0) goto err; while((ts = slist_head_pop(list)) != NULL) { tc = slist_count(ts->targets); if(slist_tail_push(tc > 3 ? probelist : candidates, ts) == NULL) goto err; } if(slist_count(probelist) == 0) { if(mode_ok(MODE_ALLY) == 0) goto done; mode = MODE_ALLY; slist_concat(probelist, candidates); } else { slist_qsort(probelist, (slist_cmp_t)sc_targetset_targetcount_cmp); } done: if(list != NULL) slist_free(list); return 0; err: if(list != NULL) slist_free(list); return -1; } static int reply_descend2(sc_target_t *target, sc_targetipid_t *ipids, uint16_t ipidc, uint16_t rxd) { struct timeval tv; if(ipidc == 0 && target->attempt < 2) { target->attempt++; timeval_add_s(&tv, &now, 1); if(sc_wait_target(&tv, target) != 0) return -1; return 0; } if(ipidc > 0 && sc_target_sample(target, &ipids[0]) == NULL) return -1; return finish_descend2(); } static int finish_candidates(void) { sc_targetset_t *ts; slist_node_t *sn; if(isdone() == 0) return 0; if(mode_ok(MODE_ALLY) == 0) return 0; mode = MODE_ALLY; while((ts = slist_head_pop(candidates)) != NULL) { if(slist_count(ts->targets) > 3) { if(pairwise_all(ts->targets, probelist) != 0) return -1; sc_targetset_free(ts); } else { if(slist_tail_push(probelist, ts) == NULL) return -1; } } slist_qsort(probelist, (slist_cmp_t)sc_targetset_targetcount_cmp); for(sn=slist_head_node(probelist); sn != NULL; sn=slist_node_next(sn)) sc_targetset_print(slist_node_item(sn)); return 0; } static int reply_candidates(sc_target_t *target, sc_targetipid_t *ipids, uint16_t ipidc, uint16_t rxd) { sc_targetipid_t *ti = NULL; sc_targetset_t *ts = target->data; sc_target_t *tg = NULL, *t1, *t2; slist_node_t *s2 = NULL; struct timeval tv; timeval_add_s(&tv, &now, 1); if(ipidc == 0) { if(target->attempt < 2) { target->attempt++; if(sc_wait_target(&tv, target) != 0) return -1; return 0; } } else { if((ti = sc_target_sample(target, &ipids[0])) == NULL) return -1; } t1 = ts->s1 != NULL ? slist_node_item(ts->s1) : NULL; t2 = ts->s2 != NULL ? slist_node_item(ts->s2) : NULL; if(target == t2 && ti != NULL && pairwise(t1, t2) == 1) { tg = t1; } else { /* advance to the next t2, if available */ if(ts->s2 == NULL) s2 = slist_node_next(ts->s1); else s2 = slist_node_next(ts->s2); while(s2 != NULL) { if(pairwise(t1, slist_node_item(s2)) == 1) break; s2 = slist_node_next(s2); } if(s2 != NULL) { ts->s2 = s2; tg = slist_node_item(s2); } else { ts->s1 = slist_node_next(ts->s1); ts->s2 = NULL; if(slist_node_next(ts->s1) == NULL) ts->s1 = NULL; if(ts->s1 != NULL) tg = slist_node_item(ts->s1); } } if(tg != NULL) { sc_target_set(tg, 0, ts); if(sc_wait_target(&tv, tg) != 0) return -1; } else { slist_tail_push(candidates, ts); } return finish_candidates(); } static int do_decoderead_ping(scamper_ping_t *ping) { static int (*const func[])(sc_target_t *, sc_targetipid_t *, uint16_t, uint16_t) = { reply_classify, reply_descend, reply_overlap, reply_descend2, reply_candidates, }; sc_target_t *target; char buf[64]; scamper_ping_reply_t *reply; int rc = -1; sc_targetipid_t p[6]; uint16_t u16; uint16_t probes_rxd = 0; uint16_t ipids_rxd = 0; if((target = sc_target_findtree(ping->dst)) == NULL) { fprintf(stderr, "do_decoderead: could not find dst %s\n", scamper_addr_tostr(ping->dst, buf, sizeof(buf))); goto done; } sc_target_detachtree(target); for(u16=0; u16ping_sent; u16++) { if((reply = ping->ping_replies[u16]) == NULL || SCAMPER_PING_REPLY_IS_ICMP_ECHO_REPLY(reply) == 0) continue; probes_rxd++; if(reply->flags & SCAMPER_PING_REPLY_FLAG_REPLY_IPID) { timeval_cpy(&p[ipids_rxd].tx, &reply->tx); timeval_add_tv3(&p[ipids_rxd].rx, &reply->tx, &reply->rtt); p[ipids_rxd].ipid = reply->reply_ipid32; ipids_rxd++; } } scamper_ping_free(ping); ping = NULL; rc = func[mode](target, p, ipids_rxd, probes_rxd); done: if(ping != NULL) scamper_ping_free(ping); return rc; } static int do_decoderead_dealias(scamper_dealias_t *dealias) { scamper_dealias_ally_t *ally = dealias->data; sc_targetset_t *ts; sc_target_t *target; struct timeval tv; char a[64], b[64], r[16]; assert(SCAMPER_DEALIAS_METHOD_IS_ALLY(dealias)); scamper_addr_tostr(ally->probedefs[0].dst, a, sizeof(a)); scamper_addr_tostr(ally->probedefs[1].dst, b, sizeof(b)); if((target = sc_target_findtree(ally->probedefs[0].dst)) == NULL) { fprintf(stderr, "do_decoderead: could not find dst %s\n", a); goto done; } sc_target_detachtree(target); ts = target->data; if(dealias->result == SCAMPER_DEALIAS_RESULT_NONE) { if(ts->attempt >= 2) sc_targetset_nextpair(ts); else ts->attempt++; } else { if(SCAMPER_DEALIAS_RESULT_IS_ALIASES(dealias) && aliasfile != NULL) { fprintf(aliasfile, "%s %s\n", a, b); fflush(aliasfile); } logprint("%s %s %s\n", a, b, scamper_dealias_result_tostr(dealias,r,sizeof(r))); sc_targetset_nextpair(ts); } if(ts->s1 != NULL) { timeval_add_s(&tv, &now, 1); if(sc_wait_targetset(&tv, ts) != 0) return -1; } else { sc_targetset_free(ts); } done: if(dealias != NULL) scamper_dealias_free(dealias); return 0; } static int do_decoderead(void) { void *data; uint16_t type; /* try and read from the warts decoder */ if(scamper_file_read(decode_in, ffilter, &type, &data) != 0) { fprintf(stderr, "do_decoderead: scamper_file_read errno %d\n", errno); return -1; } if(data == NULL) return 0; probing--; if(scamper_file_write_obj(outfile, type, data) != 0) { fprintf(stderr, "do_decoderead: could not write obj %d\n", type); /* XXX: free data */ return -1; } if(type == SCAMPER_FILE_OBJ_PING) return do_decoderead_ping(data); else if(type == SCAMPER_FILE_OBJ_DEALIAS) return do_decoderead_dealias(data); return -1; } static int do_scamperread_line(void *param, uint8_t *buf, size_t linelen) { char *head = (char *)buf; uint8_t uu[64]; size_t uus; long lo; /* skip empty lines */ if(head[0] == '\0') return 0; /* if currently decoding data, then pass it to uudecode */ if(data_left > 0) { uus = sizeof(uu); if(uudecode_line(head, linelen, uu, &uus) != 0) { fprintf(stderr, "could not uudecode_line\n"); return -1; } if(uus != 0) scamper_writebuf_send(decode_wb, uu, uus); data_left -= (linelen + 1); return 0; } /* feedback letting us know that the command was accepted */ if(linelen >= 2 && strncasecmp(head, "OK", 2) == 0) return 0; /* if the scamper process is asking for more tasks, give it more */ if(linelen == 4 && strncasecmp(head, "MORE", linelen) == 0) { more++; if(do_method() != 0) return -1; return 0; } /* new piece of data */ if(linelen > 5 && strncasecmp(head, "DATA ", 5) == 0) { if(string_isnumber(head+5) == 0 || string_tolong(head+5, &lo) != 0) { fprintf(stderr, "could not parse %s\n", head); return -1; } data_left = lo; return 0; } /* feedback letting us know that the command was not accepted */ if(linelen >= 3 && strncasecmp(head, "ERR", 3) == 0) { more++; if(do_method() != 0) return -1; return 0; } fprintf(stderr, "unknown response '%s'\n", head); return -1; } static int do_scamperread(void) { ssize_t rc; uint8_t buf[512]; if((rc = read(scamper_fd, buf, sizeof(buf))) > 0) { scamper_linepoll_handle(scamper_lp, buf, rc); return 0; } else if(rc == 0) { close(scamper_fd); scamper_fd = -1; return 0; } else if(errno == EINTR || errno == EAGAIN) { return 0; } fprintf(stderr, "could not read: errno %d\n", errno); return -1; } static int do_addressfile(void) { splaytree_t *tree = NULL; int rc = 0; if((tree = splaytree_alloc((splaytree_cmp_t)scamper_addr_cmp)) == NULL || file_lines(addressfile, sc_target_new, tree) != 0) rc = -1; splaytree_free(tree, (splaytree_free_t)scamper_addr_free); return rc; } static int do_skipfile(void) { if(skipfile == NULL) return 0; return file_lines(skipfile, sc_skippair_new, NULL); } /* * do_scamperconnect * * allocate socket and connect to scamper process listening on the port * specified. */ static int do_scamperconnect(void) { struct sockaddr_un sun; struct sockaddr_in sin; struct in_addr in; if(options & OPT_PORT) { inet_aton("127.0.0.1", &in); sockaddr_compose((struct sockaddr *)&sin, AF_INET, &in, port); if((scamper_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { fprintf(stderr, "could not allocate new socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sin, sizeof(sin)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } return 0; } else if(options & OPT_UNIX) { if(sockaddr_compose_un((struct sockaddr *)&sun, unix_name) != 0) { fprintf(stderr, "could not build sockaddr_un\n"); return -1; } if((scamper_fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { fprintf(stderr, "could not allocate unix domain socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sun, sizeof(sun)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } return 0; } return -1; } static int speedtrap_data_select(void) { struct timeval tv, *tv_ptr; fd_set rfds, wfds, *wfdsp; sc_wait_t *w; int nfds; for(;;) { /* * need to set a timeout on select if scamper's processing window is * not full and there is a task in the waiting queue. */ tv_ptr = NULL; if(more > 0) { gettimeofday_wrap(&now); /* * if there is something ready to probe now, then try and * do it. */ w = heap_head_item(waiting); if(slist_count(probelist) > 0 || (w != NULL && timeval_cmp(&w->tv, &now) <= 0)) { if(do_method() != 0) return -1; } /* * if we could not send a new command just yet, but scamper * wants one, then wait for an appropriate length of time. */ w = heap_head_item(waiting); if(more > 0 && tv_ptr == NULL && w != NULL) { tv_ptr = &tv; if(timeval_cmp(&w->tv, &now) > 0) timeval_diff_tv(&tv, &now, &w->tv); else memset(&tv, 0, sizeof(tv)); } } nfds = 0; FD_ZERO(&rfds); FD_ZERO(&wfds); wfdsp = NULL; if(scamper_fd < 0 && decode_in_fd < 0) break; if(scamper_fd >= 0) { FD_SET(scamper_fd, &rfds); if(nfds < scamper_fd) nfds = scamper_fd; if(scamper_writebuf_len(scamper_wb) > 0) { FD_SET(scamper_fd, &wfds); wfdsp = &wfds; } } if(decode_in_fd >= 0) { FD_SET(decode_in_fd, &rfds); if(nfds < decode_in_fd) nfds = decode_in_fd; } if(decode_out_fd >= 0 && scamper_writebuf_len(decode_wb) > 0) { FD_SET(decode_out_fd, &wfds); wfdsp = &wfds; if(nfds < decode_out_fd) nfds = decode_out_fd; } if(splaytree_count(targets) == 0 && slist_count(probelist) == 0 && heap_count(waiting) == 0) { logprint("done\n"); break; } if(select(nfds+1, &rfds, wfdsp, NULL, tv_ptr) < 0) { if(errno == EINTR) continue; fprintf(stderr, "select error\n"); break; } gettimeofday_wrap(&now); if(more > 0) { if(do_method() != 0) return -1; } if(scamper_fd >= 0) { if(FD_ISSET(scamper_fd, &rfds) && do_scamperread() != 0) return -1; if(wfdsp != NULL && FD_ISSET(scamper_fd, wfdsp) && scamper_writebuf_write(scamper_fd, scamper_wb) != 0) return -1; } if(decode_in_fd >= 0) { if(FD_ISSET(decode_in_fd, &rfds) && do_decoderead() != 0) return -1; } if(decode_out_fd >= 0) { if(wfdsp != NULL && FD_ISSET(decode_out_fd, wfdsp) && scamper_writebuf_write(decode_out_fd, decode_wb) != 0) return -1; } } return 0; } static int speedtrap_data(void) { int pair[2]; if((targets = splaytree_alloc((splaytree_cmp_t)sc_target_addr_cmp)) == NULL || (waiting = heap_alloc((heap_cmp_t)sc_wait_cmp)) == NULL || (probelist = slist_alloc()) == NULL || (incr = slist_alloc()) == NULL || (candidates = slist_alloc()) == NULL || (overlap_act = dlist_alloc()) == NULL || (skiptree = splaytree_alloc((splaytree_cmp_t)sc_skippair_cmp)) == NULL || do_addressfile() != 0 || do_skipfile() != 0 || do_scamperconnect() != 0 || (scamper_lp = scamper_linepoll_alloc(do_scamperread_line, NULL)) == NULL || (scamper_wb = scamper_writebuf_alloc()) == NULL || (decode_wb = scamper_writebuf_alloc()) == NULL || (outfile = scamper_file_open(outfile_name, 'w', "warts")) == NULL || socketpair(AF_UNIX, SOCK_STREAM, 0, pair) != 0 || (decode_in = scamper_file_openfd(pair[0], NULL, 'r', "warts")) == NULL || fcntl_set(pair[0], O_NONBLOCK) == -1 || fcntl_set(pair[1], O_NONBLOCK) == -1) return -1; decode_in_fd = pair[0]; decode_out_fd = pair[1]; scamper_writebuf_send(scamper_wb, "attach\n", 7); random_seed(); slist_shuffle(probelist); if(options & OPT_INCR) { mode = MODE_DESCEND; if((descend = slist_alloc()) == NULL) return -1; } return speedtrap_data_select(); } static int speedtrap_read(void) { scamper_file_t *in; char *filename; uint16_t type; void *data; int i, stdin_used=0; for(i=0; i&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_speedtrap$(EXEEXT) subdir = utils/sc_speedtrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_speedtrap_OBJECTS = sc_speedtrap-sc_speedtrap.$(OBJEXT) \ ../../sc_speedtrap-utils.$(OBJEXT) \ ../../sc_speedtrap-mjl_heap.$(OBJEXT) \ ../../sc_speedtrap-mjl_list.$(OBJEXT) \ ../../sc_speedtrap-mjl_splaytree.$(OBJEXT) \ ../../scamper/sc_speedtrap-scamper_linepoll.$(OBJEXT) \ ../../scamper/sc_speedtrap-scamper_writebuf.$(OBJEXT) sc_speedtrap_OBJECTS = $(am_sc_speedtrap_OBJECTS) sc_speedtrap_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = sc_speedtrap_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(sc_speedtrap_CFLAGS) \ $(CFLAGS) $(sc_speedtrap_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_speedtrap_SOURCES) DIST_SOURCES = $(sc_speedtrap_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_speedtrap_SOURCES = \ sc_speedtrap.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c sc_speedtrap_CFLAGS = @PTHREAD_CFLAGS@ sc_speedtrap_LDFLAGS = @PTHREAD_CFLAGS@ sc_speedtrap_LDADD = ../../scamper/libscamperfile.la @PTHREAD_LIBS@ man_MANS = sc_speedtrap.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_speedtrap/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_speedtrap/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../sc_speedtrap-utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../sc_speedtrap-mjl_heap.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../sc_speedtrap-mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../sc_speedtrap-mjl_splaytree.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../scamper/$(am__dirstamp): @$(MKDIR_P) ../../scamper @: > ../../scamper/$(am__dirstamp) ../../scamper/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../scamper/$(DEPDIR) @: > ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/sc_speedtrap-scamper_linepoll.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/sc_speedtrap-scamper_writebuf.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) sc_speedtrap$(EXEEXT): $(sc_speedtrap_OBJECTS) $(sc_speedtrap_DEPENDENCIES) $(EXTRA_sc_speedtrap_DEPENDENCIES) @rm -f sc_speedtrap$(EXEEXT) $(AM_V_CCLD)$(sc_speedtrap_LINK) $(sc_speedtrap_OBJECTS) $(sc_speedtrap_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) -rm -f ../../scamper/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/sc_speedtrap-mjl_heap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/sc_speedtrap-mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/sc_speedtrap-mjl_splaytree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/sc_speedtrap-utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/sc_speedtrap-scamper_linepoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/sc_speedtrap-scamper_writebuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_speedtrap-sc_speedtrap.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< sc_speedtrap-sc_speedtrap.o: sc_speedtrap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT sc_speedtrap-sc_speedtrap.o -MD -MP -MF $(DEPDIR)/sc_speedtrap-sc_speedtrap.Tpo -c -o sc_speedtrap-sc_speedtrap.o `test -f 'sc_speedtrap.c' || echo '$(srcdir)/'`sc_speedtrap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sc_speedtrap-sc_speedtrap.Tpo $(DEPDIR)/sc_speedtrap-sc_speedtrap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sc_speedtrap.c' object='sc_speedtrap-sc_speedtrap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o sc_speedtrap-sc_speedtrap.o `test -f 'sc_speedtrap.c' || echo '$(srcdir)/'`sc_speedtrap.c sc_speedtrap-sc_speedtrap.obj: sc_speedtrap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT sc_speedtrap-sc_speedtrap.obj -MD -MP -MF $(DEPDIR)/sc_speedtrap-sc_speedtrap.Tpo -c -o sc_speedtrap-sc_speedtrap.obj `if test -f 'sc_speedtrap.c'; then $(CYGPATH_W) 'sc_speedtrap.c'; else $(CYGPATH_W) '$(srcdir)/sc_speedtrap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sc_speedtrap-sc_speedtrap.Tpo $(DEPDIR)/sc_speedtrap-sc_speedtrap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sc_speedtrap.c' object='sc_speedtrap-sc_speedtrap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o sc_speedtrap-sc_speedtrap.obj `if test -f 'sc_speedtrap.c'; then $(CYGPATH_W) 'sc_speedtrap.c'; else $(CYGPATH_W) '$(srcdir)/sc_speedtrap.c'; fi` ../../sc_speedtrap-utils.o: ../../utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../sc_speedtrap-utils.o -MD -MP -MF ../../$(DEPDIR)/sc_speedtrap-utils.Tpo -c -o ../../sc_speedtrap-utils.o `test -f '../../utils.c' || echo '$(srcdir)/'`../../utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../$(DEPDIR)/sc_speedtrap-utils.Tpo ../../$(DEPDIR)/sc_speedtrap-utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../utils.c' object='../../sc_speedtrap-utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../sc_speedtrap-utils.o `test -f '../../utils.c' || echo '$(srcdir)/'`../../utils.c ../../sc_speedtrap-utils.obj: ../../utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../sc_speedtrap-utils.obj -MD -MP -MF ../../$(DEPDIR)/sc_speedtrap-utils.Tpo -c -o ../../sc_speedtrap-utils.obj `if test -f '../../utils.c'; then $(CYGPATH_W) '../../utils.c'; else $(CYGPATH_W) '$(srcdir)/../../utils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../$(DEPDIR)/sc_speedtrap-utils.Tpo ../../$(DEPDIR)/sc_speedtrap-utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../utils.c' object='../../sc_speedtrap-utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../sc_speedtrap-utils.obj `if test -f '../../utils.c'; then $(CYGPATH_W) '../../utils.c'; else $(CYGPATH_W) '$(srcdir)/../../utils.c'; fi` ../../sc_speedtrap-mjl_heap.o: ../../mjl_heap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../sc_speedtrap-mjl_heap.o -MD -MP -MF ../../$(DEPDIR)/sc_speedtrap-mjl_heap.Tpo -c -o ../../sc_speedtrap-mjl_heap.o `test -f '../../mjl_heap.c' || echo '$(srcdir)/'`../../mjl_heap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../$(DEPDIR)/sc_speedtrap-mjl_heap.Tpo ../../$(DEPDIR)/sc_speedtrap-mjl_heap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../mjl_heap.c' object='../../sc_speedtrap-mjl_heap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../sc_speedtrap-mjl_heap.o `test -f '../../mjl_heap.c' || echo '$(srcdir)/'`../../mjl_heap.c ../../sc_speedtrap-mjl_heap.obj: ../../mjl_heap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../sc_speedtrap-mjl_heap.obj -MD -MP -MF ../../$(DEPDIR)/sc_speedtrap-mjl_heap.Tpo -c -o ../../sc_speedtrap-mjl_heap.obj `if test -f '../../mjl_heap.c'; then $(CYGPATH_W) '../../mjl_heap.c'; else $(CYGPATH_W) '$(srcdir)/../../mjl_heap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../$(DEPDIR)/sc_speedtrap-mjl_heap.Tpo ../../$(DEPDIR)/sc_speedtrap-mjl_heap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../mjl_heap.c' object='../../sc_speedtrap-mjl_heap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../sc_speedtrap-mjl_heap.obj `if test -f '../../mjl_heap.c'; then $(CYGPATH_W) '../../mjl_heap.c'; else $(CYGPATH_W) '$(srcdir)/../../mjl_heap.c'; fi` ../../sc_speedtrap-mjl_list.o: ../../mjl_list.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../sc_speedtrap-mjl_list.o -MD -MP -MF ../../$(DEPDIR)/sc_speedtrap-mjl_list.Tpo -c -o ../../sc_speedtrap-mjl_list.o `test -f '../../mjl_list.c' || echo '$(srcdir)/'`../../mjl_list.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../$(DEPDIR)/sc_speedtrap-mjl_list.Tpo ../../$(DEPDIR)/sc_speedtrap-mjl_list.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../mjl_list.c' object='../../sc_speedtrap-mjl_list.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../sc_speedtrap-mjl_list.o `test -f '../../mjl_list.c' || echo '$(srcdir)/'`../../mjl_list.c ../../sc_speedtrap-mjl_list.obj: ../../mjl_list.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../sc_speedtrap-mjl_list.obj -MD -MP -MF ../../$(DEPDIR)/sc_speedtrap-mjl_list.Tpo -c -o ../../sc_speedtrap-mjl_list.obj `if test -f '../../mjl_list.c'; then $(CYGPATH_W) '../../mjl_list.c'; else $(CYGPATH_W) '$(srcdir)/../../mjl_list.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../$(DEPDIR)/sc_speedtrap-mjl_list.Tpo ../../$(DEPDIR)/sc_speedtrap-mjl_list.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../mjl_list.c' object='../../sc_speedtrap-mjl_list.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../sc_speedtrap-mjl_list.obj `if test -f '../../mjl_list.c'; then $(CYGPATH_W) '../../mjl_list.c'; else $(CYGPATH_W) '$(srcdir)/../../mjl_list.c'; fi` ../../sc_speedtrap-mjl_splaytree.o: ../../mjl_splaytree.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../sc_speedtrap-mjl_splaytree.o -MD -MP -MF ../../$(DEPDIR)/sc_speedtrap-mjl_splaytree.Tpo -c -o ../../sc_speedtrap-mjl_splaytree.o `test -f '../../mjl_splaytree.c' || echo '$(srcdir)/'`../../mjl_splaytree.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../$(DEPDIR)/sc_speedtrap-mjl_splaytree.Tpo ../../$(DEPDIR)/sc_speedtrap-mjl_splaytree.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../mjl_splaytree.c' object='../../sc_speedtrap-mjl_splaytree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../sc_speedtrap-mjl_splaytree.o `test -f '../../mjl_splaytree.c' || echo '$(srcdir)/'`../../mjl_splaytree.c ../../sc_speedtrap-mjl_splaytree.obj: ../../mjl_splaytree.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../sc_speedtrap-mjl_splaytree.obj -MD -MP -MF ../../$(DEPDIR)/sc_speedtrap-mjl_splaytree.Tpo -c -o ../../sc_speedtrap-mjl_splaytree.obj `if test -f '../../mjl_splaytree.c'; then $(CYGPATH_W) '../../mjl_splaytree.c'; else $(CYGPATH_W) '$(srcdir)/../../mjl_splaytree.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../$(DEPDIR)/sc_speedtrap-mjl_splaytree.Tpo ../../$(DEPDIR)/sc_speedtrap-mjl_splaytree.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../mjl_splaytree.c' object='../../sc_speedtrap-mjl_splaytree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../sc_speedtrap-mjl_splaytree.obj `if test -f '../../mjl_splaytree.c'; then $(CYGPATH_W) '../../mjl_splaytree.c'; else $(CYGPATH_W) '$(srcdir)/../../mjl_splaytree.c'; fi` ../../scamper/sc_speedtrap-scamper_linepoll.o: ../../scamper/scamper_linepoll.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../scamper/sc_speedtrap-scamper_linepoll.o -MD -MP -MF ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_linepoll.Tpo -c -o ../../scamper/sc_speedtrap-scamper_linepoll.o `test -f '../../scamper/scamper_linepoll.c' || echo '$(srcdir)/'`../../scamper/scamper_linepoll.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_linepoll.Tpo ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_linepoll.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../scamper/scamper_linepoll.c' object='../../scamper/sc_speedtrap-scamper_linepoll.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../scamper/sc_speedtrap-scamper_linepoll.o `test -f '../../scamper/scamper_linepoll.c' || echo '$(srcdir)/'`../../scamper/scamper_linepoll.c ../../scamper/sc_speedtrap-scamper_linepoll.obj: ../../scamper/scamper_linepoll.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../scamper/sc_speedtrap-scamper_linepoll.obj -MD -MP -MF ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_linepoll.Tpo -c -o ../../scamper/sc_speedtrap-scamper_linepoll.obj `if test -f '../../scamper/scamper_linepoll.c'; then $(CYGPATH_W) '../../scamper/scamper_linepoll.c'; else $(CYGPATH_W) '$(srcdir)/../../scamper/scamper_linepoll.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_linepoll.Tpo ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_linepoll.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../scamper/scamper_linepoll.c' object='../../scamper/sc_speedtrap-scamper_linepoll.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../scamper/sc_speedtrap-scamper_linepoll.obj `if test -f '../../scamper/scamper_linepoll.c'; then $(CYGPATH_W) '../../scamper/scamper_linepoll.c'; else $(CYGPATH_W) '$(srcdir)/../../scamper/scamper_linepoll.c'; fi` ../../scamper/sc_speedtrap-scamper_writebuf.o: ../../scamper/scamper_writebuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../scamper/sc_speedtrap-scamper_writebuf.o -MD -MP -MF ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_writebuf.Tpo -c -o ../../scamper/sc_speedtrap-scamper_writebuf.o `test -f '../../scamper/scamper_writebuf.c' || echo '$(srcdir)/'`../../scamper/scamper_writebuf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_writebuf.Tpo ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_writebuf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../scamper/scamper_writebuf.c' object='../../scamper/sc_speedtrap-scamper_writebuf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../scamper/sc_speedtrap-scamper_writebuf.o `test -f '../../scamper/scamper_writebuf.c' || echo '$(srcdir)/'`../../scamper/scamper_writebuf.c ../../scamper/sc_speedtrap-scamper_writebuf.obj: ../../scamper/scamper_writebuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -MT ../../scamper/sc_speedtrap-scamper_writebuf.obj -MD -MP -MF ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_writebuf.Tpo -c -o ../../scamper/sc_speedtrap-scamper_writebuf.obj `if test -f '../../scamper/scamper_writebuf.c'; then $(CYGPATH_W) '../../scamper/scamper_writebuf.c'; else $(CYGPATH_W) '$(srcdir)/../../scamper/scamper_writebuf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_writebuf.Tpo ../../scamper/$(DEPDIR)/sc_speedtrap-scamper_writebuf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../../scamper/scamper_writebuf.c' object='../../scamper/sc_speedtrap-scamper_writebuf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sc_speedtrap_CFLAGS) $(CFLAGS) -c -o ../../scamper/sc_speedtrap-scamper_writebuf.obj `if test -f '../../scamper/scamper_writebuf.c'; then $(CYGPATH_W) '../../scamper/scamper_writebuf.c'; else $(CYGPATH_W) '$(srcdir)/../../scamper/scamper_writebuf.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) -rm -f ../../scamper/$(DEPDIR)/$(am__dirstamp) -rm -f ../../scamper/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_remoted/.cvsignore000644 001751 000000 00000000054 12452377211 021402 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_remoted scamper-cvs-20171204/utils/sc_remoted/Makefile.am000644 001751 000000 00000000717 12742346652 021453 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_remoted sc_remoted_SOURCES = \ sc_remoted.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c sc_remoted_LDADD = ../../scamper/libscamperfile.la @OPENSSL_LIBS@ sc_remoted_LDFLAGS = @OPENSSL_LDFLAGS@ man_MANS = sc_remoted.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_remoted/sc_remoted.1000644 001751 000000 00000011415 13014357175 021615 0ustar00mjlwheel000000 000000 .\" .\" sc_remoted.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2014-2015 Matthew Luckie .\" All rights reserved .\" .\" $Id: sc_remoted.1,v 1.9 2016/11/20 17:33:49 mjl Exp $ .\" .Dd September 21, 2014 .Dt SC_REMOTED 1 .Os .Sh NAME .Nm sc_remoted .Nd interact with a collection of remotely controlled scamper instances .Sh SYNOPSIS .Nm .Bk -words .Op Fl ?46D .Op Fl O Ar options .Op Fl P Ar port .Op Fl U Ar directory .Op Fl c Ar tls-certificate .Op Fl p Ar tls-privatekey .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility provides the ability to connect to a .Xr scamper 1 instance running remotely and interact with it by issuing commands and receiving results in warts format. The options are as follows: .Bl -tag -width Ds .It Fl ? prints a list of command line options and a synopsis of each. .It Fl D causes .Nm to operate as a daemon. .It Fl 4 causes .Nm to only listen for IPv4-based connections. .It Fl 6 causes .Nm to only listen for IPv6-based connections. .It Fl O Ar options allows the behavior of .Nm to be further tailored. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy allowgroup: allow members of the unix domain socket's group to access to the unix domain sockets created by .Nm .It .Sy allowother: allow anyone on the system access to the unix domain sockets created by .Nm .It .Sy select: use .Xr select 2 with all sockets, rather than .Xr epoll 2 or .Xr kqueue 2 .El .It Fl P Ar port specifies the port on the local host where .Nm should listen for incoming connections. .It Fl U Ar directory specifies the directory on the local host where unix domain sockets corresponding to remote hosts should be placed. .It Fl c Ar tls-certificate specifies the server certificate file in PEM format to advertise to remote .Xr scamper 1 instances. .It Fl p Ar tls-privatekey specifies the private key file in PEM format that corresponds to the certificate file. This key should have a passphrase. .Nm will prompt for the passphrase when starting up. .El .\"""""""""""" .Sh EXAMPLES The intended use of the remote control socket built into .Xr scamper 1 is as follows. A central server with IP addresses 192.0.2.1 and 2001:db8::1 runs a .Nm process listening on a port for remote scamper process, placing control sockets in a specified directory: .Pp .Dl sc_remoted -P 31337 -U scamper-remote-sockets .Pp Then, a remote host with IP address 198.51.100.55 runs scamper and connects to the remote controller: .Pp .Dl scamper -R 192.0.2.1:31337 .Pp The .Nm process places a unix domain socket in the directory corresponding to the remote process. The name corresponds to the source IP address and port the remote scamper process connected to controller with. If the scamper process used source port 1025, then the unix domain socket's name will be .Pp .Dl scamper-remote-sockets/198.51.100.55:1025 .Pp If a second remote host with IP address 2001:db8:1234::1 runs scamper and connects to the remote controller: .Pp .Dl scamper -R [2001:db8::1]:31337 .Pp The same .Nm process will place another unix domain socket in the directory corresponding to the remote process. If the scamper process used source port 1026, then the unix domain socket's name will be .Pp .Dl scamper-remote-sockets/2001:db8:1234::1.1026 .Pp .\"""""""""""" .Sh USING TRANSPORT LAYER SECURITY .Nm and scamper support the use of transport layer security (TLS) using OpenSSL to authenticate and encrypt communications between .Nm and scamper. To use this support requires a public certificate signed by a certificate authority. Scamper will verify the certificate presented by .Nm and disconnect if the certificate presented by .Nm cannot be validated. .Pp Generating a certificate that will be accepted by scamper requires you to create a certificate request and pass it for signing to a certificate authority. To generate a private key in file remotepriv.pem, and a request to sign the key in remotereq.pem: .Pp .Dl openssl req -new -keyout remotepriv.pem -out remotereq.pem .Pp and then send the remotereq.pem file to the certificate authority for signing. Do not send remotepriv.pem; that key must remain private to you. When openssl prompts for a passphrase, choose a passphrase that is unique and keep the passphrase secret. When your chosen certificate authority signs your private key, it will return a file which we will call remotecert.pem. Both remotecert.pem and remotepriv.pem are required parameters to .Nm to enable TLS support: .Pp .Dl sc_remoted -P 31337 -U scamper-remote-sockets -c remotecert.pem -p remotepriv.pem .Pp and then passing the -O tls option to scamper: .Pp .Dl scamper -R example.com:31337 -O tls .Pp .\"""""""""""" .Sh SEE ALSO .Xr scamper 1 , .Xr sc_attach 1 , .Xr sc_wartsdump 1 , .Xr warts 5 , .Xr openssl 1 .Sh AUTHORS .Nm was written by Matthew Luckie . scamper-cvs-20171204/utils/sc_remoted/sc_remoted.c000644 001751 000000 00000141311 12752300311 021662 0ustar00mjlwheel000000 000000 /* * sc_remoted * * $Id: sc_remoted.c,v 1.50 2016/08/09 07:05:45 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2014-2016 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 code defines a protocol that exists between a central server * running sc_remoted, and a remote system running scamper. As the * protocol allows multiple local processes to drive a single remote * scamper process, the protocol is based around "channels" to * separate multiple streams of scamper control connection over a * single TCP socket. * * The protocol is roughly designed as follows: * * Header: * ------ * uint32_t channel * uint16_t msglen * * The control header is included in every message sent between the * scamper instance and the remote controller. * The channel number identifies the stream; channel #0 is reserved for * control messages. * The msglen value defines the size of the message following the header * * Control Messages: * ---------------- * uint8_t type * * A control message begins with a mandatory type number. The following * control message types are defined, with arrows defining who may send * which message type. * * 0 - Master (remoted <- scamper) * 1 - New Channel (remoted -> scamper) * 2 - Channel FIN (remoted <> scamper) * * Control Message - Master New: * ---------------------------- * * Whenever a scamper instance establishes a TCP connection with a remote * controller, it sends a message that identifies itself. The message * is formatted as follows: * * uint8_t magic_len * uint8_t *magic * uint8_t monitorname_len * char *monitorname * * The magic value is generated randomly by the scamper instance when * the process starts, and is never modified. The same magic value is * always supplied in a control socket connection and allows the remote * controller to identify that the scamper instance supports graceful * restart. * The monitorname is sent if the remote scamper instance uses the -M * option. * Both magic_len and monitorname_len include the terminating null byte. * * Control Message - Master ID: * --------------------------- * * After the "Master New" message has been received by the remote * controller, the remote controller sends an ID value to the scamper * instance that it can use as a list identifier in warts. The message * is formatted as follows: * * uint8_t id_len; * char *id * * Control Message - New Channel: * ----------------------------- * * Whenever a remote controller has a new connection on a unix domain * socket, it sends a control message to scamper with a new channel * number to use for the connection. The message is formatted as * follows: * * uint32_t channel * * Control Message - Client FIN: * ---------------------------- * * Whenever a client connection has no more to send, it sends a FIN * type. the FIN message must be sent by both the remote controller * and the scamper instance for a channel to be closed. The message * is formatted as follows: * * uint32_t channel * */ #ifndef lint static const char rcsid[] = "$Id: sc_remoted.c,v 1.50 2016/08/09 07:05:45 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_linepoll.h" #include "scamper_writebuf.h" #include "mjl_splaytree.h" #include "mjl_list.h" #include "utils.h" /* * sc_unit * * this generic structure says what kind of node is pointed to, and is * used to help garbage collect with kqueue / epoll. */ typedef struct sc_unit { void *data; dlist_t *list; /* list == gclist if on that list */ dlist_node_t *node; uint8_t type; uint8_t gc; } sc_unit_t; #define UNIT_TYPE_MASTER 0 #define UNIT_TYPE_CHANNEL 1 /* * sc_fd * * this structure associates a file descriptor with a data pointer, as * well as information about what type the fd is and any current * state. */ typedef struct sc_fd { int fd; sc_unit_t *unit; uint8_t type; uint8_t flags; } sc_fd_t; #define FD_TYPE_SERVER 0 #define FD_TYPE_MASTER_INET 1 #define FD_TYPE_MASTER_UNIX 2 #define FD_TYPE_CHANNEL_UNIX 3 #define FD_FLAG_READ 1 #define FD_FLAG_WRITE 2 /* * sc_master_t * * this structure holds a mapping between a remote scamper process * that is willing to be driven and a local unix domain socket where * local processes can connect. it also includes a list of all * clients connected using the socket. */ typedef struct sc_master { sc_unit_t *unit; char *name; uint8_t *magic; uint8_t magic_len; sc_fd_t *unix_fd; sc_fd_t inet_fd; scamper_writebuf_t *inet_wb; #ifdef HAVE_OPENSSL int inet_mode; SSL *inet_ssl; BIO *inet_rbio; BIO *inet_wbio; #endif struct timeval tx_ka; struct timeval rx_abort; dlist_t *channels; uint32_t next_channel; dlist_node_t *node; uint8_t buf[65536+6]; size_t buf_offset; } sc_master_t; /* * sc_channel_t * * this structure holds a mapping between a local process that wants * to drive a remote scamper, and a channel corresponding to that * instance. */ typedef struct sc_channel { uint32_t id; sc_unit_t *unit; sc_fd_t *unix_fd; scamper_linepoll_t *unix_lp; scamper_writebuf_t *unix_wb; sc_master_t *master; dlist_node_t *node; uint8_t flags; } sc_channel_t; #define OPT_HELP 0x0001 #define OPT_UNIX 0x0002 #define OPT_PORT 0x0004 #define OPT_DAEMON 0x0008 #define OPT_IPV4 0x0010 #define OPT_IPV6 0x0020 #define OPT_OPTION 0x0040 #define OPT_TLSCERT 0x0080 #define OPT_TLSPRIV 0x0100 #define OPT_ALL 0xffff #define FLAG_SELECT 0x0002 #define FLAG_ALLOW_G 0x0004 #define FLAG_ALLOW_O 0x0008 #define CHANNEL_FLAG_EOF_TX 0x01 #define CHANNEL_FLAG_EOF_RX 0x02 #define CONTROL_MASTER_NEW 0 /* scamper --> remoted */ #define CONTROL_MASTER_ID 1 /* scamper <-- remoted */ #define CONTROL_CHANNEL_NEW 2 /* scamper <-- remoted */ #define CONTROL_CHANNEL_FIN 3 /* scamper <-> remoted */ #define CONTROL_KEEPALIVE 4 /* scamper <-> remoted */ static uint16_t options = 0; static char *unix_name = NULL; static int port = 0; static dlist_t *mslist = NULL; static dlist_t *gclist = NULL; static int stop = 0; static uint16_t flags = 0; static int serversockets[2]; static struct timeval now; #if defined(HAVE_EPOLL) static int epfd = -1; #elif defined(HAVE_KQUEUE) static int kqfd = -1; #endif #ifdef HAVE_OPENSSL static SSL_CTX *tls_ctx = NULL; static char *tls_certfile = NULL; static char *tls_privfile = NULL; #define SSL_MODE_ACCEPT 0x00 #define SSL_MODE_ESTABLISHED 0x01 #define SSL_MODE_SHUTDOWN 0x02 #endif /* * sc_unit_gc_t: * * method to cleanup tasks when its time to garbage collect */ typedef void (*sc_unit_gc_t)(void *); static void sc_channel_free(sc_channel_t *); static void sc_master_free(sc_master_t *); static const sc_unit_gc_t unit_gc[] = { (sc_unit_gc_t)sc_master_free, /* UNIT_TYPE_MASTER */ (sc_unit_gc_t)sc_channel_free, /* UNIT_TYPE_CHANNEL */ }; #if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE) typedef void (*sc_fd_cb_t)(void *); static void sc_channel_unix_read(sc_channel_t *); static void sc_channel_unix_write(sc_channel_t *); static void sc_master_inet_read(sc_master_t *); static void sc_master_inet_write(sc_master_t *); static void sc_master_unix_accept(sc_master_t *); static const sc_fd_cb_t read_cb[] = { NULL, /* FD_TYPE_SERVER */ (sc_fd_cb_t)sc_master_inet_read, /* FD_TYPE_MASTER_INET */ (sc_fd_cb_t)sc_master_unix_accept, /* FD_TYPE_MASTER_UNIX */ (sc_fd_cb_t)sc_channel_unix_read, /* FD_TYPE_CHANNEL_UNIX */ }; static const sc_fd_cb_t write_cb[] = { NULL, /* FD_TYPE_SERVER */ (sc_fd_cb_t)sc_master_inet_write, /* FD_TYPE_MASTER_INET */ NULL, /* FD_TYPE_MASTER_UNIX */ (sc_fd_cb_t)sc_channel_unix_write, /* FD_TYPE_CHANNEL_UNIX */ }; #endif static void usage(uint32_t opt_mask) { fprintf(stderr, "usage: sc_remoted [-?46D] [-O option] [-P port] [-U unix]\n" #ifdef HAVE_OPENSSL " [-c certfile] [-p privfile]\n" #endif ); if(opt_mask == 0) { fprintf(stderr, "\n sc_remoted -?\n\n"); return; } if(opt_mask & OPT_DAEMON) fprintf(stderr, " -D operate as a daemon\n"); if(opt_mask & OPT_OPTION) { fprintf(stderr, " -O options\n"); fprintf(stderr, " allowgroup: allow group access to sockets\n"); fprintf(stderr, " allowother: allow other access to sockets\n"); fprintf(stderr, " select: use select\n"); } if(opt_mask & OPT_PORT) fprintf(stderr, " -P port to accept remote scamper connections\n"); if(opt_mask & OPT_UNIX) fprintf(stderr, " -U directory for unix domain sockets\n"); #ifdef HAVE_OPENSSL if(opt_mask & OPT_TLSCERT) fprintf(stderr, " -c server certificate in PEM format\n"); if(opt_mask & OPT_TLSPRIV) fprintf(stderr, " -p private key in PEM format\n"); #endif return; } static int check_options(int argc, char *argv[]) { char *opts = "?46DO:P:c:p:U:", *opt_port = NULL; long lo; int ch; while((ch = getopt(argc, argv, opts)) != -1) { switch(ch) { case '4': options |= OPT_IPV4; break; case '6': options |= OPT_IPV6; break; case 'D': options |= OPT_DAEMON; break; case 'O': if(strcasecmp(optarg, "select") == 0) flags |= FLAG_SELECT; else if(strcasecmp(optarg, "allowgroup") == 0) flags |= FLAG_ALLOW_G; else if(strcasecmp(optarg, "allowother") == 0) flags |= FLAG_ALLOW_O; else { usage(OPT_ALL); return -1; } break; case 'P': opt_port = optarg; break; #ifdef HAVE_OPENSSL case 'c': tls_certfile = optarg; options |= OPT_TLSCERT; break; case 'p': tls_privfile = optarg; options |= OPT_TLSPRIV; break; #endif case 'U': unix_name = optarg; break; case '?': default: usage(OPT_ALL); return -1; } } if((options & (OPT_IPV4|OPT_IPV6)) == 0) options |= (OPT_IPV4 | OPT_IPV6); if(unix_name == NULL || opt_port == NULL) { usage(OPT_PORT|OPT_UNIX); return -1; } #ifdef HAVE_OPENSSL if((options & (OPT_TLSCERT|OPT_TLSPRIV)) != 0 && (options & (OPT_TLSCERT|OPT_TLSPRIV)) != (OPT_TLSCERT|OPT_TLSPRIV)) { usage(OPT_TLSCERT|OPT_TLSPRIV); return -1; } #endif if(string_tolong(opt_port, &lo) != 0 || lo < 1 || lo > 65535) { usage(OPT_PORT); return -1; } port = lo; return 0; } static void remote_debug(const char *func, const char *format, ...) { char message[512], ts[16]; struct tm *tm; va_list ap; time_t t; int ms; if(options & OPT_DAEMON) return; va_start(ap, format); vsnprintf(message, sizeof(message), format, ap); va_end(ap); t = now.tv_sec; if((tm = localtime(&t)) == NULL) return; ms = now.tv_usec / 1000; snprintf(ts, sizeof(ts), "[%02d:%02d:%02d:%03d]", tm->tm_hour, tm->tm_min, tm->tm_sec, ms); fprintf(stderr, "%s %s: %s\n", ts, func, message); fflush(stderr); return; } static int sc_fd_read_add(sc_fd_t *fd) { #if defined(HAVE_EPOLL) struct epoll_event ev; #elif defined(HAVE_KQUEUE) struct kevent kev; #endif if((fd->flags & FD_FLAG_READ) != 0) return 0; fd->flags |= FD_FLAG_READ; if((flags & FLAG_SELECT) != 0) return 0; #if defined(HAVE_EPOLL) ev.data.ptr = fd; if((fd->flags & FD_FLAG_WRITE) == 0) { ev.events = EPOLLIN; if(epoll_ctl(epfd, EPOLL_CTL_ADD, fd->fd, &ev) != 0) return -1; } else { ev.events = EPOLLIN | EPOLLOUT; if(epoll_ctl(epfd, EPOLL_CTL_MOD, fd->fd, &ev) != 0) return -1; } #elif defined(HAVE_KQUEUE) EV_SET(&kev, fd->fd, EVFILT_READ, EV_ADD, 0, 0, fd); if(kevent(kqfd, &kev, 1, NULL, 0, NULL) != 0) return -1; #endif return 0; } static int sc_fd_read_del(sc_fd_t *fd) { #if defined(HAVE_EPOLL) struct epoll_event ev; #elif defined(HAVE_KQUEUE) struct kevent kev; #endif if((fd->flags & FD_FLAG_READ) == 0) return 0; fd->flags &= ~(FD_FLAG_READ); if((flags & FLAG_SELECT) != 0) return 0; #if defined(HAVE_EPOLL) ev.data.ptr = fd; if((fd->flags & FD_FLAG_WRITE) == 0) { ev.events = 0; if(epoll_ctl(epfd, EPOLL_CTL_DEL, fd->fd, &ev) != 0) return -1; } else { ev.events = EPOLLOUT; if(epoll_ctl(epfd, EPOLL_CTL_MOD, fd->fd, &ev) != 0) return -1; } #elif defined(HAVE_KQUEUE) EV_SET(&kev, fd->fd, EVFILT_READ, EV_DELETE, 0, 0, fd); if(kevent(kqfd, &kev, 1, NULL, 0, NULL) != 0) return -1; #endif return 0; } static int sc_fd_write_add(sc_fd_t *fd) { #if defined(HAVE_EPOLL) struct epoll_event ev; #elif defined(HAVE_KQUEUE) struct kevent kev; #endif if((fd->flags & FD_FLAG_WRITE) != 0) return 0; fd->flags |= FD_FLAG_WRITE; if((flags & FLAG_SELECT) != 0) return 0; #if defined(HAVE_EPOLL) ev.data.ptr = fd; if((fd->flags & FD_FLAG_READ) == 0) { ev.events = EPOLLOUT; if(epoll_ctl(epfd, EPOLL_CTL_ADD, fd->fd, &ev) != 0) return -1; } else { ev.events = EPOLLIN | EPOLLOUT; if(epoll_ctl(epfd, EPOLL_CTL_MOD, fd->fd, &ev) != 0) return -1; } #elif defined(HAVE_KQUEUE) EV_SET(&kev, fd->fd, EVFILT_WRITE, EV_ADD, 0, 0, fd); if(kevent(kqfd, &kev, 1, NULL, 0, NULL) != 0) return -1; #endif return 0; } static int sc_fd_write_del(sc_fd_t *fd) { #if defined(HAVE_EPOLL) struct epoll_event ev; #elif defined(HAVE_KQUEUE) struct kevent kev; #endif if((fd->flags & FD_FLAG_WRITE) == 0) return 0; fd->flags &= ~(FD_FLAG_WRITE); if((flags & FLAG_SELECT) != 0) return 0; #if defined(HAVE_EPOLL) ev.data.ptr = fd; if((fd->flags & FD_FLAG_READ) == 0) { ev.events = 0; if(epoll_ctl(epfd, EPOLL_CTL_DEL, fd->fd, &ev) != 0) return -1; } else { ev.events = EPOLLIN; if(epoll_ctl(epfd, EPOLL_CTL_MOD, fd->fd, &ev) != 0) return -1; } #elif defined(HAVE_KQUEUE) EV_SET(&kev, fd->fd, EVFILT_WRITE, EV_DELETE, 0, 0, fd); if(kevent(kqfd, &kev, 1, NULL, 0, NULL) != 0) return -1; #endif return 0; } #ifdef HAVE_OPENSSL static int ssl_want_read(sc_master_t *ms) { uint8_t buf[1024]; int pending, rc, size, off = 0; if((pending = BIO_pending(ms->inet_wbio)) < 0) return -1; while(off < pending) { if(pending - off > sizeof(buf)) size = sizeof(buf); else size = pending - off; if((rc = BIO_read(ms->inet_wbio, buf, size)) <= 0) { if(BIO_should_retry(ms->inet_wbio) == 0) remote_debug(__func__, "BIO_read should not retry"); else remote_debug(__func__, "BIO_read returned %d", rc); return -1; } off += rc; scamper_writebuf_send(ms->inet_wb, buf, rc); sc_fd_write_add(&ms->inet_fd); } return pending; } #endif static void sc_fd_free(sc_fd_t *sfd) { if(sfd == NULL) return; if(sfd->fd != -1) close(sfd->fd); free(sfd); return; } static sc_fd_t *sc_fd_alloc(int fd, uint8_t type, sc_unit_t *unit) { sc_fd_t *sfd; if((sfd = malloc_zero(sizeof(sc_fd_t))) == NULL) return NULL; sfd->fd = fd; sfd->type = type; sfd->unit = unit; return sfd; } static void sc_unit_onremove(sc_unit_t *scu) { scu->node = NULL; scu->list = NULL; return; } static void sc_unit_gc(sc_unit_t *scu) { if(scu->gc != 0) return; scu->gc = 1; dlist_node_tail_push(gclist, scu->node); scu->list = gclist; return; } static void sc_unit_free(sc_unit_t *scu) { if(scu == NULL) return; if(scu->node != NULL) dlist_node_pop(scu->list, scu->node); free(scu); return; } static sc_unit_t *sc_unit_alloc(uint8_t type, void *data) { sc_unit_t *scu; if((scu = malloc_zero(sizeof(sc_unit_t))) == NULL || (scu->node = dlist_node_alloc(scu)) == NULL) { if(scu != NULL) sc_unit_free(scu); return NULL; } scu->type = type; scu->data = data; return scu; } static void sc_master_onremove(sc_master_t *ms) { ms->node = NULL; return; } static sc_channel_t *sc_master_channel_find(sc_master_t *ms, uint32_t id) { dlist_node_t *dn; sc_channel_t *cn; for(dn=dlist_head_node(ms->channels); dn != NULL; dn=dlist_node_next(dn)) { cn = dlist_node_item(dn); if(cn->id == id) return cn; } return NULL; } static void sc_master_channels_onremove(sc_channel_t *cn) { cn->node = NULL; return; } /* * sc_master_inet_send * * transparently handle sending when an SSL socket could be used. */ static int sc_master_inet_send(sc_master_t *ms, void *ptr, size_t len) { timeval_add_s(&ms->tx_ka, &now, 30); #ifdef HAVE_OPENSSL if(ms->inet_ssl != NULL) { SSL_write(ms->inet_ssl, ptr, len); if(ssl_want_read(ms) < 0) return -1; return 0; } #endif scamper_writebuf_send(ms->inet_wb, ptr, len); sc_fd_write_add(&ms->inet_fd); return 0; } static void sc_master_inet_write(sc_master_t *ms) { if(scamper_writebuf_write(ms->inet_fd.fd, ms->inet_wb) != 0) { sc_unit_gc(ms->unit); return; } if(scamper_writebuf_len(ms->inet_wb) == 0 && sc_fd_write_del(&ms->inet_fd) != 0) { sc_unit_gc(ms->unit); return; } return; } static int sc_master_tx_keepalive(sc_master_t *ms) { uint8_t buf[4+2+1]; bytes_htonl(buf+0, 0); bytes_htons(buf+4, 1); buf[6] = CONTROL_KEEPALIVE; remote_debug(__func__, "%s", ms->name); return sc_master_inet_send(ms, buf, sizeof(buf)); } /* * sc_master_control_master * * a remote scamper connection has said hello. * create a unix file descriptor to listen locally for drivers that want to * use it. * */ static int sc_master_control_master(sc_master_t *ms, uint8_t *buf, size_t len) { char sab[128], filename[65535], tmp[512]; uint8_t resp[4+2+1+1+128]; struct sockaddr_storage sas; struct sockaddr_un sn; socklen_t sl; uint8_t *magic = NULL; char *monitorname = NULL; uint8_t magic_len = 0, monitorname_len = 0, u8; size_t off = 0; mode_t mode; int fd; /* * these are set so that we know whether or not to take * responsibility for cleaning them up upon a failure condition. */ fd = -1; filename[0] = '\0'; /* ensure that there is a magic value present */ if(len == 0 || (magic_len = buf[off++]) == 0) goto err; magic = buf + off; /* ensure the magic length value makes sense */ if(off + magic_len > len) goto err; off += magic_len; /* check if there is a monitorname supplied */ if(off < len && (monitorname_len = buf[off++]) > 0) { if(off + monitorname_len > len) goto err; monitorname = (char *)(buf+off); for(u8=0; u8inet_fd.fd, (struct sockaddr *)&sas, &sl) != 0) { remote_debug(__func__, "could not getpeername: %s", strerror(errno)); goto err; } /* figure out the name for the unix domain socket */ sockaddr_tostr((struct sockaddr *)&sas, sab, sizeof(sab)); if(monitorname != NULL) { off = 0; string_concat(tmp, sizeof(tmp), &off, "%s-%s", monitorname, sab); ms->name = strdup(tmp); } else { ms->name = strdup(sab); } if(ms->name == NULL) { remote_debug(__func__, "could not strdup ms->name: %s", strerror(errno)); goto err; } if((ms->magic = memdup(magic, magic_len)) == NULL) { remote_debug(__func__, "could not memdup magic: %s", strerror(errno)); goto err; } ms->magic_len = magic_len; /* create a unix domain socket for the remote scamper process */ if((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { remote_debug(__func__, "could not create unix socket: %s", strerror(errno)); goto err; } snprintf(filename, sizeof(filename), "%s/%s", unix_name, ms->name); if(sockaddr_compose_un((struct sockaddr *)&sn, filename) != 0) { filename[0] = '\0'; /* could not actually bind so no unlink */ remote_debug(__func__, "could not compose socket: %s", strerror(errno)); goto err; } if(bind(fd, (struct sockaddr *)&sn, sizeof(sn)) != 0) { filename[0] = '\0'; /* could not actually bind so no unlink */ remote_debug(__func__, "could not bind unix socket: %s",strerror(errno)); goto err; } /* set the requested permissions on the control sockets */ mode = S_IRWXU; if(flags & FLAG_ALLOW_G) mode |= S_IRWXG; if(flags & FLAG_ALLOW_O) mode |= S_IRWXO; if(chmod(filename, mode) != 0) { remote_debug(__func__, "could not chmod: %s", strerror(errno)); goto err; } if(listen(fd, -1) != 0) { remote_debug(__func__, "could not listen: %s",strerror(errno)); goto err; } /* * at this point, allocate the unix_fd structure and take * responsibility for the socket and filesystem point */ if((ms->unix_fd = sc_fd_alloc(fd, FD_TYPE_MASTER_UNIX, ms->unit)) == NULL) { remote_debug(__func__, "could not alloc unix fd: %s", strerror(errno)); goto err; } filename[0] = '\0'; fd = -1; if(sc_fd_read_add(ms->unix_fd) != 0) { remote_debug(__func__, "could not monitor unix fd: %s", strerror(errno)); goto err; } off = strlen(sab); bytes_htonl(resp+0, 0); bytes_htons(resp+4, 1 + 1 + off + 1); resp[6] = CONTROL_MASTER_ID; resp[7] = off + 1; memcpy(resp+8, sab, off + 1); if(sc_master_inet_send(ms, resp, 4 + 2 + 1 + 1 + off + 1) != 0) { remote_debug(__func__, "could not write ID: %s\n", strerror(errno)); goto err; } return 0; err: if(fd != -1) close(fd); if(filename[0] != '\0') unlink(filename); return -1; } /* * sc_master_control_channel_fin * * */ static int sc_master_control_channel_fin(sc_master_t *ms, uint8_t *buf, size_t len) { sc_channel_t *cn; uint32_t id; if(len != 4) { remote_debug(__func__, "malformed channel fin: %u\n",(uint32_t)len); return -1; } id = bytes_ntohl(buf); if((cn = sc_master_channel_find(ms, id)) == NULL) { remote_debug(__func__, "could not find channel %u\n", id); return -1; } cn->flags |= CHANNEL_FLAG_EOF_RX; if(cn->unix_wb == NULL || scamper_writebuf_gtzero(cn->unix_wb) == 0) sc_unit_gc(cn->unit); else sc_fd_read_del(cn->unix_fd); return 0; } static int sc_master_control_keepalive(sc_master_t *ms,uint8_t *buf,size_t len) { if(len != 0) { remote_debug(__func__, "malformed keepalive: %u", (uint32_t)len); return -1; } remote_debug(__func__, "%s", ms->name); return 0; } static int sc_master_control(sc_master_t *ms, uint8_t *buf, size_t len) { uint8_t type; if(len < 1) { remote_debug(__func__, "malformed control msg: %u", (uint32_t)len); return -1; } type = buf[0]; buf++; len--; switch(type) { case CONTROL_MASTER_NEW: return sc_master_control_master(ms, buf, len); case CONTROL_CHANNEL_FIN: return sc_master_control_channel_fin(ms, buf, len); case CONTROL_KEEPALIVE: return sc_master_control_keepalive(ms, buf, len); } remote_debug(__func__, "unhandled type %d", type); return -1; } /* * sc_master_inet_read_cb * * process data from the master inet-facing socket. the data has been * through the SSL decoding routines, if necessary. * * todo: make this zero copy when the entire message is intact in the buf. */ static void sc_master_inet_read_cb(sc_master_t *ms, uint8_t *buf, size_t len) { sc_channel_t *channel; uint32_t id; uint16_t msglen, x, y; size_t off = 0; while(off < len) { /* to start with, ensure that we have a complete header */ while(ms->buf_offset < 6 && off < len) ms->buf[ms->buf_offset++] = buf[off++]; if(off == len) return; /* figure out how large the message is supposed to be */ id = bytes_ntohl(ms->buf); msglen = bytes_ntohs(ms->buf+4); /* figure out how to build the message */ x = msglen - (ms->buf_offset - 6); y = len - off; if(y < x) { /* if we cannot complete the message, buffer what we have */ memcpy(ms->buf + ms->buf_offset, buf+off, y); ms->buf_offset += y; return; } /* we now have a complete message */ memcpy(ms->buf + ms->buf_offset, buf+off, x); off += x; /* reset the buf_offset for the next message */ ms->buf_offset = 0; /* if the message is a control message */ if(id == 0) { if(sc_master_control(ms, ms->buf + 6, msglen) != 0) goto err; continue; } if((channel = sc_master_channel_find(ms, id)) == NULL) { remote_debug(__func__, "could not find channel %u", id); goto err; } /* the unix domain socket might have gone away but we need to flush */ if(channel->unix_wb != NULL) { if(scamper_writebuf_send(channel->unix_wb, ms->buf + 6, msglen) != 0) sc_unit_gc(channel->unit); sc_fd_write_add(channel->unix_fd); } } return; err: sc_unit_gc(ms->unit); return; } /* * sc_master_inet_read * */ static void sc_master_inet_read(sc_master_t *ms) { ssize_t rrc; uint8_t buf[4096]; #ifdef HAVE_OPENSSL int rc; #endif if((rrc = read(ms->inet_fd.fd, buf, sizeof(buf))) < 0) { if(errno == EAGAIN || errno == EINTR) return; remote_debug(__func__, "read failed: %s", strerror(errno)); goto err; } if(rrc == 0) { remote_debug(__func__, "%s disconnected", ms->name); goto err; } timeval_add_s(&ms->rx_abort, &now, 60); #ifdef HAVE_OPENSSL if(ms->inet_ssl != NULL) { BIO_write(ms->inet_rbio, buf, rrc); if(ms->inet_mode == SSL_MODE_ACCEPT) { if((rc = SSL_accept(ms->inet_ssl)) == 0) { remote_debug(__func__, "SSL_accept returned zero: %d", SSL_get_error(ms->inet_ssl, rc)); ERR_print_errors_fp(stderr); goto err; } else if(rc == 1) { ms->inet_mode = SSL_MODE_ESTABLISHED; if(ssl_want_read(ms) < 0) goto err; } else if(rc < 0) { rc = SSL_get_error(ms->inet_ssl, rc); remote_debug(__func__, "SSL_accept %d", rc); if(rc == SSL_ERROR_WANT_READ) { if(ssl_want_read(ms) < 0) goto err; } else if(rc != SSL_ERROR_WANT_WRITE) { remote_debug(__func__, "mode accept rc %d", rc); goto err; } } } else if(ms->inet_mode == SSL_MODE_ESTABLISHED) { while((rc = SSL_read(ms->inet_ssl, buf, sizeof(buf))) > 0) sc_master_inet_read_cb(ms, buf, (size_t)rc); if(rc < 0) { if((rc = SSL_get_error(ms->inet_ssl, rc)) == SSL_ERROR_WANT_READ) { if(ssl_want_read(ms) < 0) goto err; } else if(rc != SSL_ERROR_WANT_WRITE) { remote_debug(__func__, "mode estab rc %d", rc); goto err; } } } return; } #endif sc_master_inet_read_cb(ms, buf, (size_t)rrc); return; err: sc_unit_gc(ms->unit); return; } /* * sc_master_unix_accept * * a local process has connected to the unix domain socket that * corresponds to a remote scamper process. accept the socket and * cause the remote scamper process to create a new channel. */ static void sc_master_unix_accept(sc_master_t *ms) { struct sockaddr_storage ss; socklen_t socklen = sizeof(ss); sc_channel_t *cn = NULL; uint8_t msg[4+2+1+4]; int s = -1; if((s = accept(ms->unix_fd->fd, (struct sockaddr *)&ss, &socklen)) == -1) { remote_debug(__func__, "accept failed: %s", strerror(errno)); goto err; } if((cn = malloc_zero(sizeof(sc_channel_t))) == NULL) goto err; cn->id = ms->next_channel++; if(ms->next_channel == 0) ms->next_channel++; /* allocate a unit to describe this structure */ if((cn->unit = sc_unit_alloc(UNIT_TYPE_CHANNEL, cn)) == NULL) { remote_debug(__func__, "could not alloc unit: %s", strerror(errno)); goto err; } if((cn->unix_fd = sc_fd_alloc(s, FD_TYPE_CHANNEL_UNIX, cn->unit)) == NULL) { remote_debug(__func__, "could not alloc unix_fd: %s", strerror(errno)); goto err; } s = -1; sc_fd_read_add(cn->unix_fd); if((cn->unix_wb = scamper_writebuf_alloc()) == NULL) goto err; if((cn->node = dlist_tail_push(ms->channels, cn)) == NULL) goto err; cn->master = ms; bytes_htonl(msg+0, 0); bytes_htons(msg+4, 1 + 4); msg[6] = CONTROL_CHANNEL_NEW; bytes_htonl(msg+7, cn->id); if(sc_master_inet_send(ms, msg, 11) != 0) { goto err; } return; err: if(s != -1) close(s); if(cn != NULL) sc_channel_free(cn); return; } /* * sc_master_free * * clean up the sc_master_t. */ static void sc_master_free(sc_master_t *ms) { char filename[65535]; if(ms == NULL) return; /* * if unix_fd is not null, it is our responsibility to both close * the fd, and to unlink the socket from the file system */ if(ms->unix_fd != NULL) { sc_fd_free(ms->unix_fd); snprintf(filename, sizeof(filename), "%s/%s", unix_name, ms->name); unlink(filename); } if(ms->channels != NULL) dlist_free_cb(ms->channels, (dlist_free_t)sc_channel_free); if(ms->unit != NULL) sc_unit_free(ms->unit); if(ms->inet_fd.fd != -1) close(ms->inet_fd.fd); if(ms->inet_wb != NULL) scamper_writebuf_free(ms->inet_wb); #ifdef HAVE_OPENSSL if(ms->inet_ssl != NULL) { SSL_free(ms->inet_ssl); } else { if(ms->inet_wbio != NULL) BIO_free(ms->inet_wbio); if(ms->inet_rbio != NULL) BIO_free(ms->inet_rbio); } #endif if(ms->name != NULL) free(ms->name); if(ms->magic != NULL) free(ms->magic); if(ms->node != NULL) dlist_node_pop(mslist, ms->node); free(ms); return; } static sc_master_t *sc_master_alloc(int fd) { sc_master_t *ms = NULL; #ifdef HAVE_OPENSSL int rc; #endif if((ms = malloc_zero(sizeof(sc_master_t))) == NULL) return NULL; ms->inet_fd.fd = fd; fd = -1; ms->inet_fd.type = FD_TYPE_MASTER_INET; if((ms->channels = dlist_alloc()) == NULL) { remote_debug(__func__, "could not alloc channels: %s", strerror(errno)); goto err; } dlist_onremove(ms->channels, (dlist_onremove_t)sc_master_channels_onremove); ms->next_channel = 1; /* allocate a unit to describe this */ if((ms->unit = sc_unit_alloc(UNIT_TYPE_MASTER, ms)) == NULL) { remote_debug(__func__, "could not alloc unit: %s", strerror(errno)); goto err; } ms->inet_fd.unit = ms->unit; if((ms->inet_wb = scamper_writebuf_alloc()) == NULL) { remote_debug(__func__, "could not alloc wb: %s", strerror(errno)); goto err; } #ifdef HAVE_OPENSSL if(tls_certfile != NULL) { if((ms->inet_wbio = BIO_new(BIO_s_mem())) == NULL || (ms->inet_rbio = BIO_new(BIO_s_mem())) == NULL || (ms->inet_ssl = SSL_new(tls_ctx)) == NULL) { remote_debug(__func__, "could not alloc SSL"); goto err; } SSL_set_bio(ms->inet_ssl, ms->inet_rbio, ms->inet_wbio); SSL_set_accept_state(ms->inet_ssl); rc = SSL_accept(ms->inet_ssl); assert(rc == -1); if((rc = SSL_get_error(ms->inet_ssl, rc)) != SSL_ERROR_WANT_READ) { remote_debug(__func__, "unexpected %d from SSL_accept", rc); goto err; } if(ssl_want_read(ms) < 0) goto err; } #endif return ms; err: if(ms != NULL) sc_master_free(ms); if(fd != -1) close(fd); return NULL; } /* * sc_channel_unix_write * * we can write to the unix fd without blocking, so do so. */ static void sc_channel_unix_write(sc_channel_t *cn) { int gtzero; /* if we did a read which returned -1, then the unix_fd will be null */ if(cn->unix_fd == NULL) return; if(scamper_writebuf_write(cn->unix_fd->fd, cn->unix_wb) != 0) { remote_debug(__func__, "write to %s channel %u failed", cn->master->name, cn->id); goto err; } /* * if we still have data to write, then wait until we get signal to * write again */ if((gtzero = scamper_writebuf_gtzero(cn->unix_wb)) != 0) return; /* nothing more to write, so remove fd */ if(sc_fd_write_del(cn->unix_fd) != 0) { remote_debug(__func__, "could not delete unix write for %s channel %u", cn->master->name, cn->id); goto err; } /* got an EOF, so we're done now */ if((cn->flags & CHANNEL_FLAG_EOF_RX) != 0) { remote_debug(__func__, "received EOF for %s channel %u", cn->master->name, cn->id); sc_unit_gc(cn->unit); return; } return; err: /* got an error trying to write, so we're done */ sc_fd_free(cn->unix_fd); cn->unix_fd = NULL; scamper_writebuf_free(cn->unix_wb); cn->unix_wb = NULL; /* we've received an EOF, we're done */ if((cn->flags & CHANNEL_FLAG_EOF_RX) != 0) { sc_unit_gc(cn->unit); return; } return; } /* * sc_channel_unix_read * * a local client process has written to a unix domain socket, which * we will process line by line. */ static void sc_channel_unix_read(sc_channel_t *cn) { ssize_t rc; uint8_t buf[4096]; uint8_t hdr[4+2]; if((rc = read(cn->unix_fd->fd, buf, sizeof(buf))) <= 0) { if(rc == -1 && (errno == EAGAIN || errno == EINTR)) return; /* send an EOF if we haven't tx'd or rx'd an EOF */ if((cn->flags & (CHANNEL_FLAG_EOF_RX|CHANNEL_FLAG_EOF_TX)) == 0) { bytes_htonl(buf+0, 0); bytes_htons(buf+4, 5); buf[6] = CONTROL_CHANNEL_FIN; bytes_htonl(buf+7, cn->id); sc_master_inet_send(cn->master, buf, 11); cn->flags |= CHANNEL_FLAG_EOF_TX; } /* if we've received an EOF, we're done */ if((cn->flags & CHANNEL_FLAG_EOF_RX) != 0) { sc_unit_gc(cn->unit); return; } /* * if we've received an error, close down the file descriptor * and write buf. we keep the channel around so that when we * receive an EOF, we can match it and clean it up. */ if(rc == -1) { sc_fd_free(cn->unix_fd); cn->unix_fd = NULL; scamper_writebuf_free(cn->unix_wb); cn->unix_wb = NULL; } else { sc_fd_read_del(cn->unix_fd); } return; } bytes_htonl(hdr+0, cn->id); bytes_htons(hdr+4, rc); sc_master_inet_send(cn->master, hdr, 6); sc_master_inet_send(cn->master, buf, rc); return; } static void sc_channel_free(sc_channel_t *cn) { if(cn == NULL) return; if(cn->master != NULL && cn->node != NULL) dlist_node_pop(cn->master->channels, cn->node); if(cn->unix_fd != NULL) sc_fd_free(cn->unix_fd); if(cn->unix_lp != NULL) scamper_linepoll_free(cn->unix_lp, 0); if(cn->unix_wb != NULL) scamper_writebuf_free(cn->unix_wb); if(cn->unit != NULL) sc_unit_free(cn->unit); free(cn); return; } /* * serversocket_accept * * a new connection has arrived. accept the new connection while we wait * to understand the intention behind the socket. */ static int serversocket_accept(int ss) { struct sockaddr_storage sas; sc_master_t *ms = NULL; socklen_t slen; int inet_fd = -1; slen = sizeof(ss); if((inet_fd = accept(ss, (struct sockaddr *)&sas, &slen)) == -1) { remote_debug(__func__, "could not accept: %s", strerror(errno)); goto err; } if(fcntl_set(inet_fd, O_NONBLOCK) == -1) { remote_debug(__func__, "could not set O_NONBLOCK: %s", strerror(errno)); goto err; } ms = sc_master_alloc(inet_fd); inet_fd = -1; if(ms == NULL) goto err; if(sc_fd_read_add(&ms->inet_fd) != 0) { remote_debug(__func__, "could not monitor inet fd: %s", strerror(errno)); goto err; } timeval_add_s(&ms->rx_abort, &now, 30); timeval_cpy(&ms->tx_ka, &ms->rx_abort); if((ms->node = dlist_tail_push(mslist, ms)) == NULL) { remote_debug(__func__, "could not push to mslist: %s", strerror(errno)); goto err; } return 0; err: if(inet_fd != -1) close(inet_fd); if(ms != NULL) sc_master_free(ms); return -1; } /* * serversocket_init * * create two sockets so that we can use both IPv4 and IPv6 for incoming * connections from remote scamper processes. */ static int serversocket_init(void) { struct sockaddr_storage sas; int i, pf, opt; for(i=0; i<2; i++) { pf = i == 0 ? PF_INET : PF_INET6; if((pf == PF_INET && (options & OPT_IPV4) == 0) || (pf == PF_INET6 && (options & OPT_IPV6) == 0)) continue; if((serversockets[i] = socket(pf, SOCK_STREAM, IPPROTO_TCP)) < 0) { remote_debug(__func__, "could not open %s socket: %s", i == 0 ? "ipv4" : "ipv6", strerror(errno)); return -1; } opt = 1; if(setsockopt(serversockets[i], SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(opt)) != 0) { remote_debug(__func__, "could not set SO_REUSEADDR on %s socket: %s", i == 0 ? "ipv4" : "ipv6", strerror(errno)); return -1; } #ifdef IPV6_V6ONLY if(pf == PF_INET6) { opt = 1; if(setsockopt(serversockets[i], IPPROTO_IPV6, IPV6_V6ONLY, (char *)&opt, sizeof(opt)) != 0) { remote_debug(__func__, "could not set IPV6_V6ONLY: %s", strerror(errno)); return -1; } } #endif sockaddr_compose((struct sockaddr *)&sas, pf, NULL, port); if(bind(serversockets[i], (struct sockaddr *)&sas, sockaddr_len((struct sockaddr *)&sas)) != 0) { remote_debug(__func__, "could not bind %s socket to port %d: %s", i == 0 ? "ipv4" : "ipv6", port, strerror(errno)); return -1; } if(listen(serversockets[i], -1) != 0) { remote_debug(__func__, "could not listen %s socket: %s", i == 0 ? "ipv4" : "ipv6", strerror(errno)); return -1; } } return 0; } /* * unixdomain_direxists * * make sure the directory specified actually exists */ static int unixdomain_direxists(void) { struct stat sb; if(stat(unix_name, &sb) != 0) { usage(OPT_UNIX); remote_debug(__func__,"could not stat %s: %s",unix_name,strerror(errno)); return -1; } if((sb.st_mode & S_IFDIR) != 0) return 0; usage(OPT_UNIX); remote_debug(__func__, "%s is not a directory", unix_name); return -1; } static void cleanup(void) { int i; for(i=0; i<2; i++) close(serversockets[i]); if(mslist != NULL) dlist_free_cb(mslist, (dlist_free_t)sc_master_free); #ifdef HAVE_OPENSSL if(tls_ctx != NULL) SSL_CTX_free(tls_ctx); #endif if(gclist != NULL) dlist_free(gclist); #ifdef HAVE_EPOLL if(epfd != -1) close(epfd); #endif #ifdef HAVE_KQUEUE if(kqfd != -1) close(kqfd); #endif return; } static void remoted_sig(int sig) { if(sig == SIGHUP || sig == SIGINT) stop = 1; return; } #if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE) #if defined(HAVE_EPOLL) static int epoll_loop(void) #else static int kqueue_loop(void) #endif { #if defined(HAVE_EPOLL) struct epoll_event events[1024]; int events_c = sizeof(events) / sizeof(struct epoll_event); int timeout; #else struct kevent events[1024]; int events_c = sizeof(events) / sizeof(struct kevent); struct timespec ts, *timeout; #endif struct timeval tv, to; sc_master_t *ms; dlist_node_t *dn; sc_fd_t *scfd, scfd_ss[2]; sc_unit_t *scu; int i, rc; #if defined(HAVE_EPOLL) if((epfd = epoll_create(1000)) == -1) { remote_debug(__func__, "epoll_create failed: %s", strerror(errno)); return -1; } #else if((kqfd = kqueue()) == -1) { remote_debug(__func__, "kqueue failed: %s", strerror(errno)); return -1; } #endif /* add the server sockets to the poll set */ memset(&scfd_ss, 0, sizeof(scfd_ss)); for(i=0; i<2; i++) { if(serversockets[i] == -1) continue; scfd_ss[i].type = FD_TYPE_SERVER; scfd_ss[i].fd = serversockets[i]; if(sc_fd_read_add(&scfd_ss[i]) != 0) return -1; } /* main event loop */ while(stop == 0) { #if defined(HAVE_EPOLL) timeout = -1; #else timeout = NULL; #endif rc = 0; if((dn = dlist_head_node(mslist)) != NULL) { gettimeofday_wrap(&now); /* to start with, handle keepalives */ while(dn != NULL) { ms = dlist_node_item(dn); dn = dlist_node_next(dn); /* if the connection has gone silent, abort */ if(timeval_cmp(&now, &ms->rx_abort) >= 0) { sc_master_free(ms); continue; } /* * ensure we send something every 30 seconds. * unix_fd being not null signifies the remote controller * has received an opening "master" frame. */ if(ms->unix_fd != NULL && timeval_cmp(&now, &ms->tx_ka) >= 0) { timeval_add_s(&ms->tx_ka, &now, 30); if(sc_master_tx_keepalive(ms) != 0) { sc_master_free(ms); continue; } } /* now figure out timeout to set */ if(timeval_cmp(&ms->rx_abort, &ms->tx_ka) <= 0) timeval_diff_tv(&tv, &now, &ms->rx_abort); else timeval_diff_tv(&tv, &now, &ms->tx_ka); if(rc == 0) { timeval_cpy(&to, &tv); rc++; } else { if(timeval_cmp(&tv, &to) < 0) timeval_cpy(&to, &tv); } } } #if defined(HAVE_EPOLL) if(rc != 0) { timeout = (to.tv_sec * 1000) + (to.tv_usec / 1000); if(timeout == 0 && to.tv_usec != 0) timeout++; } if((rc = epoll_wait(epfd, events, events_c, timeout)) == -1) { if(errno == EINTR) continue; remote_debug(__func__, "epoll_wait failed: %s", strerror(errno)); return -1; } #else if(rc != 0) { ts.tv_sec = to.tv_sec; ts.tv_nsec = to.tv_usec * 1000; timeout = &ts; } if((rc = kevent(kqfd, NULL, 0, events, events_c, timeout)) == -1) { if(errno == EINTR) continue; remote_debug(__func__, "kqueue_event failed: %s", strerror(errno)); return -1; } #endif gettimeofday_wrap(&now); for(i=0; iunit) == NULL) { serversocket_accept(scfd->fd); continue; } #if defined(HAVE_EPOLL) if(events[i].events & EPOLLIN && scu->gc == 0) read_cb[scfd->type](scu->data); if(events[i].events & EPOLLOUT && scu->gc == 0) write_cb[scfd->type](scu->data); #else if(scu->gc != 0) continue; if(events[i].filter == EVFILT_READ) read_cb[scfd->type](scu->data); else if(events[i].filter == EVFILT_WRITE) write_cb[scfd->type](scu->data); #endif } while((scu = dlist_head_pop(gclist)) != NULL) unit_gc[scu->type](scu->data); } return 0; } #endif static int select_loop(void) { struct timeval tv, to, *timeout; fd_set rfds; fd_set wfds, *wfdsp; int i, count, nfds; dlist_node_t *dn, *dn2; sc_master_t *ms; sc_channel_t *cn; sc_unit_t *scu; while(stop == 0) { FD_ZERO(&rfds); FD_ZERO(&wfds); wfdsp = NULL; nfds = -1; timeout = NULL; for(i=0; i<2; i++) { if(serversockets[i] == -1) continue; FD_SET(serversockets[i], &rfds); if(serversockets[i] > nfds) nfds = serversockets[i]; } if((dn = dlist_head_node(mslist)) != NULL) { gettimeofday_wrap(&now); /* to start with, handle keepalives */ while(dn != NULL) { ms = dlist_node_item(dn); dn = dlist_node_next(dn); /* if the connection has gone silent, abort */ if(timeval_cmp(&now, &ms->rx_abort) >= 0) { sc_master_free(ms); continue; } /* * ensure we send something every 30 seconds * unix_fd being not null signifies the remote controller * has received an opening "master" frame. */ if(ms->unix_fd != NULL && timeval_cmp(&now, &ms->tx_ka) >= 0) { timeval_add_s(&ms->tx_ka, &now, 30); if(sc_master_tx_keepalive(ms) != 0) { sc_master_free(ms); continue; } } /* now figure out timeout to set */ if(timeval_cmp(&ms->rx_abort, &ms->tx_ka) <= 0) timeval_diff_tv(&tv, &now, &ms->rx_abort); else timeval_diff_tv(&tv, &now, &ms->tx_ka); if(timeout == NULL) { timeval_cpy(&to, &tv); timeout = &to; } else { if(timeval_cmp(&tv, &to) < 0) timeval_cpy(&to, &tv); } /* put the master inet socket into the select set */ FD_SET(ms->inet_fd.fd, &rfds); if(ms->inet_fd.fd > nfds) nfds = ms->inet_fd.fd; if(scamper_writebuf_len(ms->inet_wb) > 0) { FD_SET(ms->inet_fd.fd, &wfds); wfdsp = &wfds; } /* listen on the master unix domain socket for new connections */ if(ms->unix_fd != NULL) { FD_SET(ms->unix_fd->fd, &rfds); if(ms->unix_fd->fd > nfds) nfds = ms->unix_fd->fd; } /* set the unix domain sockets for connected systems */ dn2 = dlist_head_node(ms->channels); while(dn2 != NULL) { cn = dlist_node_item(dn2); dn2 = dlist_node_next(dn2); if(cn->unix_fd == NULL) continue; if((cn->unix_fd->flags & (FD_FLAG_READ|FD_FLAG_WRITE)) == 0) continue; if(cn->unix_fd->fd > nfds) nfds = cn->unix_fd->fd; if(cn->unix_fd->flags & FD_FLAG_READ) FD_SET(cn->unix_fd->fd, &rfds); if(cn->unix_fd->flags & FD_FLAG_WRITE) { FD_SET(cn->unix_fd->fd, &wfds); wfdsp = &wfds; } } } } if((count = select(nfds+1, &rfds, wfdsp, NULL, timeout)) < 0) { if(errno == EINTR) continue; remote_debug(__func__, "select failed: %s", strerror(errno)); return -1; } if(count > 0) { for(i=0; i<2; i++) { if(serversockets[i] != -1 && FD_ISSET(serversockets[i], &rfds) && serversocket_accept(serversockets[i]) != 0) return -1; } for(dn=dlist_head_node(mslist); dn != NULL; dn=dlist_node_next(dn)) { ms = dlist_node_item(dn); if(FD_ISSET(ms->inet_fd.fd, &rfds)) sc_master_inet_read(ms); if(ms->unit->gc == 0 && ms->unix_fd != NULL && FD_ISSET(ms->unix_fd->fd, &rfds)) sc_master_unix_accept(ms); if(ms->unit->gc == 0 && wfdsp != NULL && FD_ISSET(ms->inet_fd.fd, wfdsp)) sc_master_inet_write(ms); for(dn2 = dlist_head_node(ms->channels); dn2 != NULL && ms->unit->gc == 0; dn2 = dlist_node_next(dn2)) { cn = dlist_node_item(dn2); if(cn->unix_fd != NULL && FD_ISSET(cn->unix_fd->fd, &rfds)) sc_channel_unix_read(cn); if(wfdsp != NULL && cn->unix_fd != NULL && FD_ISSET(cn->unix_fd->fd, wfdsp)) sc_channel_unix_write(cn); } } } while((scu = dlist_head_pop(gclist)) != NULL) unit_gc[scu->type](scu->data); } return 0; } int main(int argc, char *argv[]) { int i; #ifndef _WIN32 struct sigaction si_sa; #endif #ifdef DMALLOC free(malloc(1)); #endif gettimeofday_wrap(&now); for(i=0; i<2; i++) serversockets[i] = -1; atexit(cleanup); if(check_options(argc, argv) != 0) return -1; #ifdef HAVE_OPENSSL if(tls_certfile != NULL) { SSL_library_init(); SSL_load_error_strings(); if((tls_ctx = SSL_CTX_new(SSLv23_method())) == NULL) return -1; if(SSL_CTX_use_certificate_chain_file(tls_ctx,tls_certfile)!=1) { remote_debug(__func__, "could not SSL_CTX_use_certificate_file"); ERR_print_errors_fp(stderr); return -1; } if(SSL_CTX_use_PrivateKey_file(tls_ctx,tls_privfile,SSL_FILETYPE_PEM)!=1) { remote_debug(__func__, "could not SSL_CTX_use_PrivateKey_file"); ERR_print_errors_fp(stderr); return -1; } SSL_CTX_set_verify(tls_ctx, SSL_VERIFY_NONE, NULL); SSL_CTX_set_options(tls_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1); } #endif #ifdef HAVE_DAEMON if((options & OPT_DAEMON) != 0 && daemon(1, 0) != 0) return -1; #endif #ifndef _WIN32 if(signal(SIGPIPE, SIG_IGN) == SIG_ERR) { remote_debug(__func__, "could not ignore SIGPIPE"); return -1; } sigemptyset(&si_sa.sa_mask); si_sa.sa_flags = 0; si_sa.sa_handler = remoted_sig; if(sigaction(SIGHUP, &si_sa, 0) == -1) { remote_debug(__func__, "could not set sigaction for SIGHUP"); return -1; } if(sigaction(SIGINT, &si_sa, 0) == -1) { remote_debug(__func__, "could not set sigaction for SIGINT"); return -1; } #endif if(unixdomain_direxists() != 0 || serversocket_init() != 0) return -1; if((mslist = dlist_alloc()) == NULL || (gclist = dlist_alloc()) == NULL) return -1; dlist_onremove(mslist, (dlist_onremove_t)sc_master_onremove); dlist_onremove(gclist, (dlist_onremove_t)sc_unit_onremove); #if defined(HAVE_EPOLL) if((flags & FLAG_SELECT) == 0) return epoll_loop(); #elif defined(HAVE_KQUEUE) if((flags & FLAG_SELECT) == 0) return kqueue_loop(); #endif return select_loop(); } scamper-cvs-20171204/utils/sc_remoted/Makefile.in000644 001751 000000 00000061615 13211200064 021442 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_remoted$(EXEEXT) subdir = utils/sc_remoted ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_remoted_OBJECTS = sc_remoted.$(OBJEXT) ../../utils.$(OBJEXT) \ ../../mjl_heap.$(OBJEXT) ../../mjl_list.$(OBJEXT) \ ../../mjl_splaytree.$(OBJEXT) \ ../../scamper/scamper_linepoll.$(OBJEXT) \ ../../scamper/scamper_writebuf.$(OBJEXT) sc_remoted_OBJECTS = $(am_sc_remoted_OBJECTS) sc_remoted_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = sc_remoted_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(sc_remoted_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_remoted_SOURCES) DIST_SOURCES = $(sc_remoted_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_remoted_SOURCES = \ sc_remoted.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c sc_remoted_LDADD = ../../scamper/libscamperfile.la @OPENSSL_LIBS@ sc_remoted_LDFLAGS = @OPENSSL_LDFLAGS@ man_MANS = sc_remoted.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_remoted/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_remoted/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_heap.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_splaytree.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../scamper/$(am__dirstamp): @$(MKDIR_P) ../../scamper @: > ../../scamper/$(am__dirstamp) ../../scamper/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../scamper/$(DEPDIR) @: > ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_linepoll.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_writebuf.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) sc_remoted$(EXEEXT): $(sc_remoted_OBJECTS) $(sc_remoted_DEPENDENCIES) $(EXTRA_sc_remoted_DEPENDENCIES) @rm -f sc_remoted$(EXEEXT) $(AM_V_CCLD)$(sc_remoted_LINK) $(sc_remoted_OBJECTS) $(sc_remoted_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) -rm -f ../../scamper/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_heap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_splaytree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_linepoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_writebuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_remoted.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) -rm -f ../../scamper/$(DEPDIR)/$(am__dirstamp) -rm -f ../../scamper/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_radargun/.cvsignore000644 001751 000000 00000000055 12647040143 021544 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_radargun scamper-cvs-20171204/utils/sc_radargun/Makefile.am000644 001751 000000 00000000526 12654251561 021611 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_radargun sc_radargun_SOURCES = \ sc_radargun.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c sc_radargun_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_radargun.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_radargun/sc_radargun.1000644 001751 000000 00000012715 13205201470 022115 0ustar00mjlwheel000000 000000 .Dd November 21, 2017 .Dt SC_RADARGUN 1 .Os .Sh NAME .Nm sc_radargun .Nd scamper driver to run radargun on a list of candidate aliases. .Sh SYNOPSIS .Nm .Bk -words .Op Fl ?D .Op Fl a Ar infile .Op Fl f Ar fudge .Op Fl o Ar outfile .Op Fl O Ar options .Op Fl p Ar port .Op Fl P Ar pps .Op Fl q Ar attempts .Op Fl r Ar wait-round .Op Fl R Ar round-count .Op Fl t Ar logfile .Op Fl U Ar unix .Ek .Pp .Nm .Bk -words .Op Fl d Ar dump data-file .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility provides the ability to connect to a running .Xr scamper 1 instance and infer which of the supplied IPv4 addresses are aliases using the Radargun technique. For all addresses in the file, .Nm establishes which probe methods (UDP, TCP-ack, ICMP-echo) solicit an incrementing IP-ID value, and then uses the Radargun technique on addresses where a probe method is able to obtain an incrementing IP-ID for the addresses. The output is written to a warts file. The options are as follows: .Bl -tag -width Ds .It Fl ? prints a list of command line options and a synopsis of each. .It Fl D causes .Nm to detach and become a daemon. .It Fl a Ar infile specifies the name of the input file which consists of a list of IPv4 addresses. The file can either contain sets to test, one set per line, or simply one set, one address per line. .It Fl d Ar dump specifies the dump ID to use to analyze the collected data. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy 1: dump inferred aliases. .It .Sy 2: dump interface classifications. .El .It Fl f Ar fudge specifies the fudge to use when inferring if a device is deriving IP-ID values from a counter. By default, responses the maximum difference between two samples must be no larger than 5000. The fudge value also impacts alias inference. If a value of zero is used, the IP-ID samples must simply be in order. .It Fl o Ar outfile specifies the name of the output file to be written. The output file will use the warts format. .It Fl O Ar options allows the behavior of .Nm to be further tailored. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy nobs: do not consider if IP-ID values might be byte-swapped in the header .It .Sy nobudget: do not consider if the radargun measurement can complete in the round time give the packets-per-second rate specified. .It .Sy noradargun: do not conduct radargun step. Stop after classifying interface IP-ID behavior. .It .Sy noreserved: do not probe reserved IP addresses. .It .Sy rows: the addresses in the input file are supplied in rows, and the radargun measurements will probe and evaluate each set independently. .It .Sy tc: when dumping candidate aliases, report the transitive closure, rather than pairs in isolation. .El .It Fl p Ar port specifies the port on the local host where .Xr scamper 1 is accepting control socket connections. .It Fl P Ar pps specifies the packets-per-second rate that scamper is running at. The PPS value is used to infer if the radargun measurement can fit in scamper's probe budget. .It Fl q Ar attempts specifies the number of probe packets to use to when inferring if an IP address assigns IP-ID values from a counter. .It Fl r Ar wait-round specifies the length of time, in seconds, each round should aim to complete in. By default, 30 seconds. .It Fl R Ar round-count specifies the number of rounds to pursue in radargun. By default, 30 rounds. .It Fl t Ar logfile specifies the name of a file to log progress output from .Nm generated at run time. .It Fl U Ar unix specifies the name of a unix domain socket where a local .Xr scamper 1 instance is accepting control socket connections. .El .\"""""""""""" .Sh EXAMPLES .Pp .Nm requires a .Xr scamper 1 instance listening on a port for commands in order to collect data, at 20 packets per second: .Pp .in +.3i .nf scamper -P 31337 -p 20 .fi .in -.3i .Pp will start a .Xr scamper 1 instance listening on port 31337 on the loopback interface. To use .Nm to infer which addresses might be aliases, listed in a file named set-1.txt .Pp .in +.3i .nf 192.0.2.2 192.0.32.10 192.0.30.64 192.0.31.8 .fi .in -.3i .Pp the following command will test these IP addresses for aliases using ICMP, UDP, and TCP probes (as appropriate) using the radargun technique with 10 rounds, each round taking 4 seconds: .Pp .in +.3i .nf sc_radargun -a set-1.txt -o set-1.warts -p 20 -r 4 -R 10 .fi .in -.3i .Pp To use .Nm to infer which addresses might be aliases, listed in a file named set-2.txt organized as sets of candidate aliases to test: .Pp .in +.3i .nf 192.0.2.2 192.0.32.10 192.0.30.64 192.0.31.8 192.0.2.3 192.0.32.11 192.0.30.65 192.0.31.9 .fi .in -.3i .Pp the following command will test these organized sets of IP addresses for aliases: .Pp .in +.3i .nf sc_radargun -a set-2.txt -o set-2.warts -p 20 -O rows .fi .in -.3i .Pp To use data previously collected with .Nm and stored in set-2.warts, to infer likely aliases, reported in pairs: .Pp .in +.3i .nf sc_radargun -d 1 set-2.warts .fi .in -.3i .Pp To use data previously collected with .Nm and stored in set-2.warts, to report interface IP-ID classifications: .Pp .in +.3i .nf sc_radargun -d 2 set-2.warts .fi .in -.3i .Sh SEE ALSO .Rs .%A "A. Bender" .%A "R. Sherwood" .%A "N. Spring" .%T "Fixing Ally's growing pains with velocity modeling" .%O "Proc ACM Internet Measurement Conference 2008" .Re .Xr scamper 1 , .Xr sc_ally 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2json 1 .Sh AUTHORS .Nm was written by Matthew Luckie , but the original implementation was by Bender et al. scamper-cvs-20171204/utils/sc_radargun/sc_radargun.c000644 001751 000000 00000137750 13205201470 022206 0ustar00mjlwheel000000 000000 /* * sc_radargun : scamper driver to do radargun-style probing. * * $Id: sc_radargun.c,v 1.8 2017/11/22 04:55:20 mjl Exp $ * * Copyright (C) 2014 The Regents of the University of California * Copyright (C) 2016 The University of Waikato * Author: Matthew Luckie * * Radargun technique authored by: * A. Bender, R. Sherwood, N. Spring; "Fixing Ally's growing pains with * velocity modeling", in Proc. Internet Measurement Conference 2008. * * MIDAR technique authored by: * K. Keys, Y. Hyun, M. Luckie, k claffy; "Internet-scale IPv4 alias * resolution with MIDAR", in IEEE/ACM Transaction on Networking, 2013. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_radargun.c,v 1.8 2017/11/22 04:55:20 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "ping/scamper_ping.h" #include "dealias/scamper_dealias.h" #include "scamper_file.h" #include "mjl_list.h" #include "mjl_heap.h" #include "mjl_splaytree.h" #include "utils.h" typedef struct sc_ipid { scamper_dealias_probedef_t *def; uint32_t seq; struct timeval tx; struct timeval rx; uint32_t ipid; } sc_ipid_t; /* * sc_addrset * */ typedef struct sc_addrset { slist_t *addrs; dlist_node_t *node; } sc_addrset_t; /* * sc_addr2set_t * */ typedef struct sc_addr2set { scamper_addr_t *addr; sc_addrset_t *set; } sc_addr2set_t; typedef struct sc_ping { scamper_addr_t *addr; uint8_t method; uint8_t class; } sc_ping_t; typedef struct sc_test { int type; void *data; } sc_test_t; typedef struct sc_target { scamper_addr_t *addr; sc_test_t *test; slist_t *blocked; splaytree_node_t *node; } sc_target_t; typedef struct sc_waittest { struct timeval tv; sc_test_t *test; } sc_waittest_t; typedef struct sc_pingtest { sc_test_t *test; sc_ping_t *ping; sc_target_t *target; } sc_pingtest_t; typedef struct sc_radargun { sc_test_t *test; slist_t *targets; dlist_t *addrs; dlist_node_t *addrs_dn; clist_node_t *rglist_cn; } sc_radargun_t; typedef struct sc_dump { char *descr; int (*init)(void); int (*proc_ping)(scamper_ping_t *ping); int (*proc_dealias)(scamper_dealias_t *dealias); void (*finish)(void); } sc_dump_t; static int process_dealias_1(scamper_dealias_t *); static int init_2(void); static int process_ping_2(scamper_ping_t *); static void finish_2(void); static uint32_t options = 0; static uint32_t flags = 0; static int scamper_fd = -1; static char *readbuf = NULL; static size_t readbuf_len = 0; static int port = 31337; static char *unix_name = NULL; static char *addrfile = NULL; static char *outfile_name = NULL; static int outfile_fd = -1; static scamper_file_filter_t *ffilter = NULL; static scamper_file_t *decode_in = NULL; static int decode_in_fd = -1; static int decode_out_fd = -1; static int data_left = 0; static int more = 0; static int probing = 0; static int attempts = 5; static int pps = 20; static int round_count = 30; static int wait_probe = 1000; static int fudge = 0; static int wait_round = 0; static splaytree_t *pingtree = NULL; static clist_t *rglist = NULL; static clist_node_t *rglist_cn = NULL; static splaytree_t *targets = NULL; static heap_t *waiting = NULL; static int waittime = 5; static struct timeval now; static FILE *logfile = NULL; static int dump_id = 0; static char *dump_file = NULL; static const sc_dump_t dump_funcs[] = { {NULL, NULL, NULL}, {"dump inferred aliases", NULL, NULL, process_dealias_1, NULL}, {"dump interface classifications", init_2, process_ping_2, NULL, finish_2}, }; static int dump_funcc = sizeof(dump_funcs) / sizeof(sc_dump_t); #define OPT_HELP 0x000001 #define OPT_ADDRFILE 0x000002 #define OPT_OUTFILE 0x000004 #define OPT_PORT 0x000008 #define OPT_LOGFILE 0x000010 #define OPT_UNIX 0x000020 #define OPT_FUDGE 0x000040 #define OPT_OPTIONS 0x000080 #define OPT_ATTEMPTS 0x000200 #define OPT_ROUNDCOUNT 0x000400 #define OPT_DAEMON 0x000800 #define OPT_PPS 0x001000 #define OPT_WAITROUND 0x002000 #define OPT_DUMP 0x020000 #define FLAG_NOBS 0x0001 #define FLAG_NORESERVED 0x0002 #define FLAG_ROWS 0x0004 #define FLAG_NOBUDGET 0x0008 #define FLAG_TC 0x0010 #define IPID_NONE 0 #define IPID_INCR 1 #define IPID_RAND 2 #define IPID_ECHO 3 #define IPID_CONST 4 #define IPID_UNRESP 5 static const char *ipid_classes[] = {"none", "incr", "rand", "echo", "const", "unresp"}; #define METHOD_ICMP 0 #define METHOD_TCP 1 #define METHOD_UDP 2 #define METHOD_MAX 2 #define METHOD_NONE 3 #define TEST_PING 0 #define TEST_RADARGUN 1 static void usage(uint32_t opt_mask) { int i; fprintf(stderr, "usage:\n" " sc_radargun [-D]\n" " [-a addrfile] [-o outfile] [-p port] [-U unix]\n" " [-f fudge] [-O options] [-P pps] [-q attempts]\n" " [-r wait-round] [-R round-count] [-t log]\n" "\n" " sc_radargun [-d dump] file.warts\n" "\n" " sc_radargun -?\n" "\n"); if(opt_mask == 0) return; if(opt_mask & OPT_HELP) fprintf(stderr, " -?: give an overview of the usage of sc_radargun\n"); if(opt_mask & OPT_ADDRFILE) fprintf(stderr, " -a: input addressfile\n"); if(opt_mask & OPT_DUMP) { fprintf(stderr, " -d: dump id\n"); for(i=1; i 10000) { usage(OPT_FUDGE); return -1; } fudge = lo; } else { if((options & OPT_DUMP) == 0) fudge = 5000; } if((options & OPT_DUMP) != 0) { /* no other options permitted when -d is used */ if((options & ~(OPT_DUMP|OPT_FUDGE)) != 0 || argc - optind != 1) { usage(0); return -1; } if(string_tolong(opt_dump, &lo) != 0 || lo < 1 || lo > dump_funcc) { usage(OPT_DUMP); return -1; } dump_id = lo; dump_file = argv[optind]; return 0; } if((options & (OPT_ADDRFILE|OPT_OUTFILE)) == 0 || (options & (OPT_PORT|OPT_UNIX)) == 0 || (options & (OPT_PORT|OPT_UNIX)) == (OPT_PORT|OPT_UNIX)) { usage(OPT_ADDRFILE|OPT_OUTFILE|OPT_PORT|OPT_UNIX); return -1; } if(options & OPT_PORT) { if(string_tolong(opt_port, &lo) != 0 || lo < 1 || lo > 65535) { usage(OPT_PORT); return -1; } port = lo; } if(options & OPT_ATTEMPTS) { if(string_tolong(opt_attempts, &lo) != 0 || lo < 1 || lo > 10) { usage(OPT_ATTEMPTS); return -1; } attempts = lo; } if(options & OPT_PPS) { if(string_tolong(opt_pps, &lo) != 0 || lo < 1 || lo > 1000) { usage(OPT_PPS); return -1; } pps = lo; } if(options & OPT_ROUNDCOUNT) { if(string_tolong(opt_roundcount, &lo) != 0 || lo < 5 || lo > 60) { usage(OPT_ROUNDCOUNT); return -1; } round_count = lo; } if(options & OPT_WAITROUND) { if(string_tolong(opt_waitround, &lo) != 0 || lo < 1 || lo > 60) { usage(OPT_WAITROUND); return -1; } wait_round = (lo * 1000); } if(opt_logfile != NULL) { if((logfile = fopen(opt_logfile, "w")) == NULL) { usage(OPT_LOGFILE); fprintf(stderr, "could not open %s\n", opt_logfile); return -1; } } return 0; } static int tree_to_dlist(void *ptr, void *entry) { if(dlist_tail_push((dlist_t *)ptr, entry) != NULL) return 0; return -1; } static int tree_to_slist(void *ptr, void *entry) { if(slist_tail_push((slist_t *)ptr, entry) != NULL) return 0; return -1; } static void print(char *format, ...) { va_list ap; char msg[512]; va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); if(msg[510] != '\n') { msg[506] = ' '; msg[507] = msg[508] = msg[509] = '.'; msg[510] = '\n'; msg[511] = '\0'; } printf("%ld: %s", (long int)now.tv_sec, msg); if(logfile != NULL) { fprintf(logfile, "%ld: %s", (long int)now.tv_sec, msg); fflush(logfile); } return; } static void status(char *format, ...) { va_list ap; char pref[32]; char msg[512]; snprintf(pref, sizeof(pref), "p %d, w %d, r %d", probing, heap_count(waiting), clist_count(rglist)); va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); print("%s : %s\n", pref, msg); return; } static sc_test_t *sc_test_alloc(int type, void *data) { sc_test_t *test; if((test = malloc_zero(sizeof(sc_test_t))) == NULL) return NULL; test->type = type; test->data = data; return test; } static void sc_test_free(sc_test_t *test) { if(test != NULL) free(test); return; } static int sc_waittest_cmp(const void *va, const void *vb) { const sc_waittest_t *a = va; const sc_waittest_t *b = vb; return timeval_cmp(&b->tv, &a->tv); } static int sc_waittest(sc_test_t *test) { sc_waittest_t *wt; if((wt = malloc_zero(sizeof(sc_waittest_t))) == NULL) return -1; timeval_add_s(&wt->tv, &now, waittime); wt->test = test; if(heap_insert(waiting, wt) == NULL) return -1; return 0; } static void sc_target_detach(sc_target_t *tg) { sc_test_t *test; char buf[128]; if(tg == NULL) return; if(tg->node != NULL) { if(splaytree_remove_node(targets, tg->node) != 0) { print("%s: could not remove %s from tree\n", __func__, scamper_addr_tostr(tg->addr, buf, sizeof(buf))); } tg->node = NULL; } if(tg->blocked != NULL) { while((test = slist_head_pop(tg->blocked)) != NULL) sc_waittest(test); slist_free(tg->blocked); tg->blocked = NULL; } return; } static void sc_target_free(sc_target_t *tg) { if(tg == NULL) return; sc_target_detach(tg); if(tg->addr != NULL) scamper_addr_free(tg->addr); free(tg); return; } static int sc_target_cmp(const sc_target_t *a, const sc_target_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static sc_target_t *sc_target_alloc(scamper_addr_t *addr) { sc_target_t *tg = NULL; if((tg = malloc_zero(sizeof(sc_target_t))) == NULL) { fprintf(stderr, "could not malloc target\n"); return NULL; } tg->addr = scamper_addr_use(addr); return tg; } static int sc_target_block(sc_target_t *target, sc_test_t *block) { if(target->blocked == NULL && (target->blocked = slist_alloc()) == NULL) { fprintf(stderr, "could not alloc target->blocked list\n"); return -1; } if(slist_tail_push(target->blocked, block) == NULL) { fprintf(stderr, "could not add test to blocked list\n"); return -1; } return 0; } static sc_target_t *sc_target_find(sc_target_t *target) { return splaytree_find(targets, target); } static sc_target_t *sc_target_findaddr(scamper_addr_t *addr) { sc_target_t findme; findme.addr = addr; return sc_target_find(&findme); } static int sc_target_add(sc_target_t *target) { char buf[128]; assert(target->node == NULL); assert(target->test != NULL); if((target->node = splaytree_insert(targets, target)) == NULL) { print("%s: could not add %s to tree\n", __func__, scamper_addr_tostr(target->addr, buf, sizeof(buf))); return -1; } return 0; } static void sc_ping_free(sc_ping_t *ping) { if(ping == NULL) return; if(ping->addr != NULL) scamper_addr_free(ping->addr); free(ping); return; } static int sc_ping_human_cmp(const sc_ping_t *a, const sc_ping_t *b) { return scamper_addr_human_cmp(a->addr, b->addr); } static int sc_ping_cmp(const sc_ping_t *a, const sc_ping_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static sc_ping_t *sc_ping_find(scamper_addr_t *addr) { sc_ping_t fm; fm.addr = addr; return splaytree_find(pingtree, &fm); } static void sc_pingtest_free(sc_pingtest_t *pt) { if(pt == NULL) return; if(pt->target != NULL) sc_target_free(pt->target); if(pt->test != NULL) sc_test_free(pt->test); if(pt->ping != NULL) sc_ping_free(pt->ping); free(pt); return; } static sc_test_t *sc_pingtest_alloc(scamper_addr_t *addr) { sc_pingtest_t *pt = NULL; if((pt = malloc_zero(sizeof(sc_pingtest_t))) == NULL || (pt->ping = malloc_zero(sizeof(sc_ping_t))) == NULL || (pt->test = sc_test_alloc(TEST_PING, pt)) == NULL || (pt->target = sc_target_alloc(addr)) == NULL) goto err; pt->target->test = pt->test; pt->ping->addr = scamper_addr_use(addr); if(sc_target_add(pt->target) != 0) goto err; return pt->test; err: if(pt != NULL) sc_pingtest_free(pt); return NULL; } static void sc_radargun_free(sc_radargun_t *rg) { if(rg == NULL) return; if(rg->targets != NULL) slist_free_cb(rg->targets, (slist_free_t)sc_target_free); if(rg->test != NULL) sc_test_free(rg->test); if(rg->addrs != NULL) dlist_free_cb(rg->addrs, (dlist_free_t)scamper_addr_free); free(rg); return; } static sc_radargun_t *sc_radargun_alloc(void) { sc_radargun_t *rg; if((rg = malloc_zero(sizeof(sc_radargun_t))) == NULL || (rg->addrs = dlist_alloc()) == NULL || (rg->test = sc_test_alloc(TEST_RADARGUN, rg)) == NULL || (rg->rglist_cn = clist_head_push(rglist, rg->test)) == NULL) goto err; return rg; err: if(rg != NULL) sc_radargun_free(rg); return NULL; } static const char *method_tostr(uint8_t method) { if(method == METHOD_TCP) return "tcp-ack-sport"; else if(method == METHOD_UDP) return "udp-dport"; else if(method == METHOD_ICMP) return "icmp-echo"; return NULL; } static int do_method_ping(sc_test_t *test, char **cmd_out, size_t *len_out) { sc_pingtest_t *pt = test->data; size_t off = 0; char cmd[256]; char buf[64]; string_concat(cmd, sizeof(cmd), &off, "ping -P %s -i %d", method_tostr(pt->ping->method), wait_probe / 1000); if((wait_probe % 1000) != 0) string_concat(cmd, sizeof(cmd), &off, ".%d", wait_probe % 1000); string_concat(cmd, sizeof(cmd), &off, " -c %d -o %d %s\n", attempts+2, attempts, scamper_addr_tostr(pt->ping->addr, buf, sizeof(buf))); *len_out = off; *cmd_out = strdup(cmd); return 0; } static int do_method_radargun(sc_test_t *test, char **cmd_out, size_t *len_out) { sc_radargun_t *rg = test->data; scamper_addr_t *addr; sc_target_t *tg; sc_test_t *test2; sc_ping_t *ping; dlist_node_t *dn, *dn2; size_t i, incrc; char **defs = NULL, *cmd = NULL; char tmp[256], buf[64], header[128]; size_t len = 0; size_t off; int rg_waitprobe = 0; *cmd_out = NULL; *len_out = 0; /* to start with, we need to figure out how to probe each address */ while(rg->addrs_dn != NULL) { addr = dlist_node_item(rg->addrs_dn); rg->addrs_dn = dlist_node_next(rg->addrs_dn); if(sc_ping_find(addr) == NULL && sc_target_findaddr(addr) == NULL) { if((test2 = sc_pingtest_alloc(addr)) == NULL) { print("%s: could not alloc pingtest for %s\n", __func__, scamper_addr_tostr(addr, buf, sizeof(buf))); goto err; } return do_method_ping(test2, cmd_out, len_out); } } if(rg->rglist_cn != NULL) { if(rglist_cn == rg->rglist_cn) { rglist_cn = clist_node_next(rg->rglist_cn); if(rglist_cn == rg->rglist_cn) rglist_cn = NULL; } clist_node_pop(rglist, rg->rglist_cn); rg->rglist_cn = NULL; } /* wait for all ping tests to complete */ dn = dlist_head_node(rg->addrs); while(dn != NULL) { dn2 = dlist_node_next(dn); addr = dlist_node_item(dn); if((ping = sc_ping_find(addr)) == NULL) { if((tg = sc_target_findaddr(addr)) == NULL) { print("%s: could not find pingtest for %s\n", __func__, scamper_addr_tostr(addr, buf, sizeof(buf))); goto err; } sc_target_block(tg, test); return 0; } else if(ping->method == METHOD_NONE) { dlist_node_pop(rg->addrs, dn); } else if((tg = sc_target_findaddr(addr)) != NULL) { sc_target_block(tg, test); return 0; } dn = dn2; } /* all ping tests have completed, and we have the all clear to probe */ if((incrc = dlist_count(rg->addrs)) < 2) { sc_radargun_free(rg); return 0; } if(round_count == 0) round_count = 30; if(wait_round == 0) { if(incrc < 30) { wait_round = incrc * 1000; rg_waitprobe = 1000; } else { wait_round = 30000; } } if(rg_waitprobe == 0) rg_waitprobe = wait_round / incrc; if((flags & FLAG_NOBUDGET) == 0 && (1000 / pps) > rg_waitprobe) { print("%s: unable to use available probing budget: %d > %d, %d\n", __func__, 1000/pps, rg_waitprobe); sc_radargun_free(rg); return 0; } if((defs = malloc_zero(sizeof(char *) * incrc)) == NULL) { print("%s: could not malloc %d defs\n", __func__, incrc); goto err; } string_concat(header, sizeof(header), &len, "dealias -m radargun -O shuffle -q %d -W %d -r %d", round_count, rg_waitprobe, wait_round); if((rg->targets = slist_alloc()) == NULL) { print("%s: could not alloc list\n", __func__); goto err; } dlist_qsort(rg->addrs, (dlist_cmp_t)scamper_addr_human_cmp); i = 0; for(dn=dlist_head_node(rg->addrs); dn != NULL; dn=dlist_node_next(dn)) { addr = dlist_node_item(dn); scamper_addr_tostr(addr, buf, sizeof(buf)); if((tg = sc_target_alloc(addr)) == NULL) { print("%s: could not alloc target for %s\n", __func__, buf); goto err; } tg->test = test; if(sc_target_add(tg) != 0 || slist_tail_push(rg->targets, tg) == NULL) { print("%s: could not add target for %s\n", __func__, buf); goto err; } ping = sc_ping_find(addr); off = 0; string_concat(tmp, sizeof(tmp), &off, " -p '-P %s -i %s'", method_tostr(ping->method), scamper_addr_tostr(addr, buf, sizeof(buf))); if((defs[i] = strdup(tmp)) == NULL) { print("%s: could not dup str %s\n", __func__); goto err; } len += off; i++; } len += 2; /* \n\0 */ if((cmd = malloc(len)) == NULL) { print("%s: could not malloc cmd string of %d bytes\n", __func__, len); goto err; } off = 0; string_concat(cmd, len, &off, "%s", header); for(i=0; itv) >= 0) { test = wt->test; heap_remove(waiting); free(wt); } else if(rglist_cn != NULL && (rglist_cn = clist_node_next(rglist_cn)) != NULL) { test = clist_node_item(rglist_cn); } else { return 0; } /* something went wrong */ if(func[test->type](test, &cmd, &off) != 0) { fprintf(stderr, "something went wrong\n"); return -1; } if(off > 0) break; } /* got a command, send it */ write_wrap(scamper_fd, cmd, NULL, off); probing++; more--; print("p %d, w %d, r %d : %s", probing, heap_count(waiting), clist_count(rglist), cmd); free(cmd); return 0; } static int ping_classify(scamper_ping_t *ping) { scamper_ping_reply_t *rx; int rc = -1, echo = 0, bs = 0, nobs = 0; int i, samples[65536]; uint32_t u32, f, n0, n1; slist_t *list = NULL; slist_node_t *ln0, *ln1; if(ping->stop_reason == SCAMPER_PING_STOP_NONE || ping->stop_reason == SCAMPER_PING_STOP_ERROR) return IPID_UNRESP; if((list = slist_alloc()) == NULL) goto done; memset(samples, 0, sizeof(samples)); for(i=0; iping_sent; i++) { if((rx = ping->ping_replies[i]) != NULL && SCAMPER_PING_REPLY_FROM_TARGET(ping, rx)) { /* * if at least two of four samples have the same ipid as what was * sent, then declare it echos. this handles the observed case * where some responses echo but others increment. */ if(rx->probe_ipid == rx->reply_ipid && ++echo > 1) { rc = IPID_ECHO; goto done; } /* * if two responses have the same IPID value, declare that it * replies with a constant IPID */ if(++samples[rx->reply_ipid] > 1) { rc = IPID_CONST; goto done; } if(slist_tail_push(list, rx) == NULL) goto done; } } if(slist_count(list) < attempts) { rc = IPID_UNRESP; goto done; } f = (fudge == 0) ? 5000 : fudge; ln0 = slist_head_node(list); ln1 = slist_node_next(ln0); while(ln1 != NULL) { rx = slist_node_item(ln0); n0 = rx->reply_ipid; rx = slist_node_item(ln1); n1 = rx->reply_ipid; if(n0 < n1) u32 = n1 - n0; else u32 = (n1 + 0x10000) - n0; if(u32 > f) nobs++; if((flags & FLAG_NOBS) == 0) { n0 = byteswap16(n0); n1 = byteswap16(n1); if(n0 < n1) u32 = n1 - n0; else u32 = (n1 + 0x10000) - n0; if(u32 > f) bs++; } ln0 = ln1; ln1 = slist_node_next(ln0); } if(nobs != 0 && ((flags & FLAG_NOBS) != 0 || bs != 0)) rc = IPID_RAND; else rc = IPID_INCR; done: if(list != NULL) slist_free(list); return rc; } static int process_ping(scamper_ping_t *ping) { sc_pingtest_t *pt; sc_target_t *tg; sc_test_t *tt; char buf[64]; int c; if((tg = sc_target_findaddr(ping->dst)) == NULL || (c = ping_classify(ping)) < 0) goto err; scamper_ping_free(ping); ping = NULL; tt = tg->test; pt = tt->data; if(c != IPID_INCR) { if(pt->ping->method == METHOD_MAX) { status("%s not-incr", scamper_addr_tostr(pt->ping->addr, buf, sizeof(buf))); pt->ping->method = METHOD_NONE; goto done; } pt->ping->method++; if(sc_waittest(tg->test) != 0) goto err; return 0; } status("%s %s incr", scamper_addr_tostr(pt->ping->addr, buf, sizeof(buf)), method_tostr(pt->ping->method)); done: if(splaytree_insert(pingtree, pt->ping) == NULL) goto err; pt->ping = NULL; sc_pingtest_free(pt); return 0; err: if(ping != NULL) scamper_ping_free(ping); return -1; } static int process_dealias(scamper_dealias_t *dealias) { scamper_dealias_radargun_t *srg = dealias->data; sc_radargun_t *rg; sc_target_t *tg; if((tg = sc_target_findaddr(srg->probedefs[0].dst)) == NULL) goto err; rg = tg->test->data; sc_radargun_free(rg); scamper_dealias_free(dealias); return 0; err: scamper_dealias_free(dealias); return -1; } static int do_decoderead(void) { void *data; uint16_t type; /* try and read a traceroute from the warts decoder */ if(scamper_file_read(decode_in, ffilter, &type, &data) != 0) { fprintf(stderr, "do_decoderead: scamper_file_read errno %d\n", errno); return -1; } if(data == NULL) return 0; probing--; if(type == SCAMPER_FILE_OBJ_PING) return process_ping(data); else if(type == SCAMPER_FILE_OBJ_DEALIAS) return process_dealias(data); return -1; } /* * do_scamperread * * the fd for the scamper process is marked as readable, so do a read * on it. */ static int do_scamperread(void) { ssize_t rc; uint8_t uu[64]; char *ptr, *head; char buf[512]; void *tmp; long l; size_t i, uus, linelen; if((rc = read(scamper_fd, buf, sizeof(buf))) > 0) { if(readbuf_len == 0) { if((readbuf = memdup(buf, rc)) == NULL) { return -1; } readbuf_len = rc; } else { if((tmp = realloc(readbuf, readbuf_len + rc)) != NULL) { readbuf = tmp; memcpy(readbuf+readbuf_len, buf, rc); readbuf_len += rc; } else return -1; } } else if(rc == 0) { close(scamper_fd); scamper_fd = -1; } else if(errno == EINTR || errno == EAGAIN) { return 0; } else { fprintf(stderr, "could not read: errno %d\n", errno); return -1; } /* process whatever is in the readbuf */ if(readbuf_len == 0) { goto done; } head = readbuf; for(i=0; i 0) { uus = sizeof(uu); if(uudecode_line(head, linelen, uu, &uus) != 0) { fprintf(stderr, "could not uudecode_line\n"); goto err; } if(uus != 0) { write_wrap(decode_out_fd, uu, NULL, uus); write_wrap(outfile_fd, uu, NULL, uus); } data_left -= (linelen + 1); } /* if the scamper process is asking for more tasks, give it more */ else if(linelen == 4 && strncasecmp(head, "MORE", linelen) == 0) { more++; if(do_method() != 0) goto err; } /* new piece of data */ else if(linelen > 5 && strncasecmp(head, "DATA ", 5) == 0) { l = strtol(head+5, &ptr, 10); if(*ptr != '\n' || l < 1) { head[linelen] = '\0'; fprintf(stderr, "could not parse %s\n", head); goto err; } data_left = l; } /* feedback letting us know that the command was accepted */ else if(linelen >= 2 && strncasecmp(head, "OK", 2) == 0) { /* nothing to do */ } /* feedback letting us know that the command was not accepted */ else if(linelen >= 3 && strncasecmp(head, "ERR", 3) == 0) { goto err; } else { head[linelen] = '\0'; fprintf(stderr, "unknown response '%s'\n", head); goto err; } head = &readbuf[i+1]; } } if(head != &readbuf[readbuf_len]) { readbuf_len = &readbuf[readbuf_len] - head; ptr = memdup(head, readbuf_len); free(readbuf); readbuf = ptr; } else { readbuf_len = 0; free(readbuf); readbuf = NULL; } done: return 0; err: return -1; } /* * addrfile_resolve: * * */ static int addrfile_resolve(const char *str, splaytree_t *tree) { scamper_addr_t *addr = NULL; if((addr = scamper_addr_resolve(AF_INET, str)) == NULL) goto err; if((flags & FLAG_NORESERVED) != 0 && scamper_addr_isreserved(addr) != 0) { scamper_addr_free(addr); return 0; } if(splaytree_find(tree,addr) == NULL) { if(splaytree_insert(tree,addr) == NULL) goto err; } else { scamper_addr_free(addr); } return 0; err: if(addr != NULL) scamper_addr_free(addr); return -1; } /* * addrfile_line: * * */ static int addrfile_line(char *line, void *param) { splaytree_t *tree = param; sc_radargun_t *rg = NULL; char *start, *ptr; int last = 0; if(line[0] == '#' || line[0] == '\0') return 0; if(flags & FLAG_ROWS) { start = ptr = line; while(last == 0) { if(*ptr == '\0' || isspace(*ptr) != 0) { if(*ptr == '\0') last = 1; *ptr = '\0'; if(addrfile_resolve(start, tree) != 0) goto err; if(last == 0) { ptr++; while(*ptr != '\0' && isspace(*ptr) != 0) ptr++; if(*ptr == '\0') last = 1; else start = ptr; } } else ptr++; } if((rg = sc_radargun_alloc()) == NULL) goto err; splaytree_inorder(tree, tree_to_dlist, rg->addrs); splaytree_empty(tree, NULL); dlist_shuffle(rg->addrs); rg->addrs_dn = dlist_head_node(rg->addrs); } else { if(addrfile_resolve(line, tree) != 0) goto err; } return 0; err: return -1; } static int do_addrfile(void) { splaytree_t *tree; sc_radargun_t *rg; if((tree = splaytree_alloc((splaytree_cmp_t)scamper_addr_cmp)) == NULL || file_lines(addrfile, addrfile_line, tree) != 0) goto err; if((flags & FLAG_ROWS) == 0) { if((rg = sc_radargun_alloc()) == NULL) goto err; splaytree_inorder(tree, tree_to_dlist, rg->addrs); splaytree_empty(tree, NULL); dlist_shuffle(rg->addrs); rg->addrs_dn = dlist_head_node(rg->addrs); } rglist_cn = clist_head_node(rglist); splaytree_free(tree, (splaytree_free_t)scamper_addr_free); return 0; err: if(tree != NULL) splaytree_free(tree, (splaytree_free_t)scamper_addr_free); return -1; } /* * do_files * * open a socketpair that can be used to feed warts data into one end and * have the scamper_file routines decode it via the other end. * * also open a file to send the binary warts data file to. */ static int do_files(void) { mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; int flags = O_WRONLY | O_CREAT | O_TRUNC; int pair[2]; if((outfile_fd = open(outfile_name, flags, mode)) == -1) return -1; /* * setup a socketpair that is used to decode warts from a binary input. * pair[0] is used to write to the file, while pair[1] is used by * the scamper_file_t routines to parse the warts data. */ if(socketpair(AF_UNIX, SOCK_STREAM, 0, pair) != 0) return -1; decode_in_fd = pair[0]; decode_out_fd = pair[1]; decode_in = scamper_file_openfd(decode_in_fd, NULL, 'r', "warts"); if(decode_in == NULL) return -1; if(fcntl_set(decode_in_fd, O_NONBLOCK) == -1) return -1; return 0; } /* * do_scamperconnect * * allocate socket and connect to scamper process listening on the port * specified. */ static int do_scamperconnect(void) { #ifdef HAVE_SOCKADDR_UN struct sockaddr_un sn; #endif struct sockaddr_in sin; struct in_addr in; if(options & OPT_PORT) { inet_aton("127.0.0.1", &in); sockaddr_compose((struct sockaddr *)&sin, AF_INET, &in, port); if((scamper_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { fprintf(stderr, "could not allocate new socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sin, sizeof(sin)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } return 0; } #ifdef HAVE_SOCKADDR_UN else if(options & OPT_UNIX) { if(sockaddr_compose_un((struct sockaddr *)&sn, unix_name) != 0) { fprintf(stderr, "could not build sockaddr_un\n"); return -1; } if((scamper_fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { fprintf(stderr, "could not allocate unix domain socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sn, sizeof(sn)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } return 0; } #endif return -1; } static int sc_ipid_tx_cmp(const void *va, const void *vb) { const sc_ipid_t *a = va; const sc_ipid_t *b = vb; return timeval_cmp(&a->tx, &b->tx); } static int inseq(scamper_dealias_radargun_t *rg, sc_ipid_t *pts, int ptc, int limit) { int i; for(i=0; i limit) break; /* adjacent samples are for the same probedef. */ if(pts[i].def == pts[i+1].def) continue; /* in sequence */ if(pts[i].ipid < pts[i+1].ipid) continue; /* not in sequence, but within a fudge factor and overlapping in time */ if((fudge == 0 || pts[i].ipid < pts[i+1].ipid + fudge) && timeval_cmp(&pts[i+1].tx, &pts[i].rx) <= 0) continue; return 0; } return 1; } static int points_add(scamper_dealias_t *dealias, sc_ipid_t *points, uint32_t *p, scamper_dealias_probedef_t *def) { scamper_dealias_radargun_t *rg = dealias->data; scamper_dealias_probe_t *probe; scamper_dealias_reply_t *reply; uint32_t k, f=0, i=0; for(k=0; kattempts; k++) { probe = dealias->probes[(def->id*rg->attempts)+k]; if(probe->replyc != 1) continue; reply = probe->replies[0]; if(SCAMPER_DEALIAS_REPLY_FROM_TARGET(probe, reply) == 0) continue; points[*p+i].def = def; points[*p+i].seq = probe->seq; points[*p+i].ipid = f + reply->ipid; timeval_cpy(&points[*p+i].tx, &probe->tx); timeval_cpy(&points[*p+i].rx, &reply->rx); if(i > 0 && points[*p+i].ipid < points[*p+i-1].ipid) { points[*p+i].ipid += 0x10000; f += 0x10000; } i++; } /* need at least 25% of replies to make a reasonable comparison */ if(i * 4 < rg->attempts) return 0; *p += i; return i; } static void initialwrap(sc_ipid_t *pts, int ptc) { scamper_dealias_probedef_t *def; int i; for(i=0; iaddr, b->addr); } static void sc_addr2set_free(sc_addr2set_t *a2s) { if(a2s == NULL) return; if(a2s->addr != NULL) scamper_addr_free(a2s->addr); free(a2s); return; } static sc_addr2set_t *sc_addr2set_find(splaytree_t *tree, scamper_addr_t *addr) { sc_addr2set_t fm; fm.addr = addr; return splaytree_find(tree, &fm); } static sc_addr2set_t *sc_addr2set_get(splaytree_t *tree, scamper_addr_t *addr) { sc_addr2set_t *a2s; if((a2s = sc_addr2set_find(tree, addr)) != NULL) return a2s; if((a2s = malloc_zero(sizeof(sc_addr2set_t))) == NULL) goto err; a2s->addr = scamper_addr_use(addr); if(splaytree_insert(tree, a2s) == NULL) goto err; return a2s; err: if(a2s != NULL) sc_addr2set_free(a2s); return NULL; } static void sc_addrset_free(sc_addrset_t *set) { if(set == NULL) return; if(set->addrs != NULL) slist_free_cb(set->addrs, (slist_free_t)sc_addrset_free); free(set); return; } static sc_addrset_t *sc_addrset_alloc(dlist_t *list) { sc_addrset_t *set; if((set = malloc_zero(sizeof(sc_addrset_t))) == NULL || (set->addrs = slist_alloc()) == NULL || (set->node = dlist_tail_push(list, set)) == NULL) { sc_addrset_free(set); return NULL; } return set; } static int sc_addrset_cmp(const sc_addrset_t *a, const sc_addrset_t *b) { int ac = slist_count(a->addrs); int bc = slist_count(b->addrs); sc_addr2set_t *a2s_a = slist_head_item(a->addrs); sc_addr2set_t *a2s_b = slist_head_item(b->addrs); if(ac > bc) return -1; if(ac < bc) return 1; return scamper_addr_human_cmp(a2s_a->addr, a2s_b->addr); } static int process_dealias_1(scamper_dealias_t *dealias) { scamper_dealias_radargun_t *rg; sc_ipid_t *points = NULL; splaytree_t *tree = NULL; dlist_t *list = NULL; dlist_node_t *dn; slist_node_t *sn; sc_addrset_t *addrset; sc_addr2set_t *a2s_a, *a2s_b, *a2s; uint32_t i, j, p; char a[32], b[32]; if(!SCAMPER_DEALIAS_METHOD_IS_RADARGUN(dealias)) return 0; rg = dealias->data; if((points = malloc(sizeof(sc_ipid_t) * rg->attempts * 2)) == NULL) goto err; if((flags & FLAG_TC) != 0 && ((list = dlist_alloc()) == NULL || (tree = splaytree_alloc((splaytree_cmp_t)sc_addr2set_cmp)) == NULL)) goto err; scamper_dealias_probes_sort_def(dealias); for(i=0; iprobedefc; i++) { for(j=i+1; jprobedefc; j++) { p = 0; if(points_add(dealias, points, &p, &rg->probedefs[i]) == 0) break; if(points_add(dealias, points, &p, &rg->probedefs[j]) == 0) continue; qsort(points, p, sizeof(sc_ipid_t), sc_ipid_tx_cmp); initialwrap(points, p); if(inseq(rg, points, p, rg->attempts) != 0) { if((flags & FLAG_TC) == 0) { scamper_addr_tostr(rg->probedefs[i].dst, a, sizeof(a)); scamper_addr_tostr(rg->probedefs[j].dst, b, sizeof(b)); printf("%s %s\n", a, b); } else { a2s_a = sc_addr2set_get(tree, rg->probedefs[i].dst); a2s_b = sc_addr2set_get(tree, rg->probedefs[j].dst); if(a2s_a->set == NULL && a2s_b->set == NULL) { if((addrset = sc_addrset_alloc(list)) == NULL) goto err; a2s_a->set = addrset; a2s_b->set = addrset; if(slist_tail_push(addrset->addrs, a2s_a) == NULL || slist_tail_push(addrset->addrs, a2s_b) == NULL) goto err; } else if(a2s_a->set == NULL) { a2s_a->set = a2s_b->set; if(slist_tail_push(a2s_b->set->addrs, a2s_a) == NULL) goto err; } else if(a2s_b->set == NULL) { a2s_b->set = a2s_a->set; if(slist_tail_push(a2s_a->set->addrs, a2s_b) == NULL) goto err; } else if(a2s_a->set != a2s_b->set) { addrset = a2s_b->set; while((a2s = slist_head_pop(addrset->addrs)) != NULL) { slist_tail_push(a2s_a->set->addrs, a2s); a2s->set = a2s_a->set; } dlist_node_pop(list, addrset->node); sc_addrset_free(addrset); } } } } } if(list != NULL) { for(dn=dlist_head_node(list); dn != NULL; dn = dlist_node_next(dn)) { addrset = dlist_node_item(dn); slist_qsort(addrset->addrs, (slist_cmp_t)sc_addr2set_cmp); } dlist_qsort(list, (dlist_cmp_t)sc_addrset_cmp); while((addrset = dlist_head_pop(list)) != NULL) { i = 0; for(sn = slist_head_node(addrset->addrs); sn != NULL; sn = slist_node_next(sn)) { a2s = slist_node_item(sn); if(i > 0) printf(" "); printf("%s", scamper_addr_tostr(a2s->addr, a, sizeof(a))); i++; } printf("\n"); } dlist_free_cb(list, (dlist_free_t)sc_addrset_free); } if(tree != NULL) splaytree_free(tree, NULL); free(points); return 0; err: if(tree != NULL) splaytree_free(tree, NULL); if(list != NULL) dlist_free_cb(list, (dlist_free_t)sc_addrset_free); if(points != NULL) free(points); return -1; } static int init_2(void) { if((pingtree = splaytree_alloc((splaytree_cmp_t)sc_ping_cmp)) == NULL) return -1; return 0; } static int process_ping_2(scamper_ping_t *ping) { sc_ping_t *scp = NULL; int class; if((scp = sc_ping_find(ping->dst)) == NULL) { if((scp = malloc_zero(sizeof(sc_ping_t))) == NULL) goto err; scp->addr = scamper_addr_use(ping->dst); scp->class = ping_classify(ping); if(splaytree_insert(pingtree, scp) == NULL) goto err; } else { if((class = ping_classify(ping)) < 0) return -1; if(class < scp->class) scp->class = class; } return 0; err: if(scp != NULL) sc_ping_free(scp); return -1; } static void finish_2(void) { slist_t *list = NULL; slist_node_t *sn; sc_ping_t *scp; char buf[64]; if((list = slist_alloc()) == NULL) goto done; splaytree_inorder(pingtree, (splaytree_inorder_t)tree_to_slist, list); slist_qsort(list, (slist_cmp_t)sc_ping_human_cmp); for(sn=slist_head_node(list); sn != NULL; sn=slist_node_next(sn)) { scp = slist_node_item(sn); printf("%s %s\n", scamper_addr_tostr(scp->addr, buf, sizeof(buf)), ipid_classes[scp->class]); } done: if(list != NULL) slist_free(list); return; } static int do_dump(void) { scamper_file_t *in = NULL; uint16_t type; void *data; if(dump_id == 1) type = SCAMPER_FILE_OBJ_DEALIAS; else type = SCAMPER_FILE_OBJ_PING; if((ffilter = scamper_file_filter_alloc(&type, 1)) == NULL) return -1; if((in = scamper_file_open(dump_file, 'r', NULL)) == NULL) { fprintf(stderr, "could not open %s: %s\n", dump_file, strerror(errno)); return -1; } if(dump_funcs[dump_id].init != NULL && dump_funcs[dump_id].init() != 0) { fprintf(stderr,"could not init dump %d: %s\n", dump_id, strerror(errno)); return -1; } while(scamper_file_read(in, ffilter, &type, &data) == 0) { if(data == NULL) break; if(type == SCAMPER_FILE_OBJ_DEALIAS) { if(dump_funcs[dump_id].proc_dealias != NULL) dump_funcs[dump_id].proc_dealias(data); scamper_dealias_free(data); } else { if(dump_funcs[dump_id].proc_ping != NULL) dump_funcs[dump_id].proc_ping(data); scamper_ping_free(data); } } scamper_file_close(in); in = NULL; if(dump_funcs[dump_id].finish != NULL) dump_funcs[dump_id].finish(); return 0; } static int do_probing(void) { uint16_t types[] = {SCAMPER_FILE_OBJ_PING, SCAMPER_FILE_OBJ_DEALIAS, }; int typec = sizeof(types) / sizeof(uint16_t); struct timeval tv, *tv_ptr; sc_waittest_t *wait; fd_set rfds; char cmd[10]; int nfds; /* start a daemon if asked to */ if((options & OPT_DAEMON) != 0 && daemon(1, 0) != 0) return -1; gettimeofday_wrap(&now); srandom(now.tv_usec); if((ffilter = scamper_file_filter_alloc(types, typec)) == NULL || (pingtree = splaytree_alloc((splaytree_cmp_t)sc_ping_cmp)) == NULL || (rglist = clist_alloc()) == NULL || (targets = splaytree_alloc((splaytree_cmp_t)sc_target_cmp)) == NULL || (waiting = heap_alloc(sc_waittest_cmp)) == NULL || do_scamperconnect() != 0) return -1; if((options & OPT_ADDRFILE) && do_addrfile() != 0) return -1; if(do_files() != 0) return -1; snprintf(cmd, sizeof(cmd), "attach\n"); if(write_wrap(scamper_fd, cmd, NULL, 7) != 0) { fprintf(stderr, "could not attach to scamper process\n"); return -1; } for(;;) { nfds = 0; FD_ZERO(&rfds); if(scamper_fd < 0 && decode_in_fd < 0) break; if(scamper_fd >= 0) { FD_SET(scamper_fd, &rfds); if(nfds < scamper_fd) nfds = scamper_fd; } if(decode_in_fd >= 0) { FD_SET(decode_in_fd, &rfds); if(nfds < decode_in_fd) nfds = decode_in_fd; } /* * need to set a timeout on select if scamper's processing window is * not full and there is a trace in the waiting queue. */ tv_ptr = NULL; if(more > 0) { gettimeofday_wrap(&now); /* * if there is something ready to probe now, then try and * do it. */ wait = heap_head_item(waiting); if(clist_count(rglist) > 0 || (wait != NULL && timeval_cmp(&wait->tv, &now) <= 0)) { if(do_method() != 0) return -1; } /* * if we could not send a new command just yet, but scamper * wants one, then wait for an appropriate length of time. */ wait = heap_head_item(waiting); if(more > 0 && tv_ptr == NULL && wait != NULL) { tv_ptr = &tv; if(timeval_cmp(&wait->tv, &now) > 0) timeval_diff_tv(&tv, &now, &wait->tv); else memset(&tv, 0, sizeof(tv)); } } if(splaytree_count(targets) == 0 && clist_count(rglist) == 0 && heap_count(waiting) == 0 && probing == 0) { print("done\n"); break; } if(select(nfds+1, &rfds, NULL, NULL, tv_ptr) < 0) { if(errno == EINTR) continue; fprintf(stderr, "select error\n"); break; } gettimeofday_wrap(&now); if(more > 0 && do_method() != 0) return -1; if(scamper_fd >= 0 && FD_ISSET(scamper_fd, &rfds) && do_scamperread() != 0) return -1; if(decode_in_fd >= 0 && FD_ISSET(decode_in_fd, &rfds) && do_decoderead() != 0) return -1; } return 0; } static void cleanup(void) { if(rglist != NULL) { clist_free(rglist); rglist = NULL; } if(pingtree != NULL) { splaytree_free(pingtree, (splaytree_free_t)sc_ping_free); pingtree = NULL; } if(waiting != NULL) { heap_free(waiting, NULL); waiting = NULL; } if(targets != NULL) { splaytree_free(targets, NULL); targets = NULL; } if(decode_in != NULL) { scamper_file_close(decode_in); decode_in = NULL; } if(ffilter != NULL) { scamper_file_filter_free(ffilter); ffilter = NULL; } if(logfile != NULL) { fclose(logfile); logfile = NULL; } return; } int main(int argc, char *argv[]) { #if defined(DMALLOC) free(malloc(1)); #endif atexit(cleanup); if(check_options(argc, argv) != 0) return -1; if(options & OPT_DUMP) return do_dump(); return do_probing(); } scamper-cvs-20171204/utils/sc_radargun/Makefile.in000644 001751 000000 00000057357 13211200064 021616 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_radargun$(EXEEXT) subdir = utils/sc_radargun ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_radargun_OBJECTS = sc_radargun.$(OBJEXT) ../../utils.$(OBJEXT) \ ../../mjl_heap.$(OBJEXT) ../../mjl_list.$(OBJEXT) \ ../../mjl_splaytree.$(OBJEXT) sc_radargun_OBJECTS = $(am_sc_radargun_OBJECTS) sc_radargun_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_radargun_SOURCES) DIST_SOURCES = $(sc_radargun_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_radargun_SOURCES = \ sc_radargun.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c sc_radargun_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_radargun.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_radargun/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_radargun/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_heap.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_splaytree.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_radargun$(EXEEXT): $(sc_radargun_OBJECTS) $(sc_radargun_DEPENDENCIES) $(EXTRA_sc_radargun_DEPENDENCIES) @rm -f sc_radargun$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_radargun_OBJECTS) $(sc_radargun_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_heap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_splaytree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_radargun.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_prefixscan/.cvsignore000644 001751 000000 00000000057 12660520645 022112 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_prefixscan scamper-cvs-20171204/utils/sc_prefixscan/Makefile.am000644 001751 000000 00000000650 13020346164 022136 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_prefixscan sc_prefixscan_SOURCES = \ sc_prefixscan.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c sc_prefixscan_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_prefixscan.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_prefixscan/sc_prefixscan.1000644 001751 000000 00000007643 13020634644 023027 0ustar00mjlwheel000000 000000 .\" .\" sc_prefixscan.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2016 Matthew Luckie .\" All rights reserved .\" .\" $Id: sc_prefixscan.1,v 1.2 2016/12/03 21:31:16 mjl Exp $ .\" .Dd December 2, 2016 .Dt SC_PREFIXSCAN 1 .Os .Sh NAME .Nm sc_prefixscan .Nd scamper driver to test if a set of IPv4 links are point-to-point. .Sh SYNOPSIS .Nm .Bk -words .Op Fl D .Op Fl i Ar infile .Op Fl o Ar outfile .Op Fl p Ar port .Op Fl l Ar logfile .Op Fl U Ar unix-socket .Op Fl w Ar wait .Op Fl x Ar prefixlen .Ek .Pp .Nm .Bk -words .Op Fl r Ar data-file .Op Fl x Ar prefixlen .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility provides the ability to connect to a running .Xr scamper 1 instance and use it to collect data to infer if an IPv4 link is likely a point-to-point link using the prefixscan method. An address B is the in-bound interface of a router in a traceroute path if we find an alias A' of the address A returned for the previous hop and A' is a /31 or /30 mate of B, i.e. the link between A and B is a point-to-point link. The prefixscan method infers A and A' are aliases if the IPIDs in responses to five alternating probes sent one second apart monotonically increase and differ by no more than 1,000, or probes to A and A' elicit responses with a common source address. The first technique is a pairwise comparison similar to Ally, and the second is the Mercator technique. The supported options to .Nm are as follows: .Bl -tag -width Ds .It Fl D causes .Nm to detach and become a daemon. .It Fl i Ar infile specifies a file containing a list of IPv4 address pairs adjacent in traceroute paths to test if they are point-to-point links. .It Fl o Ar outfile specifies the name of the output file to be written during the data collection phase. The output file will use the .Xr warts 5 format. .It Fl p Ar port specifies the port on the local host where .Xr scamper 1 is accepting control socket connections. .It Fl l Ar logfile specifies the name of a file to log progress output from .Nm generated at run time. .It Fl r Ar data-file specifies the name of the data file to be parsed for point-to-point link inferences that were collected by .Nm in a previous data collection. .It Fl U Ar unix-socket specifies the name of a unix domain socket where a local .Xr scamper 1 instance is accepting control socket connections. .It Fl w Ar wait specifies the length of time in seconds to wait between probing the same IPv4 address with different methods. By default, .Nm waits five seconds between methods. .It Fl x Ar prefixlen specifies the maximum size of prefix to consider. By default, .Nm considers up to an IPv4 /30 prefix. .El .\"""""""""""" .Sh EXAMPLES Given a traceroute with the following path: .Pp .Dl traceroute to 192.0.30.64 .Dl 1 192.0.2.1 .Dl 2 192.0.32.10 .Dl 3 192.0.31.8 .Dl 4 192.0.30.64 .Pp then to collect data to infer if the implied IPv4 links are point-to-point, put the links in a file named infile.txt formatted as follows: .Pp .Dl 192.0.2.1 192.0.32.10 .Dl 192.0.32.10 192.0.31.8 .Dl 192.0.31.8 192.0.30.64 .Pp and use a .Xr scamper 1 daemon listening on port 31337 using: .Pp .Dl sc_prefixscan -i infile.txt -o outfile.warts -p 31337 .Pp To obtain the inferred point-to-point links from outfile.warts: .Pp .Dl sc_prefixscan -r outfile.warts .\"""""""""""" .Sh SEE ALSO .Xr scamper 1 , .Xr sc_ally 1 , .Xr sc_ipiddump 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2text 1 , .Xr sc_warts2json 1 , .Rs .%A "M. Luckie" .%A "k. claffy" .%T "A Second Look at Detecting Third-party Addresses in Traceroute Traces with the IP Timestamp Option" .%O "Proc. Passive and Active Measurement Conference 2014" .Re .Rs .%A "R. Govindan" .%A "H. Tangmunarunkit" .%T "Heuristics for Internet Map Discovery" .%O "Proc. IEEE INFOCOM 2000" .Re .Rs .%A "N. Spring" .%A "R. Mahajan" .%A "D. Wetherall" .%T "Measuring ISP topologies with Rocketfuel" .%O "Proc. ACM SIGCOMM 2002" .Re .Sh AUTHORS .Nm was written by Matthew Luckie . scamper-cvs-20171204/utils/sc_prefixscan/sc_prefixscan.c000644 001751 000000 00000104260 12752042046 023102 0ustar00mjlwheel000000 000000 /* * sc_prefixscan : scamper driver to collect evidence of pt2pt links * using the prefixscan method * * $Id: sc_prefixscan.c,v 1.6 2016/08/08 08:34:46 mjl Exp $ * * Copyright (C) 2011, 2016 The University of Waikato * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_prefixscan.c,v 1.6 2016/08/08 08:34:46 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "ping/scamper_ping.h" #include "dealias/scamper_dealias.h" #include "scamper_file.h" #include "scamper_writebuf.h" #include "scamper_linepoll.h" #include "mjl_list.h" #include "mjl_splaytree.h" #include "mjl_heap.h" #include "utils.h" #define TEST_PING 1 #define TEST_SCAN 2 #define IPID_NONE 0 #define IPID_INCR 1 #define IPID_RAND 2 #define IPID_ECHO 3 #define IPID_CONST 4 #define IPID_UNRESP 5 #define OPT_HELP 0x0001 #define OPT_INFILE 0x0002 #define OPT_OUTFILE 0x0004 #define OPT_PORT 0x0008 #define OPT_WAIT 0x0010 #define OPT_LOG 0x0020 #define OPT_DAEMON 0x0040 #define OPT_UNIX 0x0080 #define OPT_READ 0x0100 #define OPT_PREFIXLEN 0x0200 static uint32_t options = 0; static int scamper_fd = -1; static scamper_linepoll_t *scamper_lp = NULL; static scamper_writebuf_t *scamper_wb = NULL; static char *infile = NULL; static unsigned int port = 0; static char *unix_name = NULL; static char *outfile_name = NULL; static char *datafile = NULL; static FILE *text = NULL; static splaytree_t *targets = NULL; static splaytree_t *ipidseqs = NULL; static slist_t *virgin = NULL; static heap_t *waiting = NULL; static int data_left = 0; static int error = 0; static int more = 0; static int probing = 0; static unsigned int waittime = 5; static uint8_t prefix_len = 0; static int outfile_fd = -1; static scamper_file_filter_t *ffilter = NULL; static scamper_file_t *decode_in = NULL; static int decode_in_fd = -1; static int decode_out_fd = -1; static scamper_writebuf_t *decode_wb = NULL; static struct timeval now; /* * sc_ipidseq * * given a particular address, list the methods that allow aliases to be * tested by way of IPID. */ typedef struct sc_ipidseq { scamper_addr_t *addr; uint8_t udp; uint8_t tcp; uint8_t icmp; } sc_ipidseq_t; typedef struct sc_test { int type; void *data; } sc_test_t; typedef struct sc_waittest { struct timeval tv; sc_test_t *test; } sc_waittest_t; typedef struct sc_target { scamper_addr_t *addr; sc_test_t *test; splaytree_node_t *node; slist_t *blocked; } sc_target_t; typedef struct sc_scantest { scamper_addr_t *a; scamper_addr_t *b; int pfx; int step; sc_target_t *tg; } sc_scantest_t; typedef struct sc_pingtest { scamper_addr_t *addr; int step; sc_target_t *tg; } sc_pingtest_t; typedef struct sc_prefixscan { scamper_addr_t *a; scamper_addr_t *b; scamper_addr_t *ab; } sc_prefixscan_t; static void usage(uint32_t opt_mask) { fprintf(stderr, "usage: sc_prefixscan [-D] [-i infile] [-o outfile] [-p port]\n" " [-l log] [-U unix] [-w wait] [-x prefixlen]\n" "\n" " sc_prefixscan [-r data-file] [-x prefixlen]\n" "\n"); if(opt_mask == 0) { fprintf(stderr, " sc_prefixscan -?\n\n"); return; } if(opt_mask & OPT_HELP) fprintf(stderr, " -? give an overview of the usage of sc_prefixscan\n"); if(opt_mask & OPT_DAEMON) fprintf(stderr, " -D start as daemon\n"); if(opt_mask & OPT_INFILE) fprintf(stderr, " -i input links file\n"); if(opt_mask & OPT_LOG) fprintf(stderr, " -l log\n"); if(opt_mask & OPT_OUTFILE) fprintf(stderr, " -o output warts file\n"); if(opt_mask & OPT_PORT) fprintf(stderr, " -p port to find scamper on\n"); if(opt_mask & OPT_READ) fprintf(stderr, " -r input warts data file\n"); if(opt_mask & OPT_UNIX) fprintf(stderr, " -U unix domain to find scamper on\n"); if(opt_mask & OPT_WAIT) fprintf(stderr, " -w number of seconds to wait between methods\n"); if(opt_mask & OPT_PREFIXLEN) fprintf(stderr, " -x maximum size of prefix to consider\n"); return; } static int check_options(int argc, char *argv[]) { int ch; long lo; char *opts = "Di:l:o:p:r:U:w:x:?"; char *opt_port = NULL, *opt_wait = NULL, *opt_log = NULL; char *opt_unix = NULL, *opt_prefixlen = NULL; while((ch = getopt(argc, argv, opts)) != -1) { switch(ch) { case 'D': options |= OPT_DAEMON; break; case 'i': options |= OPT_INFILE; infile = optarg; break; case 'l': options |= OPT_LOG; opt_log = optarg; break; case 'o': options |= OPT_OUTFILE; outfile_name = optarg; break; case 'p': options |= OPT_PORT; opt_port = optarg; break; case 'r': options |= OPT_READ; datafile = optarg; break; case 'U': options |= OPT_UNIX; opt_unix = optarg; break; case 'w': options |= OPT_WAIT; opt_wait = optarg; break; case 'x': options |= OPT_PREFIXLEN; opt_prefixlen = optarg; break; case '?': default: usage(0xffffffff); return -1; } } if(options == 0) { usage(0); return -1; } /* check if the prefix length was specified on the command line */ if(options & OPT_PREFIXLEN) { if(string_tolong(opt_prefixlen, &lo) != 0 || lo < 24 || lo > 31) { usage(OPT_PREFIXLEN); return -1; } prefix_len = lo; } /* if there were no options specified, then list the most important ones */ if((options & (OPT_INFILE|OPT_OUTFILE|OPT_PORT|OPT_UNIX|OPT_READ)) == 0) { usage(OPT_INFILE|OPT_OUTFILE|OPT_PORT|OPT_UNIX|OPT_READ); return -1; } /* if we are reading a previously collected datafile, then we're done */ if(options & OPT_READ) { if(options & ~(OPT_READ|OPT_PREFIXLEN)) { usage(OPT_READ|OPT_PREFIXLEN); return -1; } return 0; } if((options & (OPT_INFILE|OPT_OUTFILE)) != (OPT_INFILE|OPT_OUTFILE) || (options & (OPT_PORT|OPT_UNIX)) == 0 || (options & (OPT_PORT|OPT_UNIX)) == (OPT_PORT|OPT_UNIX)) { usage(OPT_INFILE|OPT_OUTFILE|OPT_PORT|OPT_UNIX); return -1; } if(options & OPT_PORT) { if(string_tolong(opt_port, &lo) != 0 || lo < 1 || lo > 65535) { usage(OPT_PORT); return -1; } port = lo; } else if(options & OPT_UNIX) { unix_name = opt_unix; } /* find out how long to wait in between traceroute methods */ if(opt_wait != NULL) { if(string_tolong(opt_wait, &lo) != 0 || lo < 0) { usage(OPT_WAIT); return -1; } waittime = lo; } if(opt_log != NULL) { if((text = fopen(opt_log, "w")) == NULL) { usage(OPT_LOG); fprintf(stderr, "could not open %s\n", opt_log); return -1; } } if(prefix_len == 0) prefix_len = 30; return 0; } static int tree_to_slist(void *ptr, void *entry) { slist_tail_push((slist_t *)ptr, entry); return 0; } static char *class_tostr(char *str, size_t len, uint8_t class) { char *ptr; switch(class) { case IPID_NONE: ptr = "none"; break; case IPID_INCR: ptr = "incr"; break; case IPID_RAND: ptr = "rand"; break; case IPID_ECHO: ptr = "echo"; break; case IPID_CONST: ptr = "const"; break; case IPID_UNRESP: ptr = "unresp"; break; default: snprintf(str, len, "class %d", class); return str; } snprintf(str, len, "%s", ptr); return str; } static void print(char *format, ...) { va_list ap; char msg[512]; va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); printf("%ld: %s", (long int)now.tv_sec, msg); if(text != NULL) { fprintf(text, "%ld: %s", (long int)now.tv_sec, msg); fflush(text); } return; } static void status(char *format, ...) { va_list ap; char pref[32]; char msg[512]; snprintf(pref, sizeof(pref), "p %d, w %d, v %d", probing, heap_count(waiting), slist_count(virgin)); va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); print("%s : %s\n", pref, msg); return; } static void sc_ipidseq_free(sc_ipidseq_t *seq) { if(seq == NULL) return; if(seq->addr != NULL) scamper_addr_free(seq->addr); free(seq); return; } static int sc_ipidseq_cmp(const void *a, const void *b) { return scamper_addr_cmp(((sc_ipidseq_t *)a)->addr,((sc_ipidseq_t *)b)->addr); } static sc_ipidseq_t *sc_ipidseq_alloc(scamper_addr_t *addr) { sc_ipidseq_t *seq; if((seq = malloc_zero(sizeof(sc_ipidseq_t))) == NULL) return NULL; seq->addr = scamper_addr_use(addr); if(splaytree_insert(ipidseqs, seq) == NULL) { scamper_addr_free(seq->addr); free(seq); return NULL; } return seq; } static sc_ipidseq_t *sc_ipidseq_get(scamper_addr_t *addr) { sc_ipidseq_t findme; findme.addr = addr; return splaytree_find(ipidseqs, &findme); } static sc_test_t *sc_test_alloc(int type, void *data) { sc_test_t *test; if((test = malloc_zero(sizeof(sc_test_t))) == NULL) { fprintf(stderr, "could not malloc test\n"); return NULL; } test->type = type; test->data = data; return test; } static void sc_test_free(sc_test_t *test) { if(test == NULL) return; free(test); return; } static int sc_waittest_cmp(const void *va, const void *vb) { const sc_waittest_t *a = va; const sc_waittest_t *b = vb; return timeval_cmp(&b->tv, &a->tv); } static int sc_waittest(sc_test_t *test) { sc_waittest_t *wt; if((wt = malloc_zero(sizeof(sc_waittest_t))) == NULL) return -1; timeval_add_s(&wt->tv, &now, waittime); wt->test = test; if(heap_insert(waiting, wt) == NULL) return -1; return 0; } static sc_target_t *sc_target_add(scamper_addr_t *addr, sc_test_t *test) { sc_target_t *tg = malloc_zero(sizeof(sc_target_t)); if(tg == NULL) { fprintf(stderr, "could not malloc target\n"); return NULL; } tg->addr = scamper_addr_use(addr); tg->test = test; if((tg->node = splaytree_insert(targets, tg)) == NULL) { fprintf(stderr, "could not add target to tree\n"); scamper_addr_free(tg->addr); free(tg); return NULL; } return tg; } static void sc_target_detach(sc_target_t *tg) { sc_test_t *test; if(tg == NULL) return; if(tg->node != NULL) { splaytree_remove_node(targets, tg->node); tg->node = NULL; } if(tg->blocked != NULL) { while((test = slist_head_pop(tg->blocked)) != NULL) sc_waittest(test); slist_free(tg->blocked); tg->blocked = NULL; } return; } static void sc_target_free(sc_target_t *tg) { if(tg == NULL) return; sc_target_detach(tg); if(tg->addr != NULL) scamper_addr_free(tg->addr); free(tg); return; } static int sc_target_cmp(const void *a, const void *b) { return scamper_addr_cmp(((sc_target_t *)a)->addr, ((sc_target_t *)b)->addr); } static int sc_target_block(sc_target_t *target, sc_test_t *block) { if(target->blocked == NULL && (target->blocked = slist_alloc()) == NULL) { fprintf(stderr, "could not alloc target->blocked list\n"); return -1; } if(slist_tail_push(target->blocked, block) == NULL) { fprintf(stderr, "could not add test to blocked list\n"); return -1; } return 0; } static sc_target_t *sc_target_find(sc_target_t *target) { return splaytree_find(targets, target); } static sc_target_t *sc_target_findaddr(scamper_addr_t *addr) { sc_target_t findme; findme.addr = addr; return sc_target_find(&findme); } static void sc_pingtest_free(sc_pingtest_t *pt) { if(pt == NULL) return; if(pt->addr != NULL) scamper_addr_free(pt->addr); if(pt->tg != NULL) sc_target_free(pt->tg); free(pt); return; } static sc_test_t *sc_pingtest_new(scamper_addr_t *addr) { sc_pingtest_t *pt = NULL; sc_test_t *test = NULL; assert(addr != NULL); if((pt = malloc_zero(sizeof(sc_pingtest_t))) == NULL) { fprintf(stderr, "could not malloc pingtest\n"); goto err; } pt->addr = scamper_addr_use(addr); /* create a generic test structure which we put in a list of tests */ if((test = sc_test_alloc(TEST_PING, pt)) == NULL) goto err; return test; err: if(pt != NULL) sc_pingtest_free(pt); if(test != NULL) sc_test_free(test); return NULL; } static void sc_scantest_free(sc_scantest_t *ps) { if(ps == NULL) return; if(ps->a != NULL) scamper_addr_free(ps->a); if(ps->b != NULL) scamper_addr_free(ps->b); if(ps->tg != NULL) sc_target_free(ps->tg); free(ps); return; } static int sc_prefixscan_cmp(const sc_prefixscan_t *a, const sc_prefixscan_t *b) { int i; if((i = scamper_addr_cmp(a->a, b->a)) != 0) return i; if((i = scamper_addr_cmp(a->b, b->b)) != 0) return i; return scamper_addr_cmp(a->ab, b->ab); } static int sc_prefixscan_human_cmp(const sc_prefixscan_t *a, const sc_prefixscan_t *b) { int i; if((i = scamper_addr_human_cmp(a->a, b->a)) != 0) return i; if((i = scamper_addr_human_cmp(a->b, b->b)) != 0) return i; return scamper_addr_human_cmp(a->ab, b->ab); } static void sc_prefixscan_free(sc_prefixscan_t *pfs) { if(pfs == NULL) return; if(pfs->a != NULL) scamper_addr_free(pfs->a); if(pfs->b != NULL) scamper_addr_free(pfs->b); if(pfs->ab != NULL) scamper_addr_free(pfs->ab); free(pfs); return; } static int infile_line(char *str, void *param) { sc_scantest_t *ps = NULL; sc_test_t *test = NULL; char *ptr; if(str[0] == '#' || str[0] == '\0') return 0; if((ptr = string_nextword(str)) == NULL) return -1; if((ps = malloc_zero(sizeof(sc_scantest_t))) == NULL || (ps->a = scamper_addr_resolve(AF_UNSPEC, str)) == NULL || (ps->b = scamper_addr_resolve(AF_UNSPEC, ptr)) == NULL || (test = sc_test_alloc(TEST_SCAN, ps)) == NULL || slist_tail_push(virgin, test) == NULL) goto err; ps->pfx = prefix_len; return 0; err: if(ps != NULL) sc_scantest_free(ps); if(test != NULL) sc_test_free(test); return -1; } static int process_ping(sc_test_t *test, scamper_ping_t *ping) { sc_pingtest_t *pt = test->data; sc_ipidseq_t *seq; scamper_ping_reply_t *r[4], *rx; uint32_t u32; char addr[64], icmp[10], tcp[10], udp[10]; int class, i, j, rc; int samples[65536]; assert(ping != NULL); if((seq = sc_ipidseq_get(pt->addr)) == NULL && (seq = sc_ipidseq_alloc(pt->addr)) == NULL) { return -1; } if(ping->stop_reason == SCAMPER_PING_STOP_NONE || ping->stop_reason == SCAMPER_PING_STOP_ERROR) { class = IPID_UNRESP; goto done; } rc = 0; for(j=0; jping_sent && rc < 4; j++) { if((rx = ping->ping_replies[j]) == NULL) continue; if(SCAMPER_PING_REPLY_FROM_TARGET(ping, rx)) r[rc++] = rx; } if(rc < 4) { class = IPID_UNRESP; goto done; } /* * if at least two of four samples have the same ipid as what was sent, * then declare it echos. this handles the observed case where some * responses echo but others increment. */ u32 = 0; for(i=0; i<4; i++) { if(r[i]->probe_ipid == r[i]->reply_ipid) u32++; } if(u32 > 1) { class = IPID_ECHO; goto done; } u32 = 0; memset(samples, 0, sizeof(samples)); for(i=0; i<4; i++) { samples[r[i]->reply_ipid]++; if(samples[r[i]->reply_ipid] > 1) u32++; } if(u32 > 1) { class = IPID_CONST; goto done; } for(i=0; i<3; i++) { if(r[i+0]->reply_ipid < r[i+1]->reply_ipid) u32 = r[i+1]->reply_ipid - r[i-0]->reply_ipid; else u32 = (r[i+1]->reply_ipid + 0x10000) - r[i+0]->reply_ipid; if(u32 > 5000) break; } if(i == 3) class = IPID_INCR; else class = IPID_RAND; done: if(SCAMPER_PING_METHOD_IS_UDP(ping)) seq->udp = class; else if(SCAMPER_PING_METHOD_IS_TCP(ping)) seq->tcp = class; else if(SCAMPER_PING_METHOD_IS_ICMP(ping)) seq->icmp = class; scamper_addr_tostr(pt->addr, addr, sizeof(addr)); scamper_ping_free(ping); ping = NULL; pt->step++; if(pt->step < 3) { if(sc_waittest(test) != 0) goto err; status("wait ping %s step %d", addr, pt->step); return 0; } status("done ping %s udp %s tcp %s icmp %s", addr, class_tostr(udp, sizeof(udp), seq->udp), class_tostr(tcp, sizeof(tcp), seq->tcp), class_tostr(icmp, sizeof(icmp), seq->icmp)); sc_pingtest_free(pt); sc_test_free(test); return 0; err: if(ping != NULL) scamper_ping_free(ping); return -1; } static int process_scan(sc_test_t *test, scamper_dealias_t *dealias) { sc_scantest_t *ps = test->data; scamper_dealias_prefixscan_t *scan = dealias->data; char a[64], b[64], ab[64]; int done = 0; scamper_addr_tostr(scan->a, a, sizeof(a)); scamper_addr_tostr(scan->b, b, sizeof(b)); if(scan->ab != NULL) { status("done scan %s %s/%d %s", a, b, ps->pfx, scamper_addr_tostr(scan->ab, ab, sizeof(ab))); done = 1; } scamper_dealias_free(dealias); if(done != 0) goto done; ps->step++; if(ps->step < 3) { if(sc_waittest(test) != 0) return -1; status("wait scan %s %s/%d step %d", a, b, ps->pfx, ps->step); return 0; } done: sc_scantest_free(ps); sc_test_free(test); return 0; } static int sc_test_ping(sc_test_t *test, char *cmd, size_t len) { sc_pingtest_t *pt = test->data; scamper_addr_t *dst = pt->addr; sc_target_t *tg; size_t off = 0; char buf[64]; assert(pt->step >= 0); assert(pt->step <= 2); /* first, check to see if the test is runnable. if not block */ if((tg = sc_target_findaddr(dst)) != NULL && tg->test != test) { if(sc_target_block(tg, test) != 0) return -1; return 0; } else if(tg == NULL) { if((pt->tg = sc_target_add(dst, test)) == NULL) return -1; } string_concat(cmd, len, &off, "ping -P "); if(pt->step == 0) string_concat(cmd, len, &off, "udp-dport"); else if(pt->step == 1) string_concat(cmd, len, &off, "icmp-echo"); else if(pt->step == 2) string_concat(cmd, len, &off, "tcp-ack-sport"); else return -1; string_concat(cmd, len, &off, " -c 6 -o 4 %s\n", scamper_addr_tostr(dst, buf, sizeof(buf))); return off; } static int sc_test_scan(sc_test_t *test, char *cmd, size_t len) { sc_scantest_t *ps = test->data; sc_pingtest_t *pt; sc_test_t *test2; sc_ipidseq_t *seq; sc_target_t *tg; size_t off = 0; uint8_t ipid; char a[64], b[64], *meth; /* first, check to see if the test is runnable. if not block */ if((tg = sc_target_findaddr(ps->a)) != NULL && tg->test != test) { if(sc_target_block(tg, test) != 0) return -1; return 0; } /* check if we know the available probe methods for the A address */ if((seq = sc_ipidseq_get(ps->a)) == NULL) { if((test2 = sc_pingtest_new(ps->a)) == NULL) return -1; pt = test2->data; if((pt->tg = sc_target_add(ps->a, test2)) == NULL) return -1; if(sc_target_block(pt->tg, test) != 0) return -1; return sc_test_ping(test2, cmd, len); } /* add a pointer to the test in the target tree */ if(tg == NULL && (ps->tg = sc_target_add(ps->a, test)) == NULL) return -1; while(ps->step <= 2) { if(ps->step == 0) ipid = seq->udp; else if(ps->step == 1) ipid = seq->tcp; else ipid = seq->icmp; if(ipid == IPID_INCR) break; ps->step++; } if(ps->step > 2) { sc_scantest_free(ps); sc_test_free(test); return 0; } if(ps->step == 0) meth = "udp"; else if(ps->step == 1) meth = "tcp-ack-sport"; else meth = "icmp-echo"; string_concat(cmd, len, &off, "dealias -m prefixscan -f 1000 -p '-P %s' %s %s/%d\n", meth, scamper_addr_tostr(ps->a, a, sizeof(a)), scamper_addr_tostr(ps->b, b, sizeof(b)), ps->pfx); return off; } static int do_method(void) { static int (*const func[])(sc_test_t *, char *, size_t) = { sc_test_ping, /* TEST_PING */ sc_test_scan, /* TEST_SCAN */ }; sc_waittest_t *wt; sc_test_t *test; char cmd[512]; int off; if(more < 1) return 0; for(;;) { if((wt = heap_head_item(waiting)) != NULL && timeval_cmp(&now, &wt->tv) >= 0) { test = wt->test; heap_remove(waiting); free(wt); } else if((test = slist_head_pop(virgin)) == NULL) { return 0; } /* something went wrong */ if((off = func[test->type-1](test, cmd, sizeof(cmd))) == -1) { fprintf(stderr, "something went wrong\n"); error = 1; return -1; } /* got a command, send it */ if(off != 0) { write_wrap(scamper_fd, cmd, NULL, off); probing++; more--; print("p %d, w %d, v %d : %s", probing, heap_count(waiting), slist_count(virgin), cmd); break; } } return 0; } /* * do_scamperconnect * * allocate socket and connect to scamper process listening on the port * specified. */ static int do_scamperconnect(void) { struct sockaddr_un sun; struct sockaddr_in sin; struct in_addr in; if(options & OPT_PORT) { inet_aton("127.0.0.1", &in); sockaddr_compose((struct sockaddr *)&sin, AF_INET, &in, port); if((scamper_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { fprintf(stderr, "could not allocate new socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sin, sizeof(sin)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } return 0; } else if(options & OPT_UNIX) { if(sockaddr_compose_un((struct sockaddr *)&sun, unix_name) != 0) { fprintf(stderr, "could not build sockaddr_un\n"); return -1; } if((scamper_fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { fprintf(stderr, "could not allocate unix domain socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sun, sizeof(sun)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } return 0; } return -1; } static int do_scamperread_line(void *param, uint8_t *buf, size_t linelen) { char *head = (char *)buf; uint8_t uu[64]; size_t uus; long l; /* skip empty lines */ if(head[0] == '\0') return 0; /* if currently decoding data, then pass it to uudecode */ if(data_left > 0) { uus = sizeof(uu); if(uudecode_line(head, linelen, uu, &uus) != 0) { fprintf(stderr, "could not uudecode_line\n"); error = 1; return -1; } if(uus != 0) { scamper_writebuf_send(decode_wb, uu, uus); write_wrap(outfile_fd, uu, NULL, uus); } data_left -= (linelen + 1); return 0; } /* feedback letting us know that the command was accepted */ if(linelen >= 2 && strncasecmp(head, "OK", 2) == 0) return 0; /* if the scamper process is asking for more tasks, give it more */ if(linelen == 4 && strncasecmp(head, "MORE", linelen) == 0) { more++; if(do_method() != 0) return -1; return 0; } /* new piece of data */ if(linelen > 5 && strncasecmp(head, "DATA ", 5) == 0) { if(string_isnumber(head+5) == 0 || string_tolong(head+5, &l) != 0) { fprintf(stderr, "could not parse %s\n", head); error = 1; return -1; } data_left = l; return 0; } /* feedback letting us know that the command was not accepted */ if(linelen >= 3 && strncasecmp(head, "ERR", 3) == 0) { error = 1; return -1; } fprintf(stderr, "unknown response '%s'\n", head); error = 1; return -1; } /* * do_scamperread * * the fd for the scamper process is marked as readable, so do a read * on it. */ static int do_scamperread(void) { ssize_t rc; uint8_t buf[512]; if((rc = read(scamper_fd, buf, sizeof(buf))) > 0) { scamper_linepoll_handle(scamper_lp, buf, rc); return 0; } else if(rc == 0) { close(scamper_fd); scamper_fd = -1; return 0; } else if(errno == EINTR || errno == EAGAIN) { return 0; } fprintf(stderr, "could not read: errno %d\n", errno); return -1; } static int do_files(void) { uint16_t types[] = {SCAMPER_FILE_OBJ_PING, SCAMPER_FILE_OBJ_DEALIAS}; mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; int flags = O_WRONLY | O_CREAT | O_TRUNC; int pair[2]; if((ffilter = scamper_file_filter_alloc(types, 2)) == NULL) { return -1; } if((outfile_fd = open(outfile_name, flags, mode)) == -1) { return -1; } /* * setup a socketpair that is used to decode warts from a binary input. * pair[0] is used to write to the file, while pair[1] is used by * the scamper_file_t routines to parse the warts data. */ if(socketpair(AF_UNIX, SOCK_STREAM, 0, pair) != 0) { return -1; } decode_in_fd = pair[0]; decode_out_fd = pair[1]; if((decode_in = scamper_file_openfd(decode_in_fd,NULL,'r',"warts")) == NULL) { return -1; } if(fcntl_set(decode_in_fd, O_NONBLOCK) == -1) { return -1; } return 0; } static int do_decoderead(void) { sc_target_t *target, findme; sc_test_t *test; void *data; uint16_t type; char buf[64]; scamper_ping_t *ping = NULL; scamper_dealias_t *dealias = NULL; scamper_dealias_prefixscan_t *ps = NULL; int rc; /* try and read a traceroute from the warts decoder */ if(scamper_file_read(decode_in, ffilter, &type, &data) != 0) { fprintf(stderr, "do_decoderead: scamper_file_read errno %d\n", errno); goto err; } if(data == NULL) { return 0; } probing--; if(type == SCAMPER_FILE_OBJ_PING) { ping = (scamper_ping_t *)data; findme.addr = ping->dst; } else if(type == SCAMPER_FILE_OBJ_DEALIAS) { dealias = (scamper_dealias_t *)data; ps = (scamper_dealias_prefixscan_t *)dealias->data; findme.addr = ps->a; } else return -1; if((target = splaytree_find(targets, &findme)) == NULL) { fprintf(stderr, "do_decoderead: could not find dst %s\n", scamper_addr_tostr(findme.addr, buf, sizeof(buf))); goto err; } test = target->test; if(test->type == TEST_PING) rc = process_ping(test, ping); else if(test->type == TEST_SCAN) rc = process_scan(test, dealias); else rc = -1; return rc; err: if(dealias != NULL) scamper_dealias_free(dealias); if(ping != NULL) scamper_ping_free(ping); return -1; } static int pf_data(void) { struct timeval tv, *tv_ptr; sc_waittest_t *wait; fd_set rfds, wfds, *wfdsp; int nfds; random_seed(); /* global data structures used to keep track of the set of traceset */ if((targets = splaytree_alloc(sc_target_cmp)) == NULL) return -1; if((ipidseqs = splaytree_alloc(sc_ipidseq_cmp)) == NULL) return -1; if((virgin = slist_alloc()) == NULL) return -1; if((waiting = heap_alloc(sc_waittest_cmp)) == NULL) return -1; if(file_lines(infile, infile_line, NULL) != 0) { fprintf(stderr, "could not read %s\n", infile); return -1; } /* * connect to the scamper process */ if(do_scamperconnect() != 0) return -1; /* * sort out the files that we'll be working with. */ if(do_files() != 0) return -1; if((scamper_lp = scamper_linepoll_alloc(do_scamperread_line, NULL)) == NULL || (scamper_wb = scamper_writebuf_alloc()) == NULL || (decode_wb = scamper_writebuf_alloc()) == NULL) return -1; scamper_writebuf_send(scamper_wb, "attach\n", 7); while(error == 0) { /* * need to set a timeout on select if scamper's processing window is * not full and there is a trace in the waiting queue. */ tv_ptr = NULL; if(more > 0) { gettimeofday_wrap(&now); /* * if there is something ready to probe now, then try and * do it. */ wait = heap_head_item(waiting); if(slist_count(virgin) > 0 || (wait != NULL && timeval_cmp(&wait->tv, &now) <= 0)) { if(do_method() != 0) return -1; } /* * if we could not send a new command just yet, but scamper * wants one, then wait for an appropriate length of time. */ wait = heap_head_item(waiting); if(more > 0 && tv_ptr == NULL && wait != NULL) { tv_ptr = &tv; if(timeval_cmp(&wait->tv, &now) > 0) timeval_diff_tv(&tv, &now, &wait->tv); else memset(&tv, 0, sizeof(tv)); } } nfds = 0; FD_ZERO(&rfds); FD_ZERO(&wfds); wfdsp = NULL; if(scamper_fd < 0 && decode_in_fd < 0) break; if(scamper_fd >= 0) { FD_SET(scamper_fd, &rfds); if(nfds < scamper_fd) nfds = scamper_fd; if(scamper_writebuf_len(scamper_wb) > 0) { FD_SET(scamper_fd, &wfds); wfdsp = &wfds; } } if(decode_in_fd >= 0) { FD_SET(decode_in_fd, &rfds); if(nfds < decode_in_fd) nfds = decode_in_fd; } if(decode_out_fd >= 0 && scamper_writebuf_len(decode_wb) > 0) { FD_SET(decode_out_fd, &wfds); wfdsp = &wfds; if(nfds < decode_out_fd) nfds = decode_out_fd; } if(splaytree_count(targets) == 0 && slist_count(virgin) == 0 && heap_count(waiting) == 0) { break; } if(select(nfds+1, &rfds, wfdsp, NULL, tv_ptr) < 0) { if(errno == EINTR) continue; fprintf(stderr, "select error\n"); break; } gettimeofday_wrap(&now); if(more > 0) { if(do_method() != 0) return -1; } if(scamper_fd >= 0) { if(FD_ISSET(scamper_fd, &rfds) && do_scamperread() != 0) return -1; if(wfdsp != NULL && FD_ISSET(scamper_fd, wfdsp) && scamper_writebuf_write(scamper_fd, scamper_wb) != 0) return -1; } if(decode_in_fd >= 0) { if(FD_ISSET(decode_in_fd, &rfds) && do_decoderead() != 0) return -1; } if(decode_out_fd >= 0) { if(wfdsp != NULL && FD_ISSET(decode_out_fd, wfdsp) && scamper_writebuf_write(decode_out_fd, decode_wb) != 0) return -1; } } return 0; } static int pf_read(void) { splaytree_t *tree = NULL; slist_t *list = NULL; scamper_file_t *in = NULL; scamper_dealias_t *dealias; scamper_dealias_prefixscan_t *ps; char a[64], b[64], ab[64]; sc_prefixscan_t *pfs; uint16_t type; void *data; if(strcmp(datafile, "-") == 0) in = scamper_file_openfd(STDIN_FILENO, "-", 'r', "warts"); else in = scamper_file_open(datafile, 'r', NULL); if(in == NULL) { fprintf(stderr, "could not open %s: %s\n", datafile, strerror(errno)); goto err; } type = SCAMPER_FILE_OBJ_DEALIAS; if((ffilter = scamper_file_filter_alloc(&type, 1)) == NULL) goto err; if((tree = splaytree_alloc((splaytree_cmp_t)sc_prefixscan_cmp)) == NULL) goto err; while(scamper_file_read(in, ffilter, &type, &data) == 0) { if(data == NULL) break; dealias = data; if(SCAMPER_DEALIAS_METHOD_IS_PREFIXSCAN(dealias)) { ps = dealias->data; if(ps->ab != NULL && scamper_addr_prefixhosts(ps->b, ps->ab) >= (prefix_len == 0 ? ps->prefix : 30)) { if((pfs = malloc_zero(sizeof(sc_prefixscan_t))) == NULL) { fprintf(stderr, "could not record scan result\n"); goto err; } pfs->a = scamper_addr_use(ps->a); pfs->b = scamper_addr_use(ps->b); pfs->ab = scamper_addr_use(ps->ab); if(splaytree_insert(tree, pfs) == NULL) { fprintf(stderr, "could not add scan result\n"); goto err; } } } scamper_dealias_free(dealias); } scamper_file_close(in); in = NULL; if((list = slist_alloc()) == NULL) { fprintf(stderr, "could not alloc list: %s\n", strerror(errno)); goto err; } splaytree_inorder(tree, tree_to_slist, list); splaytree_free(tree, NULL); tree = NULL; slist_qsort(list, (slist_cmp_t)sc_prefixscan_human_cmp); while((pfs = slist_head_pop(list)) != NULL) { printf("%s %s %s/%d\n", scamper_addr_tostr(pfs->a, a, sizeof(a)), scamper_addr_tostr(pfs->b, b, sizeof(b)), scamper_addr_tostr(pfs->ab, ab, sizeof(ab)), scamper_addr_prefixhosts(pfs->b, pfs->ab)); sc_prefixscan_free(pfs); } slist_free(list); return 0; err: return -1; } static void cleanup(void) { if(virgin != NULL) { slist_free(virgin); virgin = NULL; } if(waiting != NULL) { heap_free(waiting, NULL); waiting = NULL; } if(targets != NULL) { splaytree_free(targets, NULL); targets = NULL; } if(ipidseqs != NULL) { splaytree_free(ipidseqs, (splaytree_free_t)sc_ipidseq_free); ipidseqs = NULL; } if(decode_in != NULL) { scamper_file_close(decode_in); decode_in = NULL; } if(ffilter != NULL) { scamper_file_filter_free(ffilter); ffilter = NULL; } if(text != NULL) { fclose(text); text = NULL; } if(decode_wb != NULL) { scamper_writebuf_free(decode_wb); decode_wb = NULL; } if(scamper_wb != NULL) { scamper_writebuf_free(scamper_wb); scamper_wb = NULL; } if(scamper_lp != NULL) { scamper_linepoll_free(scamper_lp, 0); scamper_lp = NULL; } return; } int main(int argc, char *argv[]) { #if defined(DMALLOC) free(malloc(1)); #endif atexit(cleanup); if(check_options(argc, argv) != 0) return -1; /* start a daemon if asked to */ if((options & OPT_DAEMON) != 0 && daemon(1, 0) != 0) return -1; if((options & OPT_READ) != 0) return pf_read(); return pf_data(); } scamper-cvs-20171204/utils/sc_prefixscan/Makefile.in000644 001751 000000 00000061345 13211200063 022144 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_prefixscan$(EXEEXT) subdir = utils/sc_prefixscan ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_prefixscan_OBJECTS = sc_prefixscan.$(OBJEXT) \ ../../scamper/scamper_linepoll.$(OBJEXT) \ ../../scamper/scamper_writebuf.$(OBJEXT) ../../utils.$(OBJEXT) \ ../../mjl_heap.$(OBJEXT) ../../mjl_list.$(OBJEXT) \ ../../mjl_splaytree.$(OBJEXT) sc_prefixscan_OBJECTS = $(am_sc_prefixscan_OBJECTS) sc_prefixscan_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_prefixscan_SOURCES) DIST_SOURCES = $(sc_prefixscan_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_prefixscan_SOURCES = \ sc_prefixscan.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c sc_prefixscan_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_prefixscan.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_prefixscan/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_prefixscan/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../scamper/$(am__dirstamp): @$(MKDIR_P) ../../scamper @: > ../../scamper/$(am__dirstamp) ../../scamper/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../scamper/$(DEPDIR) @: > ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_linepoll.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_writebuf.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_heap.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_splaytree.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_prefixscan$(EXEEXT): $(sc_prefixscan_OBJECTS) $(sc_prefixscan_DEPENDENCIES) $(EXTRA_sc_prefixscan_DEPENDENCIES) @rm -f sc_prefixscan$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_prefixscan_OBJECTS) $(sc_prefixscan_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) -rm -f ../../scamper/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_heap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_splaytree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_linepoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_writebuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_prefixscan.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) -rm -f ../../scamper/$(DEPDIR)/$(am__dirstamp) -rm -f ../../scamper/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_ipiddump/.cvsignore000644 001751 000000 00000000055 12144252020 021543 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_ipiddump scamper-cvs-20171204/utils/sc_ipiddump/Makefile.am000644 001751 000000 00000000440 12204512426 021603 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_ipiddump sc_ipiddump_SOURCES = sc_ipiddump.c ../../mjl_list.c ../../utils.c sc_ipiddump_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_ipiddump.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_ipiddump/sc_ipiddump.1000644 001751 000000 00000003632 12611625772 022152 0ustar00mjlwheel000000 000000 .\" .\" sc_ipiddump.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2013 The Regents of the University of California .\" Copyright (c) 2015 The University of Waikato .\" All rights reserved .\" .\" $Id: sc_ipiddump.1,v 1.3 2015/10/21 06:08:58 mjl Exp $ .\" .Dd October 21, 2015 .Dt SC_IPIDDUMP 1 .Os .Sh NAME .Nm sc_ipiddump .Nd utility to dump IP-ID values embedded in ping, traceroute, and dealias objects in warts files. .Sh SYNOPSIS .Nm .Bk -words .Op Fl i Ar ips .Op Fl O Ar options .Op Fl U Ar userid .Op Ar .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility dumps the IP-ID values embedded in IPv4 and IPv6 responses to ping, traceroute, and dealias objects. The output contains the transit and receive timestamps, the source address used by scamper when probing, the interface address which replied, and the IPID value (in hexadecimal). The objects are sorted by transmit time. The supported options to .Nm are as follows: .Bl -tag -width Ds .It Fl i Ar ip restricts the selection of source addresses to those with the given IP address(es). .It Fl O Ar options allows the behavior of .Nm to be further tailored. The current choice for this option is: .Bl -dash -offset 2n -compact -width 1n .It .Sy notrace: do not parse traceroutes for IPID values. .El .It Fl U Ar userid restricts the selection of warts objects to those with the given userid(s). .El .\"""""""""""" .Sh EXAMPLES Given an input file foo.warts, the following command dumps IP-ID values found in objects with userid values 3 and 4: .Pp .Dl sc_ipiddump -U 3,4 foo.warts .Pp Given an input file foo.warts.gz, the following command dumps IP-ID values found in responses from IP address 192.0.2.1 .Pp .Dl zcat foo.warts.gz | sc_ipiddump -i 192.0.2.1 - .Pp .\"""""""""""" .Sh SEE ALSO .Xr scamper 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2text 1 , .Xr sc_warts2json 1 .Sh AUTHORS .Nm was written by Matthew Luckie . scamper-cvs-20171204/utils/sc_ipiddump/sc_ipiddump.c000644 001751 000000 00000027173 12611625674 022243 0ustar00mjlwheel000000 000000 /* * sc_ipiddump * * $Id: sc_ipiddump.c,v 1.13 2015/10/21 06:07:56 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2013 The Regents of the University of California * Copyright (C) 2015 The University of Waikato * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_ipiddump.c,v 1.13 2015/10/21 06:07:56 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_list.h" #include "scamper_addr.h" #include "scamper_file.h" #include "ping/scamper_ping.h" #include "dealias/scamper_dealias.h" #include "trace/scamper_trace.h" #include "mjl_list.h" #include "utils.h" typedef struct ipid_sample { scamper_addr_t *probe_src; scamper_addr_t *addr; struct timeval tx; struct timeval rx; uint32_t ipid; } ipid_sample_t; /* file filter */ static scamper_file_filter_t *filter; /* the input warts files */ static char **filelist = NULL; static int filelist_len = 0; /* the list of ipid samples to record */ static slist_t *list = NULL; /* the userids to select on */ static uint32_t *userids = 0; static int useridc = 0; /* the IPs to select on */ static scamper_addr_t **ips = NULL; static int ipc = 0; static uint8_t flags = 0; #define FLAG_NOTRACE 0x01 #define OPT_USERID 0x0001 #define OPT_IP 0x0002 #define OPT_OPTIONS 0x0004 static void usage(uint32_t opt_mask) { fprintf(stderr, "usage: sc_ipiddump [-?] [-i ips] [-O options] [-U userids]\n" " \n"); if(opt_mask & OPT_IP) fprintf(stderr, " -i IP address to filter\n"); if(opt_mask & OPT_OPTIONS) fprintf(stderr, " -O options [notrace]\n"); if(opt_mask & OPT_USERID) fprintf(stderr, " -U userid to filter\n"); return; } static int uint32_cmp(const void *va, const void *vb) { const uint32_t a = *((uint32_t *)va); const uint32_t b = *((uint32_t *)vb); if(a < b) return -1; if(a > b) return 1; return 0; } static int uint32_find(uint32_t *a, size_t len, uint32_t u32) { if(bsearch(&u32, a, len, sizeof(uint32_t), uint32_cmp) != NULL) return 1; return 0; } static int ip_cmp(const void *va, const void *vb) { const scamper_addr_t *a = *((const scamper_addr_t **)va); const scamper_addr_t *b = *((const scamper_addr_t **)vb); return scamper_addr_cmp(a, b); } static int ip_find(scamper_addr_t **set, size_t len, scamper_addr_t *a) { if(bsearch(&a, set, len, sizeof(scamper_addr_t *), ip_cmp) != NULL) return 1; return 0; } static int check_options(int argc, char *argv[]) { scamper_addr_t *addr_a[256], *addr; uint32_t u32_a[256]; int ch; long lo; char *opts = "?i:O:U:"; char *opt_userid = NULL, *opt_ips = NULL; char *str, *next; int i, x; while((ch = getopt(argc, argv, opts)) != -1) { switch(ch) { case 'i': opt_ips = strdup(optarg); break; case 'O': if(strcasecmp(optarg, "notrace") == 0) flags |= FLAG_NOTRACE; else { usage(OPT_OPTIONS); goto err; } break; case 'U': opt_userid = strdup(optarg); break; case '?': default: usage(0xffffffff); goto err; } } if((str = opt_userid) != NULL) { x = 0; do { if(x >= sizeof(u32_a) / sizeof(uint32_t)) { usage(OPT_USERID); goto err; } string_nullterm_char(str, ',', &next); if(string_tolong(str, &lo) != 0 || lo < 0 || lo > 65535) { usage(OPT_USERID); goto err; } u32_a[x++] = lo; str = next; } while(str != NULL); if((userids = malloc(sizeof(uint32_t) * x)) == NULL) goto err; for(i=0; i= sizeof(addr_a) / sizeof(scamper_addr_t *)) { usage(OPT_IP); goto err; } string_nullterm_char(str, ',', &next); if((addr = scamper_addr_resolve(AF_UNSPEC, str)) == NULL) { usage(OPT_IP); goto err; } addr_a[x++] = addr; str = next; } while(str != NULL); if((ips = malloc(sizeof(scamper_addr_t *) * x)) == NULL) goto err; for(i=0; itx, &b->tx); } static char *ipid_sample_ipid(const ipid_sample_t *sample,char *buf,size_t len) { if(SCAMPER_ADDR_TYPE_IS_IPV4(sample->addr)) snprintf(buf, len, "%04x", sample->ipid); else snprintf(buf, len, "%08x", sample->ipid); return buf; } static void ipid_sample_free(ipid_sample_t *sample) { if(sample == NULL) return; if(sample->addr != NULL) scamper_addr_free(sample->addr); if(sample->probe_src != NULL) scamper_addr_free(sample->probe_src); free(sample); return; } static int process_dealias(scamper_dealias_t *dealias) { scamper_dealias_probe_t *probe; scamper_dealias_reply_t *reply; ipid_sample_t *sample; uint32_t i, u32; uint16_t j; if(useridc > 0 && uint32_find(userids, useridc, dealias->userid) == 0) goto done; for(i=0; iprobec; i++) { probe = dealias->probes[i]; for(j=0; jreplyc; j++) { reply = probe->replies[j]; if(ipc > 0 && ip_find(ips, ipc, reply->src) == 0) continue; if(SCAMPER_ADDR_TYPE_IS_IPV4(reply->src)) u32 = reply->ipid; else if(reply->flags & SCAMPER_DEALIAS_REPLY_FLAG_IPID32) u32 = reply->ipid32; else continue; if((sample = malloc_zero(sizeof(ipid_sample_t))) == NULL) goto err; sample->probe_src = scamper_addr_use(probe->def->src); sample->addr = scamper_addr_use(reply->src); sample->ipid = u32; timeval_cpy(&sample->tx, &probe->tx); timeval_cpy(&sample->rx, &reply->rx); if(slist_tail_push(list, sample) == NULL) goto err; } } done: scamper_dealias_free(dealias); return 0; err: scamper_dealias_free(dealias); return -1; } static int process_ping(scamper_ping_t *ping) { scamper_ping_reply_t *reply; ipid_sample_t *sample; uint16_t i; uint32_t u32; if(useridc > 0 && uint32_find(userids, useridc, ping->userid) == 0) goto done; for(i=0; iping_sent; i++) { for(reply = ping->ping_replies[i]; reply != NULL; reply = reply->next) { if(reply->tx.tv_sec == 0) continue; if(ipc > 0 && ip_find(ips, ipc, reply->addr) == 0) continue; if(SCAMPER_ADDR_TYPE_IS_IPV4(reply->addr)) u32 = reply->reply_ipid; else if(reply->flags & SCAMPER_PING_REPLY_FLAG_REPLY_IPID) u32 = reply->reply_ipid32; else continue; if((sample = malloc_zero(sizeof(ipid_sample_t))) == NULL) goto err; sample->probe_src = scamper_addr_use(ping->src); sample->addr = scamper_addr_use(reply->addr); sample->ipid = u32; timeval_cpy(&sample->tx, &reply->tx); timeval_add_tv3(&sample->rx, &reply->tx, &reply->rtt); if(slist_tail_push(list, sample) == NULL) goto err; } } done: scamper_ping_free(ping); return 0; err: scamper_ping_free(ping); return -1; } static int process_trace(scamper_trace_t *trace) { scamper_trace_hop_t *hop; ipid_sample_t *sample; uint16_t u16; /* only grab IPID values from IPv4 traceroutes */ if(trace->dst->type != SCAMPER_ADDR_TYPE_IPV4) goto done; /* only include traceroutes for specified userids */ if(useridc > 0 && uint32_find(userids, useridc, trace->userid) == 0) goto done; for(u16=trace->firsthop-1; u16hop_count; u16++) { for(hop = trace->hops[u16]; hop != NULL; hop = hop->hop_next) { if(hop->hop_tx.tv_sec == 0) continue; if(ipc > 0 && ip_find(ips, ipc, hop->hop_addr) == 0) continue; if((sample = malloc_zero(sizeof(ipid_sample_t))) == NULL) goto err; sample->probe_src = scamper_addr_use(trace->src); sample->addr = scamper_addr_use(hop->hop_addr); sample->ipid = hop->hop_reply_ipid; timeval_cpy(&sample->tx, &hop->hop_tx); timeval_add_tv3(&sample->rx, &hop->hop_tx, &hop->hop_rtt); if(slist_tail_push(list, sample) == NULL) goto err; } } done: scamper_trace_free(trace); return 0; err: scamper_trace_free(trace); return -1; } static void process(scamper_file_t *file) { void *data; uint16_t type; while(scamper_file_read(file, filter, &type, &data) == 0) { if(data == NULL) break; /* EOF */ if(type == SCAMPER_FILE_OBJ_PING) process_ping(data); else if(type == SCAMPER_FILE_OBJ_DEALIAS) process_dealias(data); else if(type == SCAMPER_FILE_OBJ_TRACE) process_trace(data); } scamper_file_close(file); return; } static void cleanup(void) { int i; if(list != NULL) { slist_free_cb(list, (slist_free_t)ipid_sample_free); list = NULL; } if(userids != NULL) { free(userids); userids = NULL; } if(ips != NULL) { for(i=0; itx.tv_sec, (int)sample->tx.tv_usec, (int)sample->rx.tv_sec, (int)sample->rx.tv_usec, scamper_addr_tostr(sample->probe_src,probe_src,sizeof(probe_src)), scamper_addr_tostr(sample->addr, addr, sizeof(addr)), ipid_sample_ipid(sample, ipid, sizeof(ipid))); ipid_sample_free(sample); } slist_free(list); list = NULL; return 0; } scamper-cvs-20171204/utils/sc_ipiddump/Makefile.in000644 001751 000000 00000056466 13211200063 021625 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_ipiddump$(EXEEXT) subdir = utils/sc_ipiddump ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_ipiddump_OBJECTS = sc_ipiddump.$(OBJEXT) \ ../../mjl_list.$(OBJEXT) ../../utils.$(OBJEXT) sc_ipiddump_OBJECTS = $(am_sc_ipiddump_OBJECTS) sc_ipiddump_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_ipiddump_SOURCES) DIST_SOURCES = $(sc_ipiddump_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_ipiddump_SOURCES = sc_ipiddump.c ../../mjl_list.c ../../utils.c sc_ipiddump_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_ipiddump.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_ipiddump/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_ipiddump/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_ipiddump$(EXEEXT): $(sc_ipiddump_OBJECTS) $(sc_ipiddump_DEPENDENCIES) $(EXTRA_sc_ipiddump_DEPENDENCIES) @rm -f sc_ipiddump$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_ipiddump_OBJECTS) $(sc_ipiddump_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_ipiddump.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_filterpolicy/.cvsignore000644 001751 000000 00000000061 12605156607 022452 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_filterpolicy scamper-cvs-20171204/utils/sc_filterpolicy/Makefile.am000644 001751 000000 00000000662 12612634152 022507 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_filterpolicy sc_filterpolicy_SOURCES = \ sc_filterpolicy.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c sc_filterpolicy_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_filterpolicy.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_filterpolicy/sc_filterpolicy.1000644 001751 000000 00000024321 12747060260 023727 0ustar00mjlwheel000000 000000 .\" .\" sc_filterpolicy.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2015 Matthew Luckie .\" All rights reserved .\" .\" $Id: sc_filterpolicy.1,v 1.8 2016/07/30 08:09:20 mjl Exp $ .\" .Dd December 2, 2015 .Dt SC_FILTERPOLICY 1 .Os .Sh NAME .Nm sc_filterpolicy .Nd scamper driver to test systems for congruent filtering policy .Sh SYNOPSIS .Nm .Bk -words .Op Fl D .Op Fl a Ar input-file .Op Fl l Ar log-file .Op Fl o Ar output-file .Op Fl O Ar options .Op Fl p Ar scamper-port .Op Fl t Ar host-type .Op Fl T Ar test .Op Fl U Ar scamper-unix .Ek .Pp .Nm .Bk -words .Op Fl r Ar data-file .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility provides the ability to connect to a running .Xr scamper 1 instance and use that instance to test systems for congruent filtering policy. The utility tests each system specified in the input file by probing for application reachability with ICMP, UDP, and TCP probes, using both IPv4 and IPv6 where applicable. Each system in the input file should have multiple IP addresses specified; the driver probes each IP address on each system one at a time to avoid causing the remote system to rate-limit responses. .Nm obtains speed by probing systems in parallel, though it may appear to operate slowly because no progress is reported until all addresses belonging to a device have been tested one at a time. .Pp The applications supported by .Nm to test filtering policy are: .Bl -dash -offset 2n -compact -width 1n .It .Sy ICMP: test responsiveness to ICMP echo request packets. We classify the IP address as responsive to ICMP echo requests if it sends an ICMP echo reply. .It .Sy NetBIOS: test responsiveness to TCP SYN packets sent to port 139 (the NetBIOS port). We classify the IP address as responsive if it sends a SYN/ACK. .It .Sy MSSQL: test responsiveness to TCP SYN packets sent to port 1433 (the Microsoft SQL server default port). We classify the IP address as responsive if it sends a SYN/ACK. .It .Sy FTP: test responsiveness to TCP SYN packets sent to port 21 (the default port for FTP control connections). We classify the IP address as responsive if it sends a SYN/ACK. .It .Sy SSH: test responsiveness to TCP SYN packets sent to port 22 (the default port for SSH). We classify the IP address as responsive if it sends a SYN/ACK. .It .Sy Telnet: test responsiveness to TCP SYN packets sent to port 23 (the default port for telnet). We classify the IP address as responsive if it sends a SYN/ACK. .It .Sy MySQL: test responsiveness to TCP SYN packets sent to port 3306 (the default port for MySQL). We classify the IP address as responsive if it sends a SYN/ACK. .It .Sy RDP: test responsiveness to TCP SYN packets sent to port 3389 (the default port for RDP). We classify the IP address as responsive if it sends a SYN/ACK. .It .Sy HTTPS: test responsiveness to TCP SYN packets sent to port 443 (the default port for HTTPS). We classify the IP address as responsive if it sends a SYN/ACK. .It .Sy SMB: test responsiveness to TCP SYN packets sent to port 445 (the default port for SMB). We classify the IP address as responsive if it sends a SYN/ACK. .It .Sy HTTP: test responsiveness to TCP SYN packets sent to port 80 (the default port for HTTP). We classify the IP address as responsive if it sends a SYN/ACK. .It .Sy BGP: test responsiveness to TCP SYN packets sent to port 179 (the default port for BGP). We classify the IP address as responsive if it sends a SYN/ACK. .It .Sy NTP: test responsiveness to UDP packets sent to port 123 (the default port for NTP) with an NTP version request payload. We classify the IP address as responsive if it sends a UDP response. .It .Sy DNS: test responsiveness to UDP packets sent to port 53 (the default port for DNS) with a query for www.google.com. We classify the IP address as responsive if it sends a UDP response. .It .Sy SNMP: test responsiveness to UDP packets sent to port 161 (the default port for SNMP) with a get for sysDescr via the public community using the SNMPv2c protocol. We classify the IP address as responsive if it sends a UDP response. .It .Sy VNC: test responsiveness to TCP SYN packets sent to port 5900 (the default port for VNC). We classify the IP address as responsive if it sends a SYN/ACK. .El .Pp The options supported by .Nm are as follows: .Bl -tag -width Ds .It Fl ? prints a list of command line options and a synopsis of each. .It Fl a Ar input-file specifies the name of the input file which consists of a sequence of systems to test. See the examples section for input-file formatting examples. .It Fl D with this option set, .Nm will detach and become a daemon. .It Fl l Ar log-file specifies the name of a file to log progress output from .Nm generated at run time. .It Fl o Ar output-file specifies the name of the file to be written. The output file will use the .Xr warts 5 format. .It Fl O Ar options allows the behavior of .Nm to be further tailored. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy impatient: order the systems found in the input-file so that those with the most addresses are probed first, so that probing will complete as fast as possible. .It .Sy incongruent: only report systems which are inferred to have an incongruent filtering policy. .It .Sy trace: probe the addresses found in the input-file using traceroute, rather than ping. .It .Sy tuples: signals that the input-file is formatted as tuples, rather than rows. See the examples section for more information. .El .It Fl p Ar scamper-port specifies the port on the local host where .Xr scamper 1 is accepting control socket connections. .It Fl r Ar data-file specifies the name of a previously collected filter policy data file, in .Xr warts 5 format, to read and analyse. .It Fl t Ar probe-class specifies the class of probes to send for each IP address in the input file. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy router: test ICMP, SSH, Telnet, HTTPS, HTTP, BGP, NTP, DNS, and SNMP. .It .Sy server: test ICMP, FTP, SSH, Telnet, MySQL, RDP, HTTPS, SMB, HTTP, NTP, DNS, and SNMP. .It .Sy all: test ICMP, NetBIOS, MSSQL, FTP, SSH, Telnet, MySQL, RDP, HTTPS, SMB, VNC, HTTP, BGP, NTP, DNS, and SNMP. .El .It Fl T Ar test specifies adjustments to the test schedule from the supported application types. Prefacing an application with + causes the application type to be added to the test schedule, and prefacing an application with - causes the application type to be removed from the test schedule. .It Fl U Ar scamper-unix specifies the unix domain socket on the local host where .Xr scamper 1 is accepting control socket connections. .El .Sh EXAMPLES .Pp .Nm requires a .Xr scamper 1 instance listening on a port or unix domain socket for commands in order to collect data: .Pp .in +.3i .nf scamper -P 31337 .fi .in -.3i .Pp will start a .Xr scamper 1 instance listening on port 31337 on the loopback interface. To use .Nm to test the filtering policy of a set of routers specified in a file named routers.txt and formatted as rows as follows: .Pp .in +.3i .nf foo.example.com 192.0.2.1 2001:DB8::1 bar.example.com 192.0.2.2 2001:DB8::2 .fi .in -.3i .Pp the following command will test these routers for responsiveness to ICMP, SSH, Telnet, HTTPS, HTTP, BGP, NTP, DNS, and SNMP probes, recording raw data into example-routers.warts: .Pp .in +.3i .nf sc_filterpolicy -p 31337 -a routers.txt -t router -o example-routers.warts .fi .in -.3i .Pp Including the name of each device in the input file is optional. .Pp The following command will only test the routers for responsiveness to SSH: .Pp .in +.3i .nf sc_filterpolicy -p 31337 -a routers.txt -T +ssh -o example-ssh.warts .fi .in -.3i .Pp To use .Nm to test the filtering policy of a set of servers specified in a file named servers.txt and formatted as tuples as follows: .Pp .in +.3i .nf db.example.com 192.0.2.3 db.example.com 2001::DB8::3 corp.example.com 192.0.2.4 corp.example.com 2001::DB8::4 .fi .in -.3i .Pp the following command will test these servers for responsiveness to ICMP, FTP, SSH, Telnet, MySQL, RDP, HTTPS, SMB, HTTP, NTP, DNS, and SNMP probes, recording raw data into example-servers.warts: .Pp .in +.3i .nf sc_filterpolicy -p 31337 -a servers.txt -t server -o example-servers.warts -O tuples .fi .in -.3i .Pp In an input file formatted as tuples, the name (or an identifier) for each device is mandatory, and is used to ensure only one probe is sent to any one device at a time, and to collate responses from different addresses to the same device for reporting. .Pp Once raw data has been collected, .Nm can be used to analyse the collected data. For the example-routers.warts file, the following command dumps a summary of the data collected for each router: .Pp .in +.3i .nf .ft CW sc_filterpolicy -r example-routers.warts .Pp : T : e H : I l T H S : C S n T T B N D N : M S e P T G T N M : P H t S P P P S P ======================================== 192.0.2.1 : O O O O O 2001:DB8::1 : O O O O O .Pp 192.0.2.2 : O X 2001:DB8::2 : O O .ft R .fi .in -.3i .Pp The first router is responsive (O) for ICMP, SSH, HTTP, DNS, and SNMP probes on all addresses. The second router is responsive (O) to ICMP probes on both addresses is unresponsive (X) to SSH on the IPv4 address, but is responsive (O) to SSH on the IPv6 address and possibly represents a filtering policy that is incongruent and requires attention. Note that the empty cells in the table represent a router that was unresponsive (X) to that protocol for all addresses tested; the cells are left empty to allow the user to focus on open and incongruent application services. .Pp The command: .Pp .in +.3i .nf sc_filterpolicy -O incongruent -r example-routers.warts .fi .in -.3i .Pp will only show routers with an incongruent filtering policy. .Sh SEE ALSO .Rs .%A "J. Czyz" .%A "M. Luckie" .%A "M. Allman" .%A "M. Bailey" .%T "Don't Forget to Lock the Back Door! A Characterization of IPv6 Network Security Policy" .%O "Proc. Network and Distributed Systems Security (NDSS) Conference 2016" .Re .Xr scamper 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2json 1 , .Xr warts 5 .Sh AUTHORS .Nm was written by Matthew Luckie and Jakub Czyz. scamper-cvs-20171204/utils/sc_filterpolicy/sc_filterpolicy.c000644 001751 000000 00000120312 12631227764 024014 0ustar00mjlwheel000000 000000 /* * sc_filterpolicy : check filter congruity of different addresses for the * : same device * * Authors : Matthew Luckie, Jakub Czyz * * Copyright (C) 2014-2015 The Regents of the University of California * Copyright (C) 2015 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_filterpolicy.c,v 1.9 2015/12/07 07:06:28 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "ping/scamper_ping.h" #include "trace/scamper_trace.h" #include "scamper_file.h" #include "scamper_writebuf.h" #include "scamper_linepoll.h" #include "mjl_list.h" #include "mjl_splaytree.h" #include "mjl_heap.h" #include "utils.h" #define OPT_HELP 0x0001 #define OPT_INFILE 0x0002 #define OPT_OUTFILE 0x0004 #define OPT_PORT 0x0008 #define OPT_UNIX 0x0010 #define OPT_LOG 0x0020 #define OPT_DAEMON 0x0040 #define OPT_OPTIONS 0x0080 #define OPT_TYPE 0x0100 #define OPT_READ 0x0200 #define OPT_TEST 0x0400 #define OPT_ALL 0xffff #define FLAG_IMPATIENT 0x0001 #define FLAG_TRACEROUTE 0x0002 #define FLAG_TUPLES 0x0004 #define FLAG_INCONGRUENT 0x0008 typedef struct sc_iditem { scamper_addr_t *addr; uint32_t tests; uint32_t results; } sc_iditem_t; typedef struct sc_idset { uint32_t userid; uint32_t tests; sc_iditem_t **items; int itemc; } sc_idset_t; typedef struct sc_name2ips { uint32_t id; char *name; slist_t *addrs; slist_t *methods; splaytree_node_t *tree_node; sc_idset_t *set; } sc_name2ips_t; typedef struct sc_ip2n2i { scamper_addr_t *ip; sc_name2ips_t *n2i; splaytree_node_t *tree_node; } sc_ip2n2i_t; typedef struct sc_wait { struct timeval tv; sc_name2ips_t *n2i; } sc_wait_t; typedef struct sc_policytest { const char *name; size_t namelen; const uint32_t id; const char *payload; const uint16_t port; uint8_t flags; } sc_policytest_t; #define PT_FLAG_TCP 0x01 #define PT_FLAG_ICMP 0x02 #define PT_FLAG_UDP 0x04 #define PT_FLAG_ROUTER 0x08 #define PT_FLAG_SERVER 0x10 #define PT_FLAG_USE 0x20 static splaytree_t *n2i_tree = NULL; static slist_t *n2i_list = NULL; static uint32_t n2i_id = 1; static sc_name2ips_t *n2i_last = NULL; static uint32_t options = 0; static unsigned int port = 0; static char *unix_name = NULL; static scamper_writebuf_t *scamper_wb = NULL; static int scamper_fd = -1; static scamper_linepoll_t *scamper_lp = NULL; static scamper_writebuf_t *decode_wb = NULL; static scamper_file_t *decode_in = NULL; static int decode_in_fd = -1; static int decode_out_fd = -1; static char *infile = NULL; static char *datafile = NULL; static char *outfile_name = NULL; static scamper_file_t *outfile = NULL; static scamper_file_filter_t *ffilter = NULL; static int data_left = 0; static int more = 0; static int probing = 0; static int flags = 0; static struct timeval now; static FILE *logfile = NULL; static heap_t *waiting = NULL; #define PT_METHOD_ICMP 1 #define PT_METHOD_NETBIOS 2 #define PT_METHOD_MSSQL 3 #define PT_METHOD_FTP 4 #define PT_METHOD_SSH 5 #define PT_METHOD_TELNET 6 #define PT_METHOD_MYSQL 7 #define PT_METHOD_RDP 8 #define PT_METHOD_HTTPS 9 #define PT_METHOD_SMB 10 #define PT_METHOD_VNC 11 #define PT_METHOD_HTTP 12 #define PT_METHOD_BGP 13 #define PT_METHOD_NTP 14 #define PT_METHOD_DNS 15 #define PT_METHOD_SNMP 16 #define PT_METHOD_MAX 16 static sc_policytest_t methods[] = { {"ICMP", 4, PT_METHOD_ICMP, NULL, 0, PT_FLAG_ICMP | PT_FLAG_SERVER | PT_FLAG_ROUTER}, {"NetBIOS", 7, PT_METHOD_NETBIOS, NULL, 139, PT_FLAG_TCP}, {"MSSQL", 5, PT_METHOD_MSSQL, NULL, 1433, PT_FLAG_TCP}, {"FTP", 3, PT_METHOD_FTP, NULL, 21, PT_FLAG_TCP | PT_FLAG_SERVER}, {"SSH", 3, PT_METHOD_SSH, NULL, 22, PT_FLAG_TCP | PT_FLAG_SERVER | PT_FLAG_ROUTER}, {"Telnet", 6, PT_METHOD_TELNET, NULL, 23, PT_FLAG_TCP | PT_FLAG_SERVER | PT_FLAG_ROUTER}, {"MySQL", 5, PT_METHOD_MYSQL, NULL, 3306, PT_FLAG_TCP | PT_FLAG_SERVER}, {"RDP", 3, PT_METHOD_RDP, NULL, 3389, PT_FLAG_TCP | PT_FLAG_SERVER}, {"HTTPS", 5, PT_METHOD_HTTPS, NULL, 443, PT_FLAG_TCP | PT_FLAG_SERVER | PT_FLAG_ROUTER}, {"SMB", 3, PT_METHOD_SMB, NULL, 445, PT_FLAG_TCP | PT_FLAG_SERVER}, {"VNC", 3, PT_METHOD_VNC, NULL, 5900, PT_FLAG_TCP}, {"HTTP", 4, PT_METHOD_HTTP, NULL, 80, PT_FLAG_TCP | PT_FLAG_SERVER | PT_FLAG_ROUTER}, {"BGP", 3, PT_METHOD_BGP, NULL, 179, PT_FLAG_TCP | PT_FLAG_ROUTER}, {"NTP", 3, PT_METHOD_NTP, "160200010000000000000000", 123, PT_FLAG_UDP | PT_FLAG_SERVER | PT_FLAG_ROUTER}, {"DNS", 3, PT_METHOD_DNS, "a980010000010000000000000377777706676f6f676c6503636f6d0000010001", 53, PT_FLAG_UDP | PT_FLAG_SERVER | PT_FLAG_ROUTER}, {"SNMP", 4, PT_METHOD_SNMP, "302902010104067075626c6963a01c02046aebe0a002" "0100020100300e300c06082b060102010105000500", 161, PT_FLAG_UDP | PT_FLAG_SERVER | PT_FLAG_ROUTER}, }; static const int methodc = sizeof(methods) / sizeof(sc_policytest_t); static void usage(uint32_t opt_mask) { int i; fprintf(stderr, "usage: sc_filterpolicy [-D] [-a infile] [-o outfile] [-p port] [-U unix]\n" " [-l log] [-O options] [-t type] [-T test]\n" "\n" " sc_filterpolicy [-r datafile]\n" "\n"); if(opt_mask == 0) fprintf(stderr, " sc_filterpolicy -?\n\n"); if(opt_mask & OPT_HELP) fprintf(stderr, " -? give an overview of the usage of sc_filterpolicy\n"); if(opt_mask & OPT_INFILE) fprintf(stderr, " -a input file\n"); if(opt_mask & OPT_DAEMON) fprintf(stderr, " -D run as a daemon\n"); if(opt_mask & OPT_OUTFILE) fprintf(stderr, " -o output warts data file\n"); if(opt_mask & OPT_OPTIONS) fprintf(stderr, " -O options [impatient | incongruent | trace | tuples]\n"); if(opt_mask & OPT_PORT) fprintf(stderr, " -p port to find scamper on\n"); if(opt_mask & OPT_LOG) fprintf(stderr, " -l output logfile\n"); if(opt_mask & OPT_READ) fprintf(stderr, " -r input warts data file\n"); if(opt_mask & OPT_TYPE) fprintf(stderr, " -t type of probes: router, server, or all\n"); if(opt_mask & OPT_TEST) { fprintf(stderr, " -T adjust test schedule; e.g. -http or +vnc\n"); for(i=0; i 0) { usage(OPT_INFILE|OPT_OUTFILE|OPT_PORT|OPT_UNIX); goto err; } if(options & OPT_PORT) { if(string_tolong(opt_port, &lo) != 0 || lo < 1 || lo > 65535) { usage(OPT_PORT); goto err; } port = lo; } else if(options & OPT_UNIX) { unix_name = opt_unix; } /* validate the -t parameter */ if(opt_type != NULL) { if(strcasecmp(opt_type, "router") == 0) { for(i=0; iprobe_method == SCAMPER_PING_METHOD_ICMP_ECHO) { id = PT_METHOD_ICMP; } else if(ping->probe_method == SCAMPER_PING_METHOD_TCP_SYN) { switch(ping->probe_dport) { case 21: id = PT_METHOD_FTP; break; case 22: id = PT_METHOD_SSH; break; case 23: id = PT_METHOD_TELNET; break; case 80: id = PT_METHOD_HTTP; break; case 139: id = PT_METHOD_NETBIOS; break; case 179: id = PT_METHOD_BGP; break; case 443: id = PT_METHOD_HTTPS; break; case 445: id = PT_METHOD_SMB; break; case 1433: id = PT_METHOD_MSSQL; break; case 3306: id = PT_METHOD_MYSQL; break; case 3389: id = PT_METHOD_RDP; break; case 5900: id = PT_METHOD_VNC; break; } } else if(ping->probe_method == SCAMPER_PING_METHOD_UDP) { switch(ping->probe_dport) { case 53: id = PT_METHOD_DNS; break; case 123: id = PT_METHOD_NTP; break; case 161: id = PT_METHOD_SNMP; break; } } if(id == 0) return NULL; return &methods[id-1]; } static int ping_r(const sc_policytest_t *method, const scamper_ping_t *ping) { scamper_ping_reply_t *r; uint16_t i; for(i=0; iping_sent; i++) { for(r = ping->ping_replies[i]; r != NULL; r = r->next) { if(method->flags & PT_FLAG_TCP) { if(SCAMPER_PING_REPLY_IS_TCP(r) && (r->tcp_flags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK)) return 1; } else if(method->flags & PT_FLAG_UDP) { if(SCAMPER_PING_REPLY_IS_UDP(r)) return 1; } else if(method->flags & PT_FLAG_ICMP) { if(SCAMPER_PING_REPLY_IS_ICMP_ECHO_REPLY(r)) return 1; } else return -1; } } return 0; } static int sc_wait_cmp(const void *a, const void *b) { return timeval_cmp(&((sc_wait_t *)b)->tv, &((sc_wait_t *)a)->tv); } static int sc_wait(struct timeval *tv, sc_name2ips_t *n2i) { sc_wait_t *w; if((w = malloc_zero(sizeof(sc_wait_t))) == NULL) return -1; timeval_cpy(&w->tv, tv); w->n2i = n2i; if(heap_insert(waiting, w) == NULL) return -1; return 0; } static int sc_iditem_cmp(const sc_iditem_t *a, const sc_iditem_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static void sc_iditem_free(sc_iditem_t *item) { if(item == NULL) return; if(item->addr != NULL) scamper_addr_free(item->addr); free(item); return; } static sc_iditem_t *sc_iditem_get(sc_idset_t *set, scamper_addr_t *addr) { sc_iditem_t fm, *item; fm.addr = addr; if((item = array_find((void **)set->items, set->itemc, &fm, (array_cmp_t)sc_iditem_cmp)) != NULL) return item; if((item = malloc_zero(sizeof(sc_iditem_t))) == NULL) return NULL; item->addr = scamper_addr_use(addr); if(array_insert((void ***)&set->items, &set->itemc, item, (array_cmp_t)sc_iditem_cmp) != 0) { sc_iditem_free(item); return NULL; } return item; } static int sc_idset_cmp(const sc_idset_t *a, const sc_idset_t *b) { if(a->userid < b->userid) return -1; if(a->userid > b->userid) return 1; return 0; } static void sc_idset_free(sc_idset_t *set) { int i; if(set == NULL) return; if(set->items != NULL) { for(i=0; iitemc; i++) sc_iditem_free(set->items[i]); free(set->items); } free(set); return; } static sc_idset_t *sc_idset_get(splaytree_t *tree, uint32_t id) { sc_idset_t fm, *set; fm.userid = id; /* see if we already have a collection for this id */ if((set = splaytree_find(tree, &fm)) != NULL) return set; /* no collection, alloc a new one */ if((set = malloc_zero(sizeof(sc_idset_t))) == NULL) return NULL; set->userid = id; /* add it to the tree. if it fails, free the memory */ if(splaytree_insert(tree, set) == NULL) { free(set); return NULL; } return set; } static int sc_idset_incongruent(const sc_idset_t *set) { sc_iditem_t *first, *item; int i; first = set->items[0]; for(i=1; iitemc; i++) { item = set->items[i]; if(first->results != item->results) return 1; } return 0; } static void sc_idset_print(const sc_idset_t *set) { char fsaddr[30], buf[128]; size_t maxaddr, max, len; sc_policytest_t *pt; sc_iditem_t *item; uint32_t o; int i, j; /* should we print this at all? */ if((flags & FLAG_INCONGRUENT) != 0 && sc_idset_incongruent(set) == 0) return; /* * first, figure out the maximum width IP address in the set, and * which protocols are open at all */ maxaddr = 0; o = 0; for(i=0; iitemc; i++) { item = set->items[i]; scamper_addr_tostr(item->addr, buf, sizeof(buf)); if((len = strlen(buf)) > maxaddr) maxaddr = len; o |= item->results; } snprintf(fsaddr, sizeof(fsaddr), "%%%ds :", (int)maxaddr); /* next, figure out the maximum width protocol name tested */ max = 0; for(j=0; jtests & (1 << j)) == 0) continue; pt = &methods[j]; if(pt->namelen > max) max = pt->namelen; } /* print the header that goes at the top of the router's results */ for(len=0; lentests & (1 << j)) == 0) continue; pt = &methods[j]; if(len < max - pt->namelen) { printf(" "); continue; } printf(" %c", pt->name[len-(max-pt->namelen)]); } printf("\n"); } /* print a line under the header */ for(len=0; lenitemc; i++) { item = set->items[i]; printf(fsaddr, scamper_addr_tostr(item->addr, buf, sizeof(buf))); for(j=0; jtests & (1 << j)) == 0) continue; if(item->results & (1 << j)) printf(" O"); else if((item->tests & (1 << j)) == 0) printf(" ?"); else if(o & (1 << j)) printf(" X"); else printf(" "); } printf("\n"); } printf("\n"); return; } static int sc_ip2n2i_cmp(const sc_ip2n2i_t *a, const sc_ip2n2i_t *b) { return scamper_addr_cmp(a->ip, b->ip); } static void sc_ip2n2i_free(sc_ip2n2i_t *ip2n2i) { if(ip2n2i == NULL) return; if(ip2n2i->tree_node != NULL) splaytree_remove_node(n2i_tree, ip2n2i->tree_node); if(ip2n2i->ip != NULL) scamper_addr_free(ip2n2i->ip); free(ip2n2i); return; } static sc_ip2n2i_t *sc_ip2n2i_find(scamper_addr_t *ip) { sc_ip2n2i_t fm; fm.ip = ip; return splaytree_find(n2i_tree, &fm); } static sc_ip2n2i_t *sc_ip2n2i_get(scamper_addr_t *ip, sc_name2ips_t *n2i) { sc_ip2n2i_t *ip2n2i; if((ip2n2i = sc_ip2n2i_find(ip)) != NULL) { assert(ip2n2i->n2i == n2i); return ip2n2i; } if((ip2n2i = malloc_zero(sizeof(sc_ip2n2i_t))) == NULL) return NULL; ip2n2i->ip = scamper_addr_use(ip); ip2n2i->n2i = n2i; if((ip2n2i->tree_node = splaytree_insert(n2i_tree, ip2n2i)) == NULL) { sc_ip2n2i_free(ip2n2i); return NULL; } return ip2n2i; } static void sc_name2ips_methods(sc_name2ips_t *n2i) { int i; slist_empty(n2i->methods); for(i=0; imethods, &methods[i]); slist_shuffle(n2i->methods); return; } static int sc_name2ips_name_cmp(const sc_name2ips_t *a, const sc_name2ips_t *b) { return strcmp(a->name, b->name); } static int sc_name2ips_addr_cmp(const sc_name2ips_t *a, const sc_name2ips_t *b) { int ac = slist_count(a->addrs); int bc = slist_count(b->addrs); if(ac > bc) return -1; if(ac < bc) return 1; return 0; } static void sc_name2ips_free(sc_name2ips_t *n2i) { scamper_addr_t *addr; if(n2i == NULL) return; if(n2i->tree_node != NULL) splaytree_remove_node(n2i_tree, n2i->tree_node); if(n2i->addrs != NULL) { while((addr = slist_head_pop(n2i->addrs)) != NULL) scamper_addr_free(addr); slist_free(n2i->addrs); } if(n2i->methods != NULL) slist_free(n2i->methods); if(n2i->name != NULL) free(n2i->name); if(n2i->set != NULL) sc_idset_free(n2i->set); free(n2i); return; } static sc_name2ips_t *sc_name2ips_get(char *name) { sc_name2ips_t fm, *n2i = NULL; fm.name = name; if((n2i = splaytree_find(n2i_tree, &fm)) != NULL) return n2i; if((n2i = malloc_zero(sizeof(sc_name2ips_t))) == NULL || (name != NULL && (n2i->name = strdup(name)) == NULL) || (n2i->addrs = slist_alloc()) == NULL || (n2i->methods = slist_alloc()) == NULL || (n2i->tree_node = splaytree_insert(n2i_tree, n2i)) == NULL || slist_tail_push(n2i_list, n2i) == NULL) { fprintf(stderr, "sc_name2ips_get: could not alloc node\n"); goto err; } n2i->id = n2i_id++; return n2i; err: if(n2i != NULL) sc_name2ips_free(n2i); return NULL; } static int do_method(void) { scamper_addr_t *addr; sc_name2ips_t *n2i; sc_policytest_t *pt; sc_wait_t *w; char buf[128], cmd[512]; size_t off = 0; if(more < 1) return 0; if((w = heap_head_item(waiting)) != NULL && timeval_cmp(&now, &w->tv) >= 0) { heap_remove(waiting); n2i = w->n2i; free(w); } else if((n2i = slist_head_pop(n2i_list)) != NULL) { sc_name2ips_methods(n2i); } else return 0; addr = slist_head_item(n2i->addrs); scamper_addr_tostr(addr, buf, sizeof(buf)); if(sc_ip2n2i_get(addr, n2i) == NULL) { logprint("%s: could not sc_ip2n2i_get %s\n", __func__, buf); return -1; } pt = slist_head_pop(n2i->methods); if(flags & FLAG_TRACEROUTE) { string_concat(cmd, sizeof(cmd), &off, "trace -q 1 -U %u", n2i->id); if(pt->flags & PT_FLAG_ICMP) string_concat(cmd, sizeof(cmd), &off, " -P icmp-paris"); else if(pt->flags & PT_FLAG_TCP) string_concat(cmd, sizeof(cmd), &off, " -P tcp -d %u", pt->port); else if(pt->flags & PT_FLAG_UDP) string_concat(cmd, sizeof(cmd), &off, " -P udp-paris -O dl -O const-payload -d %u -p %s", pt->port, pt->payload); else return -1; string_concat(cmd, sizeof(cmd), &off, " %s\n", buf); } else { string_concat(cmd, sizeof(cmd), &off, "ping -i 5 -U %u -c 1", n2i->id); if(pt->flags & PT_FLAG_ICMP) string_concat(cmd, sizeof(cmd), &off, " -P icmp-echo"); else if(pt->flags & PT_FLAG_TCP) string_concat(cmd, sizeof(cmd), &off, " -P tcp-syn -d %u", pt->port); else if(pt->flags & PT_FLAG_UDP) string_concat(cmd, sizeof(cmd), &off, " -P udp -O dl -d %u -B %s", pt->port, pt->payload); string_concat(cmd, sizeof(cmd), &off, " %s\n", buf); } if(scamper_writebuf_send(scamper_wb, cmd, off) != 0) { fprintf(stderr, "could not send %s\n", cmd); return -1; } n2i_last = n2i; probing++; more--; logprint("p %d, w %d, l %d : %s", probing, heap_count(waiting), slist_count(n2i_list), cmd); return 0; } /* * infile_tuples_line * * read the input file, which contains tuples. */ static int infile_tuples_line(char *line, void *param) { splaytree_t *addrtree = param; scamper_addr_t *addr = NULL; sc_name2ips_t *n2i = NULL; char *name, *ip; if(line[0] == '#' || line[0] == '\0') return 0; name = line; if((ip = string_nextword(line)) == NULL || (addr = scamper_addr_resolve(AF_UNSPEC, ip)) == NULL) { fprintf(stderr, "malformed line in input file\n"); goto err; } if(splaytree_find(addrtree, addr) != NULL) { fprintf(stderr, "%s in list multiple times, aborting\n", ip); goto err; } if(splaytree_insert(addrtree, scamper_addr_use(addr)) == NULL || (n2i = sc_name2ips_get(name)) == NULL || slist_tail_push(n2i->addrs, addr) == NULL) { fprintf(stderr, "could not stuff %s:%s\n", name, ip); goto err; } return 0; err: if(addr != NULL) scamper_addr_free(addr); return -1; } static int infile_rows_line(char *line, void *param) { splaytree_t *addrtree = param; scamper_addr_t *addr = NULL; sc_name2ips_t *n2i = NULL; char *name, *ip, *ptr; if(line[0] == '#' || line[0] == '\0') return 0; name = line; if((ip = string_nextword(line)) == NULL) { fprintf(stderr, "malformed line in input file\n"); goto err; } if((addr = scamper_addr_resolve(AF_UNSPEC, name)) != NULL) n2i = sc_name2ips_get(name); else n2i = sc_name2ips_get(NULL); if(n2i == NULL) goto err; if(addr != NULL) { if(splaytree_find(addrtree, addr) != NULL) { fprintf(stderr, "%s in list multiple times, aborting\n", ip); goto err; } if(splaytree_insert(addrtree, scamper_addr_use(addr)) == NULL || slist_tail_push(n2i->addrs, addr) == NULL) { fprintf(stderr, "could not stuff %s:%s\n", name, ip); goto err; } } ptr = string_nextword(ip); for(;;) { if((addr = scamper_addr_resolve(AF_UNSPEC, ip)) == NULL) { fprintf(stderr, "%s is not an IP address\n", ip); goto err; } if(splaytree_find(addrtree, addr) != NULL) { fprintf(stderr, "%s in list multiple times, aborting\n", ip); goto err; } if(splaytree_insert(addrtree, scamper_addr_use(addr)) == NULL || slist_tail_push(n2i->addrs, addr) == NULL) { fprintf(stderr, "could not stuff %s:%s\n", name, ip); goto err; } if((ip = ptr) == NULL) break; ptr = string_nextword(ip); } return 0; err: if(addr != NULL) scamper_addr_free(addr); return -1; } static int do_infile(void) { splaytree_t *addrtree; slist_node_t *node; sc_name2ips_t *n2i; if((addrtree = splaytree_alloc((splaytree_cmp_t)scamper_addr_cmp)) == NULL) { fprintf(stderr, "could not alloc addrtree\n"); return -1; } if(flags & FLAG_TUPLES) { if(file_lines(infile, infile_tuples_line, addrtree) != 0) goto err; } else { if(file_lines(infile, infile_rows_line, addrtree) != 0) goto err; } splaytree_free(addrtree, (splaytree_free_t)scamper_addr_free); addrtree = NULL; for(node=slist_head_node(n2i_list); node != NULL; node=slist_node_next(node)) { n2i = slist_node_item(node); slist_shuffle(n2i->addrs); n2i->tree_node = NULL; } splaytree_free(n2i_tree, NULL); if(flags & FLAG_IMPATIENT) slist_qsort(n2i_list, (slist_cmp_t)sc_name2ips_addr_cmp); else slist_shuffle(n2i_list); if((n2i_tree = splaytree_alloc((splaytree_cmp_t)sc_ip2n2i_cmp)) == NULL) { fprintf(stderr, "could not alloc n2i_tree\n"); return -1; } return 0; err: if(addrtree != NULL) splaytree_free(addrtree, (splaytree_free_t)scamper_addr_free); return -1; } static sc_name2ips_t *sc_name2ips_find(scamper_addr_t *dst) { sc_ip2n2i_t *ip2n2i; if((ip2n2i = sc_ip2n2i_find(dst)) == NULL) return NULL; return ip2n2i->n2i; } static int do_decoderead_addr(scamper_addr_t *dst) { scamper_addr_t *addr; struct timeval tv; sc_ip2n2i_t *ip2n2i; sc_name2ips_t *n2i; char buf[128]; if((ip2n2i = sc_ip2n2i_find(dst)) == NULL) { logprint("%s: could not find %s\n", __func__, scamper_addr_tostr(dst, buf, sizeof(buf))); return -1; } n2i = ip2n2i->n2i; if(slist_count(n2i->methods) == 0) { sc_ip2n2i_free(ip2n2i); addr = slist_head_pop(n2i->addrs); scamper_addr_free(addr); if(slist_count(n2i->addrs) == 0) { if(n2i->set != NULL) sc_idset_print(n2i->set); sc_name2ips_free(n2i); n2i = NULL; } else { sc_name2ips_methods(n2i); } } if(n2i != NULL) { timeval_add_s(&tv, &now, 1); if(sc_wait(&tv, n2i) != 0) { logprint("%s: could not wait\n", __func__); return -1; } } return 0; } static int do_decoderead_ping(scamper_ping_t *ping) { sc_policytest_t *method; sc_name2ips_t *n2i; char buf[128]; sc_iditem_t *item; int rc, code; if((options & OPT_DAEMON) == 0) { if((n2i = sc_name2ips_find(ping->dst)) == NULL) { logprint("%s: could not find %s\n", __func__, scamper_addr_tostr(ping->dst, buf, sizeof(buf))); goto err; } if(n2i->set == NULL && (n2i->set = malloc_zero(sizeof(sc_idset_t))) == NULL) { logprint("%s: could not malloc idset: %s\n", __func__, strerror(errno)); goto err; } if((method = ping_to_method(ping)) == NULL) { logprint("%s: unhandled method\n", __func__); goto err; } code = ping_r(method, ping); n2i->set->tests |= (1 << (method->id-1)); if((item = sc_iditem_get(n2i->set, ping->dst)) == NULL) { logprint("%s: could not get item for %s: %s\n", __func__, scamper_addr_tostr(ping->dst, buf, sizeof(buf)), strerror(errno)); goto err; } item->tests |= (1 << (method->id-1)); if(code == 1) item->results |= (1 << (method->id-1)); } rc = do_decoderead_addr(ping->dst); scamper_ping_free(ping); return rc; err: scamper_ping_free(ping); return -1; } static int do_decoderead_trace(scamper_trace_t *trace) { int rc = do_decoderead_addr(trace->dst); scamper_trace_free(trace); return rc; } static int do_n2i_next(void) { scamper_addr_t *addr; struct timeval tv; sc_ip2n2i_t *ip2n2i; char buf[128]; assert(n2i_last != NULL); addr = slist_head_item(n2i_last->addrs); scamper_addr_tostr(addr, buf, sizeof(buf)); if((ip2n2i = sc_ip2n2i_find(addr)) == NULL) { logprint("%s: could not find %s\n", __func__, buf); return -1; } if(ip2n2i->n2i != n2i_last) { logprint("%s: different n2i %u than expected %u\n", __func__, ip2n2i->n2i->id, n2i_last->id); return -1; } logprint("%s: skipping %s\n", __func__, buf); sc_ip2n2i_free(ip2n2i); addr = slist_head_pop(n2i_last->addrs); scamper_addr_free(addr); if(slist_count(n2i_last->addrs) == 0) { sc_name2ips_free(n2i_last); n2i_last = NULL; } else { sc_name2ips_methods(n2i_last); } if(n2i_last != NULL) { timeval_add_s(&tv, &now, 1); if(sc_wait(&tv, n2i_last) != 0) { logprint("%s: could not wait %s\n", __func__, buf); return -1; } } return 0; } static int do_decoderead(void) { void *data; uint16_t type; /* try and read a traceroute from the warts decoder */ if(scamper_file_read(decode_in, ffilter, &type, &data) != 0) { fprintf(stderr, "do_decoderead: scamper_file_read errno %d\n", errno); return -1; } if(data == NULL) return 0; probing--; if(scamper_file_write_obj(outfile, type, data) != 0) { fprintf(stderr, "do_decoderead: could not write obj %d\n", type); /* XXX: free data */ return -1; } if(type == SCAMPER_FILE_OBJ_PING) return do_decoderead_ping(data); else if(type == SCAMPER_FILE_OBJ_TRACE) return do_decoderead_trace(data); logprint("%s: unknown type %d\n", __func__, type); return -1; } static int do_scamperread_line(void *param, uint8_t *buf, size_t linelen) { char *head = (char *)buf; uint8_t uu[64]; size_t uus; long lo; /* skip empty lines */ if(head[0] == '\0') return 0; /* if currently decoding data, then pass it to uudecode */ if(data_left > 0) { uus = sizeof(uu); if(uudecode_line(head, linelen, uu, &uus) != 0) { fprintf(stderr, "could not uudecode_line\n"); return -1; } if(uus != 0) scamper_writebuf_send(decode_wb, uu, uus); data_left -= (linelen + 1); return 0; } /* feedback letting us know that the command was accepted */ if(linelen >= 2 && strncasecmp(head, "OK", 2) == 0) return 0; /* if the scamper process is asking for more tasks, give it more */ if(linelen == 4 && strncasecmp(head, "MORE", linelen) == 0) { more++; if(do_method() != 0) return -1; return 0; } /* new piece of data */ if(linelen > 5 && strncasecmp(head, "DATA ", 5) == 0) { if(string_isnumber(head+5) == 0 || string_tolong(head+5, &lo) != 0) { fprintf(stderr, "could not parse %s\n", head); return -1; } data_left = lo; return 0; } /* feedback letting us know that the command was not accepted */ if(linelen >= 3 && strncasecmp(head, "ERR", 3) == 0) { more++; if(do_n2i_next() != 0 || do_method() != 0) return -1; return 0; } fprintf(stderr, "unknown response '%s'\n", head); return -1; } static int do_scamperread(void) { ssize_t rc; uint8_t buf[512]; if((rc = read(scamper_fd, buf, sizeof(buf))) > 0) { scamper_linepoll_handle(scamper_lp, buf, rc); return 0; } else if(rc == 0) { close(scamper_fd); scamper_fd = -1; return 0; } else if(errno == EINTR || errno == EAGAIN) { return 0; } fprintf(stderr, "could not read: errno %d\n", errno); return -1; } /* * do_scamperconnect * * allocate socket and connect to scamper process listening on the port * specified. */ static int do_scamperconnect(void) { struct sockaddr_un sun; struct sockaddr_in sin; struct in_addr in; if(options & OPT_PORT) { inet_aton("127.0.0.1", &in); sockaddr_compose((struct sockaddr *)&sin, AF_INET, &in, port); if((scamper_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { fprintf(stderr, "could not allocate new socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sin, sizeof(sin)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } } else if(options & OPT_UNIX) { if(sockaddr_compose_un((struct sockaddr *)&sun, unix_name) != 0) { fprintf(stderr, "could not build sockaddr_un\n"); return -1; } if((scamper_fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { fprintf(stderr, "could not allocate unix domain socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sun, sizeof(sun)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } } else return -1; if(fcntl_set(scamper_fd, O_NONBLOCK) == -1) { fprintf(stderr, "could not set nonblock on scamper_fd\n"); return -1; } return 0; } static int fp_data(void) { struct timeval tv, *tv_ptr; fd_set rfds, wfds, *wfdsp; sc_wait_t *w; int pair[2]; int nfds; random_seed(); if((n2i_tree = splaytree_alloc((splaytree_cmp_t)sc_name2ips_name_cmp)) == NULL || (n2i_list = slist_alloc()) == NULL || (waiting = heap_alloc(sc_wait_cmp)) == NULL || (scamper_wb = scamper_writebuf_alloc()) == NULL || (scamper_lp = scamper_linepoll_alloc(do_scamperread_line,NULL)) == NULL || (decode_wb = scamper_writebuf_alloc()) == NULL || do_infile() != 0 || do_scamperconnect() != 0 || (outfile = scamper_file_open(outfile_name, 'w', "warts")) == NULL || socketpair(AF_UNIX, SOCK_STREAM, 0, pair) != 0 || (decode_in = scamper_file_openfd(pair[0], NULL, 'r', "warts")) == NULL || fcntl_set(pair[0], O_NONBLOCK) == -1 || fcntl_set(pair[1], O_NONBLOCK) == -1) return -1; decode_in_fd = pair[0]; decode_out_fd = pair[1]; scamper_writebuf_send(scamper_wb, "attach\n", 7); for(;;) { nfds = 0; FD_ZERO(&rfds); FD_ZERO(&wfds); wfdsp = NULL; if(scamper_fd < 0 && decode_in_fd < 0) break; if(scamper_fd >= 0) { FD_SET(scamper_fd, &rfds); if(nfds < scamper_fd) nfds = scamper_fd; if(scamper_writebuf_len(scamper_wb) > 0) { FD_SET(scamper_fd, &wfds); wfdsp = &wfds; } } if(decode_in_fd >= 0) { FD_SET(decode_in_fd, &rfds); if(nfds < decode_in_fd) nfds = decode_in_fd; } if(decode_out_fd >= 0 && scamper_writebuf_len(decode_wb) > 0) { FD_SET(decode_out_fd, &wfds); wfdsp = &wfds; if(nfds < decode_out_fd) nfds = decode_out_fd; } /* * need to set a timeout on select if scamper's processing window is * not full and there is a trace in the waiting queue. */ tv_ptr = NULL; if(more > 0) { gettimeofday_wrap(&now); /* * if there is something ready to probe now, then try and * do it. */ w = heap_head_item(waiting); if(slist_count(n2i_list) > 0 || (w != NULL && timeval_cmp(&w->tv, &now) <= 0)) { if(do_method() != 0) return -1; } /* * if we could not send a new command just yet, but scamper * wants one, then wait for an appropriate length of time. */ w = heap_head_item(waiting); if(more > 0 && tv_ptr == NULL && w != NULL) { tv_ptr = &tv; if(timeval_cmp(&w->tv, &now) > 0) timeval_diff_tv(&tv, &now, &w->tv); else memset(&tv, 0, sizeof(tv)); } } if(splaytree_count(n2i_tree) == 0 && slist_count(n2i_list) == 0 && heap_count(waiting) == 0) { logprint("done\n"); break; } if(select(nfds+1, &rfds, wfdsp, NULL, tv_ptr) < 0) { if(errno == EINTR) continue; fprintf(stderr, "select error\n"); break; } gettimeofday_wrap(&now); if(more > 0) { if(do_method() != 0) return -1; } if(scamper_fd >= 0) { if(FD_ISSET(scamper_fd, &rfds) && do_scamperread() != 0) return -1; if(wfdsp != NULL && FD_ISSET(scamper_fd, wfdsp) && scamper_writebuf_write(scamper_fd, scamper_wb) != 0) { logprint("could not write to scamper_fd: %d %s\n", errno, strerror(errno)); return -1; } } if(decode_in_fd >= 0) { if(FD_ISSET(decode_in_fd, &rfds) && do_decoderead() != 0) return -1; } if(decode_out_fd >= 0) { if(wfdsp != NULL && FD_ISSET(decode_out_fd, wfdsp) && scamper_writebuf_write(decode_out_fd, decode_wb) != 0) { logprint("could not write to decode_out_fd: %d %s\n", errno, strerror(errno)); return -1; } } } return 0; } static int sc_idset_print_cb(void *ptr, void *item) { sc_idset_print(item); return 0; } static int fp_read(void) { splaytree_t *tree = NULL; scamper_file_t *in = NULL; sc_policytest_t *method; scamper_ping_t *ping; sc_idset_t *set; sc_iditem_t *item; uint16_t type; void *data; int code; if(strcmp(datafile, "-") == 0) in = scamper_file_openfd(STDIN_FILENO, "-", 'r', "warts"); else in = scamper_file_open(datafile, 'r', NULL); if(in == NULL) { fprintf(stderr, "could not open %s: %s\n", datafile, strerror(errno)); goto err; } if((tree = splaytree_alloc((splaytree_cmp_t)sc_idset_cmp)) == NULL) goto err; while(scamper_file_read(in, ffilter, &type, &data) == 0) { if(data == NULL) break; ping = data; if((method = ping_to_method(ping)) == NULL) goto err; code = ping_r(method, ping); if((set = sc_idset_get(tree, ping->userid)) == NULL) goto err; set->tests |= (1 << (method->id-1)); if((item = sc_iditem_get(set, ping->dst)) == NULL) goto err; item->tests |= (1 << (method->id-1)); if(code == 1) item->results |= (1 << (method->id-1)); scamper_ping_free(ping); } scamper_file_close(in); splaytree_inorder(tree, sc_idset_print_cb, NULL); splaytree_free(tree, (splaytree_free_t)sc_idset_free); return 0; err: return -1; } static int fp_init(void) { uint16_t type; if(flags & FLAG_TRACEROUTE) type = SCAMPER_FILE_OBJ_TRACE; else type = SCAMPER_FILE_OBJ_PING; if((ffilter = scamper_file_filter_alloc(&type, 1)) == NULL) return -1; return 0; } static void cleanup(void) { if(n2i_tree != NULL) splaytree_free(n2i_tree, NULL); if(n2i_list != NULL) slist_free(n2i_list); if(waiting != NULL) heap_free(waiting, free); if(scamper_wb != NULL) scamper_writebuf_free(scamper_wb); if(scamper_lp != NULL) scamper_linepoll_free(scamper_lp, 0); if(decode_wb != NULL) scamper_writebuf_free(decode_wb); if(outfile != NULL) scamper_file_close(outfile); if(decode_in != NULL) scamper_file_close(decode_in); if(ffilter != NULL) scamper_file_filter_free(ffilter); if(logfile != NULL) fclose(logfile); close(decode_in_fd); close(decode_out_fd); close(scamper_fd); return; } int main(int argc, char *argv[]) { #if defined(DMALLOC) free(malloc(1)); #endif atexit(cleanup); if(check_options(argc, argv) != 0) return -1; /* start a daemon if asked to */ if((options & OPT_DAEMON) != 0 && daemon(1, 0) != 0) return -1; if(fp_init() != 0) return -1; if(options & OPT_READ) return fp_read(); return fp_data(); } scamper-cvs-20171204/utils/sc_filterpolicy/Makefile.in000644 001751 000000 00000061423 13211200063 022504 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_filterpolicy$(EXEEXT) subdir = utils/sc_filterpolicy ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_filterpolicy_OBJECTS = sc_filterpolicy.$(OBJEXT) \ ../../utils.$(OBJEXT) ../../mjl_heap.$(OBJEXT) \ ../../mjl_list.$(OBJEXT) ../../mjl_splaytree.$(OBJEXT) \ ../../scamper/scamper_linepoll.$(OBJEXT) \ ../../scamper/scamper_writebuf.$(OBJEXT) sc_filterpolicy_OBJECTS = $(am_sc_filterpolicy_OBJECTS) sc_filterpolicy_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_filterpolicy_SOURCES) DIST_SOURCES = $(sc_filterpolicy_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_filterpolicy_SOURCES = \ sc_filterpolicy.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c sc_filterpolicy_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_filterpolicy.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_filterpolicy/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_filterpolicy/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_heap.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_splaytree.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../scamper/$(am__dirstamp): @$(MKDIR_P) ../../scamper @: > ../../scamper/$(am__dirstamp) ../../scamper/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../scamper/$(DEPDIR) @: > ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_linepoll.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_writebuf.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) sc_filterpolicy$(EXEEXT): $(sc_filterpolicy_OBJECTS) $(sc_filterpolicy_DEPENDENCIES) $(EXTRA_sc_filterpolicy_DEPENDENCIES) @rm -f sc_filterpolicy$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_filterpolicy_OBJECTS) $(sc_filterpolicy_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) -rm -f ../../scamper/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_heap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_splaytree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_linepoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_writebuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_filterpolicy.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) -rm -f ../../scamper/$(DEPDIR)/$(am__dirstamp) -rm -f ../../scamper/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_bdrmap/.cvsignore000644 001751 000000 00000000053 13146643166 021215 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_bdrmap scamper-cvs-20171204/utils/sc_bdrmap/Makefile.am000644 001751 000000 00000000546 12760375344 021261 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_bdrmap sc_bdrmap_SOURCES = \ sc_bdrmap.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c \ ../../mjl_prefixtree.c sc_bdrmap_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_bdrmap.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_bdrmap/sc_bdrmap.1000644 001751 000000 00000022473 13026714745 021242 0ustar00mjlwheel000000 000000 .\" .\" sc_bdrmap.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2016 The University of Waikato .\" All rights reserved .\" .\" $Id: sc_bdrmap.1,v 1.4 2016/12/22 09:16:21 mjl Exp $ .\" .Dd December 22, 2016 .Dt SC_BDRMAP 1 .Os .Sh NAME .Nm sc_bdrmap .Nd scamper driver to map first hop border routers of networks .Sh SYNOPSIS .Nm .Bk -words .Op Fl 6ADi .Op Fl a Ar ip2as-file .Op Fl c Ar allyconf .Op Fl f Ar firsthop .Op Fl l Ar log-file .Op Fl o Ar output-file .Op Fl O Ar option .Op Fl p Ar port .Op Fl U Ar unix .Op Fl R Ar unix .Op Fl v Ar vpases .Op Fl x Ar ixp-file .Ek .Pp .Nm .Bk -words .Op Fl 6 .Op Fl a Ar ip2as-file .Op Fl d Ar dump .Op Fl g Ar delegated-file .Op Fl n Ar names-file .Op Fl r Ar relationships-file .Op Fl v Ar vpases .Op Fl x Ar ixp-file .Op Ar .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility provides the ability to connect to a running .Xr scamper 1 instance and use it to map the first hop border routers of networks using the "bdrmap" technique. .Nm uses targeted traceroutes, alias resolution techniques, knowledge of traceroute idiosyncrasies, and codification of topologicial constraints in a structured set of constraints, to correctly identify interdomain links at the granularity of individual border routers. .Nm operates in two distinct modes: data collection, and data analysis. .Pp In the data collection mode, .Nm uses Paris traceroute with ICMP-echo probes to trace the paths towards every distinct address block, using a stop-set to avoid re-probing portions of paths that do not provide useful constraints for the first hop border routers, as well as alias resolution techniques (Mercator, Ally, Prefixscan, and the Too-Big-Trick) to collapse the interface graph into a router-level topology. .Nm will also use probes with the record-route and pre-specified timestamp IP-level options to collect additional information on the return path from a router, where the probes are usable. .Pp In the data analysis mode, .Nm uses the collected data to infer a router-level topology of the hosting network and the interconnecting routers belonging to the hosting network's neighbors. .Pp The supported options to .Nm are as follows: .Bl -tag -width Ds .It Fl 6 specifies that .Nm should infer IPv6 border routers, and that the input files are for the IPv6 topology. This feature is currently work in progress. .It Fl a Ar ip2as-file specifies the IP prefix to Autonomous System (AS) mapping file that .Nm should use when collecting and analysing topology data. See the examples section for a description of how this file must be formatted. .It Fl A specifies the AS numbers (ASNs) that .Nm should collect data towards. This option is useful for testing and debugging. .It Fl c Ar allyconf specifies the number of times that .Nm should repeat pair-wise alias inferences that were made implying a central shared IP-ID counter. By default, each pair of aliases is tested five additional times at 5 minute intervals because two IP addresses belonging to two different routers could happen to return IP-ID values that imply a central shared IP-ID counter. .It Fl d Ar dump specifies the dump ID to use to analyze the collected data. Currently, ID values 1 (routers) and 2 (traces) are valid, which dumps inferred routers and annotated traceroute paths, respectively. .It Fl D causes .Nm to detach and become a daemon. .It Fl f Ar firsthop specifies the first hop in a traceroute path that .Nm should begin at when collecting traceroute paths. If .Nm is being run behind a NAT router, the private IP address of that router is uninteresting, and this option allows that hop to be skipped. .It Fl g Ar delegated-file specifies an IP address delegations file that can be provided to .Nm to allow inferences in the analysis phase of who operates unrouted IP address space. .It Fl i specifies the IP addresses that .Nm should collect data towards. This option is useful for testing and debugging. .It Fl l Ar log-file specifies the name of a file to log progress output from .Nm generated at run time. .It Fl n Ar names-file specifies the name of a file containing IP address to domain name system names. .It Fl o Ar output-file specifies the name of the output file to be written during the data collection phase. The output file will use the .Xr warts 5 format. .It Fl O Ar option allows the behavior of .Nm to be further tailored. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy dumpborders: only dump inferred border routers, not all VP routers. .It .Sy dumponedsts: further annotate routers that were only observed towards one AS. .It .Sy dumptracesets: dump the traceroutes observed towards networks where no topology was observed to be routed by a neighbor network. .It .Sy impatient: probe the destination ASes in order of number of address blocks, so that the probing will complete fastest. .It .Sy nogss: do not use a global stop set when collecting topology. .It .Sy noipopts: do not probe with IP record route and IP prespecified timestamp options. .It .Sy nomerge: do not analytically merge IP interfaces to routers based on common adjacent neighbor routers. .It .Sy noself: do not report links to other routers operated by the network hosting the vantage point. .It .Sy randomdst: probe a random address in each address block, rather than the first. .El .It Fl p Ar port specifies the port on the local host where .Xr scamper 1 is accepting control socket connections. .It Fl r Ar relationships-file specifies the AS relationships file which is used in the analysis phase to reason about who owns each router in the observed topology. .It Fl R Ar unix specifies the name of a unix domain socket where a remote .Xr scamper 1 instance is accepting remote control socket connections. .It Fl U Ar unix specifies the name of a unix domain socket where a local .Xr scamper 1 instance is accepting control socket connections. .It Fl v Ar vpases specifies the name of a file, or a list of ASes, that represent the network hosting the vantage point. .It Fl x Ar ixp-file specifies the name of a file that contains a list of prefixes used by an IXP to enable interconnection at their facilities. .El .Sh EXAMPLES Given a set of prefixes with origin AS in a file named ip2as.txt, a list of VP ases in vpases.txt, a list of IXP prefixes in ixp.txt, and a .Xr scamper 1 instance listening on port 31337 configured to probe at 100 packets per second started as follows: .Pp .Dl scamper -P 31337 -p 100 .Pp the following command will collect raw topology data to support inference of border routers for the network hosting the vantage point, storing raw data into bdrmap.warts, and logging run-time information into logfile1.txt: .Pp .Dl sc_bdrmap -p 31337 -o bdrmap.warts -l logfile1.txt -a ip2as.txt -v vpases.txt -x ixp.txt .Pp To infer border routers from the collected data, using the same input files as above, with a set of AS relationships contained in asrel.txt, and a set of prefix delegations assembled from the Regional Internet Registry (RIR) Statistics files in delegated.txt: .Pp .Dl sc_bdrmap -d routers -a ip2as.txt -g delegated.txt -r asrel.txt -v vpases.txt -x ixp.txt bdrmap.warts >bdrmap.routers.txt .Pp To view annotated traceroutes stored in bdrmap.warts with IP to DNS names information stored in names.txt: .Pp .Dl sc_bdrmap -d traces -a ip2as.txt -v vpases.txt -x ixp.txt -n names.txt bdrmap.wart >bdrmap.traces.txt .Pp .\"""""""""""" .Sh SEE ALSO .Xr scamper 1 , .Xr sc_ally 1 , .Xr sc_speedtrap 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2text 1 , .Xr sc_warts2json 1 .Rs .%A "M. Luckie" .%A "A. Dhamdhere" .%A "B. Huffaker" .%A "D. Clark" .%A "k. claffy" .%T "bdrmap: Inference of Borders Between IP Networks" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2016" .Re .Rs .%A "R. Govindan" .%A "H. Tangmunarunkit" .%T "Heuristics for Internet Map Discovery" .%O "Proc. IEEE INFOCOM 2000" .Re .Rs .%A "N. Spring" .%A "R. Mahajan" .%A "D. Wetherall" .%T "Measuring ISP topologies with Rocketfuel" .%O "Proc. ACM SIGCOMM 2002" .Re .Rs .%A "B. Donnet" .%A "P. Raoult" .%A "T. Friedman" .%A "M. Crovella" .%T "Efficient algorithms for large-scale topology discovery" .%O "Proc. ACM SIGMETRICS 2005" .Re .Rs .%A "B. Augustin" .%A "X. Cuvellier" .%A "B. Orgogozo" .%A "F. Viger" .%A "T. Friedman" .%A "M. Latapy" .%A "C. Magnien" .%A "R. Teixeira" .%T "Avoiding traceroute anomalies with Paris traceroute" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2006" .Re .Rs .%A "A. Bender" .%A "R. Sherwood" .%A "N. Spring" .%T "Fixing Ally's growing pains with velocity modeling" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2008" .Re .Rs .%A "M. Luckie" .%T "Scamper: a Scalable and Extensible Packet Prober for Active Measurement of the Internet" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2010" .Re .Rs .%A "R. Beverly" .%A "W. Brinkmeyer" .%A "M. Luckie" .%A "J.P. Rohrer" .%T "IPv6 Alias Resolution via Induced Fragmentation" .%O "Proc. Passive and Active Measurement Conference 2013" .Re .Rs .%A "M. Luckie" .%A "R. Beverly" .%A "W. Brinkmeyer" .%A "k claffy" .%T "Speedtrap: Internet-scale IPv6 Alias Resolution" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2013" .Re .Rs .%A "M. Luckie" .%A "B. Huffaker" .%A "A. Dhamdhere" .%A "V. Giotsas" .%A "k claffy" .%T "AS Relationships, Customer Cones, and Validation" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2013" .Re .Sh AUTHOR .Nm was written by Matthew Luckie . scamper-cvs-20171204/utils/sc_bdrmap/sc_bdrmap.c000644 001751 000000 00000603470 13130625703 021315 0ustar00mjlwheel000000 000000 /* * sc_bdrmap: driver to map first hop border routers of networks * * $Id: sc_bdrmap.c,v 1.7 2017/07/10 07:24:51 mjl Exp $ * * Matthew Luckie * mjl@caida.org / mjl@wand.net.nz * * Copyright (C) 2014-2015 The Regents of the University of California * Copyright (C) 2015-2016 The University of Waikato * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_bdrmap.c,v 1.7 2017/07/10 07:24:51 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "config.h" #include "scamper_addr.h" #include "scamper_list.h" #include "ping/scamper_ping.h" #include "trace/scamper_trace.h" #include "dealias/scamper_dealias.h" #include "scamper_file.h" #include "mjl_list.h" #include "mjl_splaytree.h" #include "mjl_heap.h" #include "mjl_prefixtree.h" #include "utils.h" /* * sc_test_t * * generic structure that can map an individual test structure to its * type. */ typedef struct sc_test { int type; void *data; } sc_test_t; /* * sc_target_t * * map an address that is currently being probed to a test. record other * tests that are blocked because of this test in the list. */ typedef struct sc_target { scamper_addr_t *addr; sc_test_t *test; slist_t *blocked; splaytree_node_t *node; } sc_target_t; /* * sc_waittest_t * * wait some time between running the specified test */ typedef struct sc_waittest { struct timeval tv; sc_test_t *test; } sc_waittest_t; /* * sc_stree * * a tree and singly linked list, holding the same items. used for * AS counts. */ typedef struct sc_stree { splaytree_t *tree; slist_t *list; } sc_stree_t; /* * sc_router_t * * collect a set of interfaces mapped to a router and assigned an owner */ typedef struct sc_router { uint32_t owner_as; uint8_t owner_reason; uint8_t ttl; /* earliest ttl router was observed */ uint8_t flags; /* annotations on the router */ slist_t *addrs; /* sc_addr2router_t belonging to this router */ dlist_t *adj; /* sc_router_t that are adjacent */ dlist_t *prev; /* sc_router_t that are backwards adjacent */ sc_stree_t *dstases; /* downstream Ases */ sc_stree_t *adjases; /* adjacent hops when addrs are not VP */ sc_stree_t *gapases; /* ASes seen after gap */ dlist_node_t *node; } sc_router_t; /* * sc_addr2router_t * * map an address to a router. */ typedef struct sc_addr2router { scamper_addr_t *addr; sc_router_t *router; void *data; uint8_t ttlexp; } sc_addr2router_t; /* * sc_routerset_t * * hold a collection of routers in the list, and a collection of * addresses in the set in the tree. */ typedef struct sc_routerset { dlist_t *list; splaytree_t *tree; } sc_routerset_t; /* * sc_asmap_t * * record all the ASes a prefix is mapped to. */ typedef struct sc_asmap { uint32_t *ases; int asc; } sc_asmap_t; /* * sc_prefix_t * * map an individual prefix to an AS or set of ASes. */ typedef struct sc_prefix { union { prefix4_t *v4; prefix6_t *v6; } pfx; sc_asmap_t *asmap; } sc_prefix_t; /* * sc_prefix_nest_t * * data structure to organise nested prefixes so that the gaps in * the prefixes can be found. */ typedef struct sc_prefix_nest { sc_prefix_t *pfx; prefixtree_t *pt; slist_t *list; } sc_prefix_nest_t; /* * sc_astraces_t * * do all traceroutes towards a given AS at approximately the same time * so that we can use a global stop set to prevent traceroute continuing * beyond the same interdomain link in subsequent traceroutes. */ typedef struct sc_astraces { sc_asmap_t *asmap; sc_stree_t *gss; slist_t *dsts; sc_stree_t *links; } sc_astraces_t; /* * sc_link_t * * a representation of an individual link between A and B. * The link may have arbitrary additional data attached. */ typedef struct sc_link { scamper_addr_t *a; scamper_addr_t *b; void *data; } sc_link_t; /* * sc_indir_t * * this structure is attached to structures that want to obtain responses * from an address X with TTL-limited probes to a given destination. */ typedef struct sc_indir { scamper_addr_t *dst; uint8_t ttl; uint16_t csum; } sc_indir_t; /* * sc_linktest_t * * this data structure is used to * - complete a prefixscan test of a given link, trying different probe * methods until it gets a useful response. * - complete a ping record route test, to see if the packet seems to * come back via the same router * - complete a ping with pre-specified timestamps, trying to get a or * ab to embed a timestamp when it returns the packet. * * the step field determines which of these three things is currently * being worked on. the method says which probe method (an index into * the probedef_str array) is currently used, and the attempt says * how many times we've tried. */ typedef struct sc_linktest { sc_link_t *link; sc_target_t *ta, *tb; /* addresses A and B for the link */ scamper_addr_t *ab; /* address that makes link pt2pt */ int step; /* step through the link test process */ int method; int attempt; } sc_linktest_t; /* * sc_ping_t * * for a given address, record the useful methods for extracting * an incrementing IPID value. */ typedef struct sc_ping { scamper_addr_t *addr; uint8_t methods[4]; sc_indir_t indir; } sc_ping_t; /* * sc_pingtest_t * */ typedef struct sc_pingtest { sc_target_t *target; /* target for ping->addr */ sc_target_t *t2; /* target for ping->indir.dst */ sc_ping_t *ping; int method; } sc_pingtest_t; typedef struct sc_ally { scamper_addr_t *a, *b; uint8_t result; } sc_ally_t; /* * sc_allytest_t * * given a set of addresses that might be aliases (based on an IP graph) * test addresses for aliases. */ typedef struct sc_allytest { sc_target_t *a, *b; int method; int attempt; slist_t *addr_list; slist_node_t *s1, *s2; sc_routerset_t *routers; } sc_allytest_t; /* * sc_allyconftest_t * * given a pair of addresses that resolved for aliases, periodically * check if their counters have diverged (until count reaches zero) */ typedef struct sc_allyconftest { sc_target_t *a, *b; sc_ally_t *ally; int method; int count; } sc_allyconftest_t; /* * sc_tracetest_t * * this data structure is used to coordinate traceroutes towards a * a given AS as the traceroute for each prefix in the AS completes. */ typedef struct sc_tracetest { sc_target_t *target; sc_astraces_t *astraces; } sc_tracetest_t; /* * sc_traceset_t * * this data structure is used to record traceroutes that might not have * crossed into a customer network */ typedef struct sc_traceset { uint32_t asn; slist_t *list; } sc_traceset_t; /* * sc_asrel_t * * record the AS relationship between a and b. -1 cust, 0 peer, 1 provider. * the relationship is stored so that the value of A is less than B. */ typedef struct sc_asrel { uint32_t a, b; int r; } sc_asrel_t; /* * sc_asc_t * * utility structure to help count the number of times something mapping * to an ASN is seen */ typedef struct sc_asc { uint32_t as; int c; } sc_asc_t; /* * sc_asmapc_t * * utility structure to count the number of times an ASMAP is seen. */ typedef struct sc_asmapc { sc_asmap_t *asmap; int c; } sc_asmapc_t; /* * sc_ixpc_t * * utility structure to count the number of times an IXP prefix is seen. * useful for counting neighbors at an IXP. */ typedef struct sc_ixpc { union { prefix4_t *v4; prefix6_t *v6; void *ptr; } pfx; int c; } sc_ixpc_t; /* * sc_prov_t * * record the providers of a given AS in a data structure so they can be * found quickly to help apply various router mapping heuristics. */ typedef struct sc_prov { uint32_t as; uint32_t *provs; int provc; } sc_prov_t; /* * sc_linkprobe_t * * this structure supplies the address, ttl, and checksum (the flow) to use * to find a given hop. */ typedef struct sc_linkprobe { scamper_addr_t *dst; uint8_t ttl; uint16_t csum; } sc_linkprobe_t; /* * sc_addr2name_t * * associate an IP address with a name */ typedef struct sc_addr2name { scamper_addr_t *addr; char *name; } sc_addr2name_t; /* * sc_delegated_t * * record entry from the set of RIR files */ typedef struct sc_delegated { struct in_addr x; struct in_addr y; } sc_delegated_t; /* * sc_addr2adj_t * * which addresses are adjacent to the specified address */ typedef struct sc_addr2adj { scamper_addr_t *addr; slist_t *list[2]; } sc_addr2adj_t; /* * sc_farrouter_t * * try and assemble likely aliases among the routers found in "nears" * based on inferred far routers observed in traceroute. */ typedef struct sc_farrouter { sc_router_t *far; slist_t *nears; } sc_farrouter_t; typedef struct sc_dump { char *descr; char *label; int (*init)(void); int (*proc_trace)(scamper_trace_t *trace); int (*proc_ping)(scamper_ping_t *ping); int (*proc_dealias)(scamper_dealias_t *dealias); void (*finish)(void); } sc_dump_t; static int init_1(void); static int process_1_trace(scamper_trace_t *); static int process_1_dealias(scamper_dealias_t *); static int process_1_ping(scamper_ping_t *); static void finish_1(void); static int process_2_trace(scamper_trace_t *); #define SC_ROUTER_OWNER_NONE 0 #define SC_ROUTER_OWNER_FIRST 1 #define SC_ROUTER_OWNER_TRACESET 2 #define SC_ROUTER_OWNER_PROVIDER 3 #define SC_ROUTER_OWNER_PEER 4 #define SC_ROUTER_OWNER_CUSTOMER 5 #define SC_ROUTER_OWNER_IP2AS 6 #define SC_ROUTER_OWNER_HIDDENPEER 7 #define SC_ROUTER_OWNER_COUNT 8 #define SC_ROUTER_OWNER_GRAPH 9 #define SC_ROUTER_OWNER_NOIP2AS 10 #define SC_ROUTER_OWNER_THIRDPARTY 11 #define SC_ROUTER_OWNER_IXP 12 #define SC_ROUTER_OWNER_ONENET 13 #define SC_ROUTER_OWNER_MISSING 14 #define SC_ROUTER_OWNER_FIRST2 15 #define SC_ROUTER_OWNER_COUNT2 16 #define SC_ROUTER_OWNER_COUNT3 17 #define SC_ROUTER_OWNER_THIRDPARTY2 18 #define SC_ROUTER_OWNER_ONENET2 19 #define SC_ROUTER_OWNER_SILENT 20 #define SC_ROUTER_OWNER_ICMP 21 #define SC_ROUTER_FLAG_FIRST 0x01 #define SC_ROUTER_FLAG_MERGED 0x02 #define SC_ROUTER_FLAG_VISITED 0x04 static const char *owner_reasonstr[] = { "none", "first", "traceset", "provider", "peer", "customer", "ip2as", "hidden-peer", "count", "graph", "noip2as", "thirdparty", "ixp", "onenet", "missing", "first2", "count2", "count3", "thirdparty2", "onenet2", "silent", "icmp", }; static uint32_t options = 0; static char *unix_name = NULL; static unsigned int port = 0; static uint8_t firsthop = 1; static prefixtree_t *ip2as_pt = NULL; static char *ip2as_fn = NULL; static splaytree_t *ip2name_tree = NULL; static char *ip2name_fn = NULL; static prefixtree_t *ixp_pt = NULL; static char *ixp_fn = NULL; static char *outfile_fn = NULL; static char *relfile_fn = NULL; static char *logfile_fn = NULL; static FILE *logfile = NULL; static slist_t *prefixes = NULL; static scamper_file_filter_t *ffilter = NULL; static scamper_file_t *outfile = NULL; static splaytree_t *targets = NULL; static splaytree_t *links = NULL; static splaytree_t *pings = NULL; static splaytree_t *allys = NULL; static splaytree_t *tracesets = NULL; static slist_t *virgin = NULL; static heap_t *waiting = NULL; static splaytree_t *asmaptree = NULL; static splaytree_t *reltree = NULL; static splaytree_t *provtree = NULL; static char *delegated_fn = NULL; static slist_t *delegated = NULL; static slist_t *held = NULL; static sc_routerset_t *rtrset = NULL; static uint32_t *vpas = NULL; static int vpasc = 0; static uint32_t *targetas = NULL; static int targetasc = 0; static char *vpas_str = NULL; static char **opt_args = NULL; static int opt_argc = 0; static int scamper_fd = -1; static char *readbuf = NULL; static size_t readbuf_len = 0; static int data_left = 0; static scamper_file_t *decode_in = NULL; static int decode_in_fd = -1; static int decode_out_fd = -1; static int more = 0; static int probing = 0; static int waittime = 0; static int attempts = 5; static int random_dst = 0; static int impatient = 0; static int allyconf = 5; static int allyconf_wait = 60 * 5; static int dump_borders = 0; static int dump_onedsts = 0; static int dump_tracesets = 0; static int no_ipopts = 0; static int no_gss = 0; static int no_self = 0; static int no_merge = 0; static int fudge = 5000; static int af = AF_INET; static struct timeval now; static char cmd[32768]; static int dump_id = 0; static const sc_dump_t dump_funcs[] = { {NULL, NULL, NULL, NULL}, {"infer border routers", "routers", init_1, process_1_trace, process_1_ping, process_1_dealias, finish_1}, {"dump annotated traceroutes", "traces", NULL, process_2_trace, NULL, NULL, NULL}, }; static int dump_funcc = sizeof(dump_funcs) / sizeof(sc_dump_t); typedef void (*sc_stree_free_t)(void *ptr); #define OPT_IP2AS 0x000001 #define OPT_OUTFILE 0x000002 #define OPT_LOGFILE 0x000004 #define OPT_PORT 0x000008 #define OPT_UNIX 0x000010 #define OPT_DAEMON 0x000020 #define OPT_VPASES 0x000040 #define OPT_RELFILE 0x000080 #define OPT_FIRSTHOP 0x000100 #define OPT_IPV6 0x000200 #define OPT_DUMP 0x000400 #define OPT_OPTIONS 0x000800 #define OPT_IXPFILE 0x001000 #define OPT_HELP 0x002000 #define OPT_NAMEFILE 0x004000 #define OPT_TARGETIPS 0x008000 #define OPT_TARGETASES 0x010000 #define OPT_REMOTE 0x020000 #define OPT_ALLYCONF 0x040000 #define OPT_DELEGATED 0x080000 #define TEST_TRACE 0x00 #define TEST_LINK 0x01 #define TEST_PING 0x02 #define TEST_ALLY 0x03 #define TEST_ALLYCONF 0x04 #define TEST_LINK_PREFIXSCAN 0x00 #define TEST_LINK_RR 0x01 #define TEST_LINK_PSTS 0x02 /* * types of IPID behavior classified */ #define IPID_NONE 0 #define IPID_INCR 1 #define IPID_RAND 2 #define IPID_ECHO 3 #define IPID_CONST 4 #define IPID_UNRESP 5 /* * alias resolution probe types and their preference. * prefer icmp echo because it is benign. * prefer tcp to udp because it returns fewer false negatives --shared * counter held centrally (TCP) vs held on line card (UDP) on some routers. */ #define METHOD_ICMP 0 #define METHOD_TCP 1 #define METHOD_UDP 2 #define METHOD_INDIR 3 #define METHOD_PFXS_LAST METHOD_UDP #define METHOD_ALLY_LAST METHOD_INDIR /* * the prefix size ranges that are allowed. in v4, we consider a prefix * valid if it is >= 8 && <= 24. in v6, >= 19 && <= 48. */ #define IPV4_PREFIX_MIN 8 #define IPV4_PREFIX_MAX 24 #define IPV6_PREFIX_MIN 19 #define IPV6_PREFIX_MAX 48 static void usage(uint32_t opts) { int i; fprintf(stderr, "usage: sc_bdrmap [-6ADi] [-a ip2as] [-c allyconf] [-f firsthop]\n" " [-l log] [-o warts] [-O option] [-p port] [-U unix]\n" " [-R unix] [-v vpases] [-x ixps]\n" "\n" " sc_bdrmap [-6] [-a ip2as] [-d dump] [-g delegated] [-n names]\n" " [-r rels] [-v vpases] [-x ixps] file1 .. fileN\n"); if(opts == 0) { fprintf(stderr, "\n sc_bdrmap -?\n\n"); return; } fprintf(stderr, "\n"); if(opts & OPT_DAEMON) fprintf(stderr, " -D: become a daemon\n"); if(opts & OPT_IPV6) fprintf(stderr, " -6: input files are IPv6\n"); if(opts & OPT_IP2AS) fprintf(stderr, " -a: ip2as file\n"); if(opts & OPT_TARGETASES) fprintf(stderr, " -A: map interconnections towards specified ASes\n"); if(opts & OPT_ALLYCONF) fprintf(stderr, " -c: how many times to confirm alias inference\n"); if(opts & OPT_DUMP) { fprintf(stderr, " -d: dump id\n"); for(i=1; i dump_funcc) { usage(OPT_DUMP); return -1; } dump_id = lo; } else { for(x=1; x 10) { usage(OPT_ALLYCONF); return -1; } allyconf = lo; } if(options & OPT_FIRSTHOP) { if(string_tolong(opt_firsthop, &lo) != 0 || lo < 1 || lo > 4) { usage(OPT_FIRSTHOP); return -1; } firsthop = lo; } if((options & (OPT_TARGETIPS|OPT_TARGETASES))==(OPT_TARGETIPS|OPT_TARGETASES)) { usage(OPT_TARGETIPS|OPT_TARGETASES); return -1; } if(options & OPT_TARGETIPS) { if(opt_argc < 1) { usage(OPT_TARGETIPS); return -1; } } if(options & OPT_TARGETASES) { if(opt_argc < 1) { usage(OPT_TARGETASES); return -1; } } if((options & OPT_OUTFILE) == 0) { usage(OPT_OUTFILE); return -1; } if((options & (OPT_PORT|OPT_REMOTE|OPT_UNIX)) == 0 || ((options & (OPT_PORT|OPT_REMOTE|OPT_UNIX)) != OPT_PORT && (options & (OPT_PORT|OPT_REMOTE|OPT_UNIX)) != OPT_REMOTE && (options & (OPT_PORT|OPT_REMOTE|OPT_UNIX)) != OPT_UNIX)) { usage(OPT_PORT|OPT_REMOTE|OPT_UNIX); return -1; } if(options & OPT_PORT) { if(string_tolong(opt_port, &lo) != 0 || lo < 1 || lo > 65535) { usage(OPT_PORT); return -1; } port = lo; } else { unix_name = opt_unix; } if(logfile_fn != NULL && (logfile = fopen(logfile_fn, "w")) == NULL) { usage(OPT_LOGFILE); fprintf(stderr, "could not open %s\n", logfile_fn); return -1; } return 0; } static int tree_to_slist(void *ptr, void *entry) { if(slist_tail_push((slist_t *)ptr, entry) != NULL) return 0; return -1; } static void logerr(char *format, ...) { va_list ap; char msg[131072]; if((options & OPT_DAEMON) && logfile == NULL) return; va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); if((options & OPT_DAEMON) == 0) fprintf(stderr, "%s", msg); if(logfile != NULL) { fprintf(logfile, "%ld: %s", (long int)now.tv_sec, msg); fflush(logfile); } return; } static void logprint(char *format, ...) { va_list ap; char msg[131072]; if((options & OPT_DAEMON) && logfile == NULL) return; va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); if((options & OPT_DAEMON) == 0) printf("%s", msg); if(logfile != NULL) { fprintf(logfile, "%ld: %s", (long int)now.tv_sec, msg); fflush(logfile); } return; } static char *class_tostr(char *str, size_t len, uint8_t class) { char *ptr; switch(class) { case IPID_NONE: ptr = "none"; break; case IPID_INCR: ptr = "incr"; break; case IPID_RAND: ptr = "rand"; break; case IPID_ECHO: ptr = "echo"; break; case IPID_CONST: ptr = "const"; break; case IPID_UNRESP: ptr = "unresp"; break; default: snprintf(str, len, "class %d", class); return str; } snprintf(str, len, "%s", ptr); return str; } static int uint32_find(const uint32_t *ptr, int c, uint32_t x) { int i; for(i=0; i= 0) return 0; if(realloc_wrap((void **)&a, sizeof(uint32_t) * (*c + 1)) != 0) return -1; a[*c] = x; *ptr = a; *c = *c + 1; return 0; } static int uint32_cmp(const void *va, const void *vb) { const uint32_t a = *((const uint32_t *)va); const uint32_t b = *((const uint32_t *)vb); if(a < b) return -1; if(a > b) return 1; return 0; } static void *pt_find(prefixtree_t *pt, scamper_addr_t *addr) { prefix4_t *p4; prefix6_t *p6; if(addr->type == SCAMPER_ADDR_TYPE_IPV4) { if((p4 = prefixtree_find_ip4(pt, addr->addr)) == NULL) return NULL; return p4->ptr; } else if(addr->type == SCAMPER_ADDR_TYPE_IPV6) { if((p6 = prefixtree_find_ip6(pt, addr->addr)) == NULL) return NULL; return p6->ptr; } return NULL; } static int is_ixp(scamper_addr_t *addr) { if(ixp_pt != NULL && pt_find(ixp_pt, addr) != NULL) return 1; return 0; } static int is_reserved(scamper_addr_t *addr) { return scamper_addr_isreserved(addr); } static int is_vpas(uint32_t as) { int i; for(i=0; idst != NULL) scamper_addr_free(indir->dst); free(indir); return; } static int sc_ally_cmp(const sc_ally_t *a, const sc_ally_t *b) { int rc; if((rc = scamper_addr_cmp(a->a, b->a)) != 0) return rc; return scamper_addr_cmp(a->b, b->b); } static void sc_ally_free(sc_ally_t *a) { if(a == NULL) return; if(a->a != NULL) scamper_addr_free(a->a); if(a->b != NULL) scamper_addr_free(a->b); free(a); return; } static sc_ally_t *sc_ally_find(scamper_addr_t *a, scamper_addr_t *b) { sc_ally_t fm; int rc; rc = scamper_addr_cmp(a, b); assert(rc != 0); if(rc < 0) { fm.a = a; fm.b = b; } else { fm.a = b; fm.b = a; } return splaytree_find(allys, &fm); } static sc_ally_t *sc_ally_get(scamper_addr_t *a, scamper_addr_t *b) { sc_ally_t *ally; int rc; if((ally = sc_ally_find(a, b)) != NULL) return ally; if((ally = malloc_zero(sizeof(sc_ally_t))) == NULL) return NULL; rc = scamper_addr_cmp(a, b); if(rc < 0) { ally->a = scamper_addr_use(a); ally->b = scamper_addr_use(b); } else { ally->a = scamper_addr_use(b); ally->b = scamper_addr_use(a); } if(splaytree_insert(allys, ally) == NULL) { sc_ally_free(ally); return NULL; } return ally; } static int sc_link_cmp(const sc_link_t *a, const sc_link_t *b) { int rc; if((rc = scamper_addr_cmp(a->a, b->a)) != 0) return rc; return scamper_addr_cmp(a->b, b->b); } static sc_link_t *sc_link_find(scamper_addr_t *a, scamper_addr_t *b) { sc_link_t fm; fm.a = a; fm.b = b; return splaytree_find(links, &fm); } static void sc_link_free(sc_link_t *link) { if(link == NULL) return; if(link->a != NULL) scamper_addr_free(link->a); if(link->b != NULL) scamper_addr_free(link->b); free(link); return; } static sc_link_t *sc_link_alloc(scamper_addr_t *a, scamper_addr_t *b) { sc_link_t *link; if((link = malloc_zero(sizeof(sc_link_t))) == NULL) return NULL; link->a = scamper_addr_use(a); link->b = scamper_addr_use(b); return link; } static sc_link_t *sc_link_get(scamper_addr_t *a, scamper_addr_t *b) { sc_link_t *link; if((link = sc_link_find(a, b)) != NULL) return link; if((link = sc_link_alloc(a, b)) == NULL || splaytree_insert(links, link) == NULL) { if(link != NULL) sc_link_free(link); return NULL; } return link; } static void *sc_stree_find(sc_stree_t *set, void *item) { return splaytree_find(set->tree, item); } static int sc_stree_add(sc_stree_t *set, void *item) { assert(splaytree_find(set->tree, item) == NULL); if(slist_head_push(set->list, item) == NULL) return -1; if(splaytree_insert(set->tree, item) == NULL) { slist_head_pop(set->list); return -1; } return 0; } static void sc_stree_free(sc_stree_t *set, void (*free_func)(void *)) { if(set == NULL) return; if(set->tree != NULL) splaytree_free(set->tree, NULL); if(set->list != NULL) slist_free_cb(set->list, free_func); free(set); return; } static sc_stree_t *sc_stree_alloc(splaytree_cmp_t cmp) { sc_stree_t *set = NULL; if((set = malloc_zero(sizeof(sc_stree_t))) == NULL || (set->tree = splaytree_alloc(cmp)) == NULL || (set->list = slist_alloc()) == NULL) { sc_stree_free(set, NULL); return NULL; } return set; } static char *sc_asmap_tostr(const sc_asmap_t *asmap, char *buf, size_t len) { size_t off = 0; int i; string_concat(buf, len, &off, "%u", asmap->ases[0]); for(i=1; iasc; i++) string_concat(buf, len, &off, "_%u", asmap->ases[i]); return buf; } static void sc_asmap_free(sc_asmap_t *asmap) { if(asmap == NULL) return; if(asmap->ases != NULL) free(asmap->ases); free(asmap); return; } static int sc_asmap_cmp(const sc_asmap_t *a, const sc_asmap_t *b) { int i, m = a->asc < b->asc ? a->asc : b->asc; if(a == b) return 0; for(i=0; iases[i] < b->ases[i]) return -1; if(a->ases[i] > b->ases[i]) return 1; } if(a->asc < b->asc) return -1; if(a->asc > b->asc) return 1; return 0; } static sc_asmap_t *sc_asmap_find(uint32_t *ases, int asc) { sc_asmap_t fm; fm.ases = ases; fm.asc = asc; return splaytree_find(asmaptree, &fm); } static sc_asmap_t *sc_asmap_get(uint32_t *ases, int asc) { sc_asmap_t *map = NULL; if((map = sc_asmap_find(ases, asc)) != NULL) return map; if((map = malloc_zero(sizeof(sc_asmap_t))) == NULL || (map->ases = memdup(ases, sizeof(uint32_t) * asc)) == NULL) goto err; map->asc = asc; if(splaytree_insert(asmaptree, map) == NULL) goto err; return map; err: if(map != NULL) sc_asmap_free(map); return NULL; } static int sc_asmap_isvp(sc_asmap_t *asmap) { int i, vppref = 0; for(i=0; iasc; i++) if(is_vpas(asmap->ases[i])) vppref++; if(vppref == asmap->asc) return 1; return 0; } static void sc_asrel_free(sc_asrel_t *a) { if(a == NULL) return; free(a); return; } static int sc_asrel_cmp(const sc_asrel_t *a, const sc_asrel_t *b) { if(a->a < b->a) return -1; if(a->a > b->a) return 1; if(a->b < b->b) return -1; if(a->b > b->b) return 1; return 0; } static sc_asrel_t *sc_asrel_find(uint32_t a, uint32_t b) { sc_asrel_t fm; if(a < b) { fm.a = a; fm.b = b; } else { fm.a = b; fm.b = a; } return splaytree_find(reltree, &fm); } static int sc_asrel_r(uint32_t a, uint32_t b, int *r) { sc_asrel_t *asr; if((asr = sc_asrel_find(a, b)) == NULL) return -1; if(a < b) *r = asr->r; else *r = asr->r * -1; return 0; } static int sc_asrel_add(uint32_t a, uint32_t b, int r) { sc_asrel_t *asr; if((asr = sc_asrel_find(a, b)) != NULL) { if(a < b && asr->r != r) return -1; else if(a > b && asr->r != r * -1) return -1; return 0; } if((asr = malloc_zero(sizeof(sc_asrel_t))) == NULL) return -1; if(a < b) { asr->a = a; asr->b = b; asr->r = r; } else { asr->a = b; asr->b = a; asr->r = r * -1; } if(splaytree_insert(reltree, asr) == NULL) return -1; return 0; } static int sc_prov_cmp(const sc_prov_t *a, const sc_prov_t *b) { if(a->as < b->as) return -1; if(a->as > b->as) return 1; return 0; } static void sc_prov_free(sc_prov_t *p) { if(p == NULL) return; if(p->provs != NULL) free(p->provs); free(p); return; } static sc_prov_t *sc_prov_find(uint32_t as) { sc_prov_t fm; fm.as = as; return splaytree_find(provtree, &fm); } static sc_prov_t *sc_prov_get(uint32_t as) { sc_prov_t *p; if((p = sc_prov_find(as)) != NULL) return p; if((p = malloc_zero(sizeof(sc_prov_t))) == NULL) return NULL; p->as = as; if(splaytree_insert(provtree, p) == NULL) { free(p); return NULL; } return p; } /* * sc_prov_add * * B is a provider for A. make a note of that. */ static int sc_prov_add(uint32_t a, uint32_t b) { sc_prov_t *p; if((p = sc_prov_get(a)) == NULL) return -1; if(uint32_add(&p->provs, &p->provc, b) != 0) return -1; return 0; } static int vp_r(uint32_t peer, uint32_t *sib_as, int *r) { int custc = 0, peerc = 0, provc = 0; uint32_t custas, peeras, provas; int i, rl; for(i=0; i 0) { *r = 1; if(sib_as != NULL) *sib_as = provas; return 0; } else if(peerc > 0 && custc == 0) { *r = 0; if(sib_as != NULL) *sib_as = peeras; return 0; } else if(custc > 0 && peerc == 0) { *r = -1; if(sib_as != NULL) *sib_as = custas; return 0; } return -1; } static int asmap_r(sc_asmap_t *peer, uint32_t *sib, uint32_t *neigh, int *r) { int custc = 0, peerc = 0, provc = 0; uint32_t cust_sib, cust_neigh, peer_sib, peer_neigh, prov_sib, prov_neigh; int i, j, rl; if(peer->asc == 1) { if(is_vpas(peer->ases[0])) return -1; for(i=0; iases[0], r) == 0) { *sib = vpas[i]; *neigh = peer->ases[0]; return 0; } } } else { for(i=0; iasc; j++) { if(is_vpas(peer->ases[j])) continue; if(sc_asrel_r(vpas[i], peer->ases[j], &rl) != 0) continue; if(rl == -1) { if(custc == 0) { cust_sib = vpas[i]; cust_neigh = peer->ases[j]; } custc++; } else if(rl == 0) { if(peerc == 0) { peer_sib = vpas[i]; peer_neigh = peer->ases[j]; } peerc++; } else { if(provc == 0) { prov_sib = vpas[i]; prov_neigh = peer->ases[j]; } provc++; } } } if(provc > 0) { *r = 1; *sib = prov_sib; *neigh = prov_neigh; return 0; } else if(peerc > 0 && custc == 0) { *r = 0; *sib = peer_sib; *neigh = peer_neigh; return 0; } else if(custc > 0 && peerc == 0) { *r = -1; *sib = cust_sib; *neigh = cust_neigh; return 0; } } return -1; } static sc_test_t *sc_test_alloc(int type, void *data) { sc_test_t *test; if((test = malloc_zero(sizeof(sc_test_t))) == NULL) { fprintf(stderr, "could not malloc test\n"); return NULL; } test->type = type; test->data = data; return test; } static void sc_test_free(sc_test_t *test) { if(test != NULL) free(test); return; } static int sc_waittest_cmp(const void *va, const void *vb) { const sc_waittest_t *a = va; const sc_waittest_t *b = vb; return timeval_cmp(&b->tv, &a->tv); } static int sc_waittest_sec(sc_test_t *test, int sec) { sc_waittest_t *wt; if((wt = malloc_zero(sizeof(sc_waittest_t))) == NULL) return -1; timeval_add_s(&wt->tv, &now, sec); wt->test = test; if(heap_insert(waiting, wt) == NULL) { free(wt); return -1; } return 0; } static int sc_waittest(sc_test_t *test) { return sc_waittest_sec(test, waittime); } static void sc_target_detach(sc_target_t *tg) { sc_test_t *test; char buf[128]; if(tg == NULL) return; if(tg->node != NULL) { if(splaytree_remove_node(targets, tg->node) != 0) { logerr("%s: could not remove %s from tree\n", __func__, scamper_addr_tostr(tg->addr, buf, sizeof(buf))); } tg->node = NULL; } if(tg->blocked != NULL) { while((test = slist_head_pop(tg->blocked)) != NULL) sc_waittest(test); slist_free(tg->blocked); tg->blocked = NULL; } return; } static void sc_target_free(sc_target_t *tg) { if(tg == NULL) return; sc_target_detach(tg); if(tg->addr != NULL) scamper_addr_free(tg->addr); free(tg); return; } static int sc_target_cmp(const sc_target_t *a, const sc_target_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static sc_target_t *sc_target_alloc(scamper_addr_t *addr) { sc_target_t *tg = NULL; if((tg = malloc_zero(sizeof(sc_target_t))) == NULL) { fprintf(stderr, "could not malloc target\n"); return NULL; } tg->addr = scamper_addr_use(addr); return tg; } static int sc_target_block(sc_target_t *target, sc_test_t *block) { if(target->blocked == NULL && (target->blocked = slist_alloc()) == NULL) { fprintf(stderr, "could not alloc target->blocked list\n"); return -1; } if(slist_tail_push(target->blocked, block) == NULL) { fprintf(stderr, "could not add test to blocked list\n"); return -1; } return 0; } static sc_target_t *sc_target_find(sc_target_t *target) { return splaytree_find(targets, target); } static sc_target_t *sc_target_findaddr(scamper_addr_t *addr) { sc_target_t findme; findme.addr = addr; return sc_target_find(&findme); } static int sc_target_add(sc_target_t *target) { char buf[128]; assert(target->node == NULL); assert(target->test != NULL); if((target->node = splaytree_insert(targets, target)) == NULL) { logerr("%s: could not add %s to tree\n", __func__, scamper_addr_tostr(target->addr, buf, sizeof(buf))); return -1; } return 0; } static int sc_prefix_cmp(const sc_prefix_t *a, const sc_prefix_t *b) { if(a == b) return 0; if(af == AF_INET) return prefix4_cmp(a->pfx.v4, b->pfx.v4); return prefix6_cmp(a->pfx.v6, b->pfx.v6); } static void sc_prefix_free(sc_prefix_t *p) { if(p == NULL) return; if(af == AF_INET) { if(p->pfx.v4 != NULL) prefix4_free(p->pfx.v4); } else { if(p->pfx.v6 != NULL) prefix6_free(p->pfx.v6); } free(p); return; } static sc_prefix_t *sc_prefix_alloc(void *net, int len) { sc_prefix_t *p; if((p = malloc_zero(sizeof(sc_prefix_t))) == NULL) goto err; if(af == AF_INET) { if((p->pfx.v4 = prefix4_alloc(net, len, p)) == NULL) goto err; } else { if((p->pfx.v6 = prefix6_alloc(net, len, p)) == NULL) goto err; } return p; err: sc_prefix_free(p); return NULL; } static sc_prefix_t *sc_prefix_find_in(void *addr) { prefix4_t *p4; prefix6_t *p6; if(af == AF_INET) { if((p4 = prefixtree_find_ip4(ip2as_pt, addr)) != NULL) return p4->ptr; } else if(af == AF_INET6) { if((p6 = prefixtree_find_ip6(ip2as_pt, addr)) != NULL) return p6->ptr; } return NULL; } static sc_prefix_t *sc_prefix_find(scamper_addr_t *addr) { if(scamper_addr_isreserved(addr) != 0) return NULL; if(ixp_pt != NULL && pt_find(ixp_pt, addr) != NULL) return NULL; return pt_find(ip2as_pt, addr); } static void sc_prefix_nest_free(sc_prefix_nest_t *nest) { if(nest == NULL) return; if(nest->list != NULL) slist_free_cb(nest->list, (slist_free_t)sc_prefix_nest_free); if(nest->pt != NULL) { if(af == AF_INET) prefixtree_free_cb(nest->pt, (prefix_free_t)prefix4_free); else prefixtree_free_cb(nest->pt, (prefix_free_t)prefix6_free); } free(nest); return; } static sc_prefix_nest_t *sc_prefix_nest_alloc(sc_prefix_t *pfx) { sc_prefix_nest_t *nest; if((nest = malloc_zero(sizeof(sc_prefix_nest_t))) == NULL) return NULL; nest->pfx = pfx; return nest; } static int sc_prefix_nest_cmp(const sc_prefix_nest_t *a, const sc_prefix_nest_t *b) { return sc_prefix_cmp(a->pfx, b->pfx); } static int sc_ixpc_pfx_cmp(const sc_ixpc_t *a, const sc_ixpc_t *b) { if(af == AF_INET) return prefix4_cmp(a->pfx.v4, b->pfx.v4); return prefix6_cmp(a->pfx.v6, b->pfx.v6); } static int sc_ixpc_c_cmp(const sc_ixpc_t *a, const sc_ixpc_t *b) { if(a->c > b->c) return -1; if(a->c < b->c) return 1; return 0; } static sc_ixpc_t *sc_ixpc_find(sc_stree_t *set, scamper_addr_t *addr) { sc_ixpc_t fm; if(ixp_pt == NULL) return NULL; fm.pfx.ptr = pt_find(ixp_pt, addr); assert(fm.pfx.ptr != NULL); return sc_stree_find(set, &fm); } static sc_ixpc_t *sc_ixpc_get(sc_stree_t *set, scamper_addr_t *addr) { sc_ixpc_t *pfxc; if(ixp_pt == NULL) return NULL; if((pfxc = sc_ixpc_find(set, addr)) != NULL) return pfxc; if((pfxc = malloc_zero(sizeof(sc_ixpc_t))) == NULL) return NULL; pfxc->pfx.ptr = pt_find(ixp_pt, addr); if(sc_stree_add(set, pfxc) != 0) { free(pfxc); return NULL; } return pfxc; } /* * is_vp: * * infer if the address belongs to the VP. * return 0 if it does not, 1 if it does, and 2 if we don't know. */ static int is_vp(scamper_addr_t *addr) { sc_prefix_t *pfx; if(is_ixp(addr) != 0 || (pfx = sc_prefix_find(addr)) == NULL) return 2; return sc_asmap_isvp(pfx->asmap); } static void sc_tracetest_free(sc_tracetest_t *tt) { if(tt == NULL) return; if(tt->target != NULL) sc_target_free(tt->target); free(tt); return; } static sc_tracetest_t *sc_tracetest_alloc(scamper_addr_t *addr) { sc_tracetest_t *tt; sc_test_t *test; if((tt = malloc_zero(sizeof(sc_tracetest_t))) == NULL || (tt->target = sc_target_alloc(addr)) == NULL || (test = sc_test_alloc(TEST_TRACE, tt)) == NULL) goto err; tt->target->test = test; return tt; err: if(tt != NULL) sc_tracetest_free(tt); return NULL; } static void sc_linktest_free(sc_linktest_t *lt) { if(lt == NULL) return; if(lt->ta != NULL) sc_target_free(lt->ta); if(lt->tb != NULL) sc_target_free(lt->tb); if(lt->ab != NULL) scamper_addr_free(lt->ab); free(lt); return; } static int sc_linktest_alloc(scamper_addr_t *a, scamper_addr_t *b) { sc_link_t *link; sc_linktest_t *lt; sc_test_t *test; /* the two addresses should not be the same */ assert(scamper_addr_cmp(a, b) != 0); /* if the link has already been tested, there is nothing more to be done */ if(sc_link_find(a, b) != NULL) return 0; if((link = sc_link_get(a, b)) == NULL || (lt = malloc_zero(sizeof(sc_linktest_t))) == NULL || (lt->ta = sc_target_alloc(a)) == NULL || (lt->tb = sc_target_alloc(b)) == NULL) return -1; lt->link = link; if((test = sc_test_alloc(TEST_LINK, lt)) == NULL || sc_waittest(test) != 0) { sc_linktest_free(lt); if(test != NULL) sc_test_free(test); return -1; } lt->ta->test = test; lt->tb->test = test; return 0; } /* * sc_ping_method * * prefer icmp echo because it is benign. * prefer tcp to udp because it returns fewer false negatives --shared * counter held centrally (TCP) vs held on line card (UDP) on some routers. */ static int sc_ping_method(const sc_ping_t *a, const sc_ping_t *b, int *meth) { int i; for(i=0; i<4; i++) { if(a->methods[i] == IPID_INCR && b->methods[i] == IPID_INCR) { *meth = i; return 0; } } return -1; } static int sc_ping_cmp(const sc_ping_t *a, const sc_ping_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static sc_ping_t *sc_ping_find(scamper_addr_t *addr) { sc_ping_t fm; fm.addr = addr; return splaytree_find(pings, &fm); } static sc_ping_t *sc_ping_alloc(scamper_addr_t *addr) { sc_ping_t *ping; if((ping = malloc_zero(sizeof(sc_ping_t))) == NULL) return NULL; ping->addr = scamper_addr_use(addr); return ping; } static void sc_ping_free(sc_ping_t *ping) { if(ping == NULL) return; if(ping->addr != NULL) scamper_addr_free(ping->addr); if(ping->indir.dst != NULL) scamper_addr_free(ping->indir.dst); free(ping); return; } static void sc_pingtest_free(sc_pingtest_t *pt) { if(pt == NULL) return; if(pt->target != NULL) sc_target_free(pt->target); if(pt->t2 != NULL) sc_target_free(pt->t2); free(pt); return; } static sc_test_t *sc_pingtest_alloc(scamper_addr_t *addr) { sc_pingtest_t *pt; sc_ping_t *ping; sc_test_t *test; if((ping = sc_ping_find(addr)) == NULL) { if((ping = sc_ping_alloc(addr)) == NULL) return NULL; if(splaytree_insert(pings, ping) == NULL) { sc_ping_free(ping); return NULL; } } if((pt = malloc_zero(sizeof(sc_pingtest_t))) == NULL || (pt->target = sc_target_alloc(addr)) == NULL) { if(pt != NULL) sc_pingtest_free(pt); return NULL; } pt->ping = ping; if((test = sc_test_alloc(TEST_PING, pt)) == NULL) { sc_pingtest_free(pt); return NULL; } pt->target->test = test; return test; } static void sc_asmapc_free(sc_asmapc_t *a) { if(a == NULL) return; free(a); return; } static int sc_asmapc_as_cmp(const sc_asmapc_t *a, const sc_asmapc_t *b) { return sc_asmap_cmp(a->asmap, b->asmap); } static int sc_asmapc_c_cmp(const sc_asmapc_t *a, const sc_asmapc_t *b) { if(a->c > b->c) return -1; if(a->c < b->c) return 1; return 0; } static sc_asmapc_t *sc_asmapc_find(sc_stree_t *set, sc_asmap_t *asmap) { sc_asmapc_t fm; fm.asmap = asmap; return sc_stree_find(set, &fm); } #ifndef DMALLOC static sc_asmapc_t *sc_asmapc_get(sc_stree_t *set, sc_asmap_t *asmap) #else #define sc_asmapc_get(set,asmap) sc_asmapc_get_dm((set),(asmap),__FILE__,__LINE__) static sc_asmapc_t *sc_asmapc_get_dm(sc_stree_t *set, sc_asmap_t *asmap, const char *file, const int line) #endif { sc_asmapc_t *asmapc; if((asmapc = sc_asmapc_find(set, asmap)) != NULL) return asmapc; #ifndef DMALLOC if((asmapc = malloc_zero(sizeof(sc_asmapc_t))) == NULL) return NULL; #else if((asmapc = malloc_zero_dm(sizeof(sc_asmapc_t), file, line)) == NULL) return NULL; #endif asmapc->asmap = asmap; if(sc_stree_add(set, asmapc) != 0) { free(asmapc); return NULL; } return asmapc; } static void sc_asc_free(sc_asc_t *asc) { if(asc == NULL) return; free(asc); return; } static int sc_asc_as_cmp(const sc_asc_t *a, const sc_asc_t *b) { if(a->as < b->as) return -1; if(a->as > b->as) return 1; return 0; } static int sc_asc_c_cmp(const sc_asc_t *a, const sc_asc_t *b) { if(a->c > b->c) return -1; if(a->c < b->c) return 1; return 0; } static sc_asc_t *sc_asc_find(sc_stree_t *set, uint32_t as) { sc_asc_t fm; fm.as = as; return sc_stree_find(set, &fm); } static sc_asc_t *sc_asc_get(sc_stree_t *set, uint32_t as) { sc_asc_t *asc; if((asc = sc_asc_find(set, as)) != NULL) return asc; if((asc = malloc_zero(sizeof(sc_asc_t))) == NULL) return NULL; asc->as = as; if(sc_stree_add(set, asc) != 0) { free(asc); return NULL; } return asc; } static int sc_addr2router_ttlexp_cmp(const sc_addr2router_t *a, const sc_addr2router_t *b) { if(a->ttlexp > b->ttlexp) return -1; if(a->ttlexp < b->ttlexp) return 1; return scamper_addr_human_cmp(a->addr, b->addr); } static int sc_addr2router_addr_cmp(const sc_addr2router_t *a, const sc_addr2router_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static int sc_addr2router_free_ping(void *ptr, void *entry) { sc_addr2router_t *a2r = entry; sc_ping_free(a2r->data); return 0; } static void sc_addr2router_free(sc_addr2router_t *a2r) { if(a2r == NULL) return; if(a2r->addr != NULL) scamper_addr_free(a2r->addr); free(a2r); return; } static int sc_router_p_cmp(const sc_router_t *a, const sc_router_t *b) { if(a < b) return -1; if(a > b) return 1; return 0; } static int sc_router_ttl_cmp(const sc_router_t *a, const sc_router_t *b) { if(a->ttl < b->ttl) return -1; if(a->ttl > b->ttl) return 1; return 0; } static sc_asmapc_t *sc_router_dstases_get(sc_router_t *rtr, sc_asmap_t *asmap) { if(rtr->dstases == NULL && (rtr->dstases = sc_stree_alloc((splaytree_cmp_t)sc_asmapc_as_cmp)) == NULL) return NULL; return sc_asmapc_get(rtr->dstases, asmap); } /* * sc_router_adj_add * * add an adjacency between two routers (if the adjacency is not * already recorded) */ static int sc_router_adj_add(sc_router_t *rtr, sc_router_t *adj) { dlist_node_t *dn; if(rtr->adj == NULL && (rtr->adj = dlist_alloc()) == NULL) return -1; for(dn=dlist_head_node(rtr->adj); dn != NULL; dn=dlist_node_next(dn)) if(dlist_node_item(dn) == adj) return 0; if(dlist_tail_push(rtr->adj, adj) == NULL) return -1; return 0; } /* * sc_router_prev_add * * add a backwards adjacency between two routers (if the adjacency is * not already recorded) */ static int sc_router_prev_add(sc_router_t *rtr, sc_router_t *prev) { dlist_node_t *dn; if(rtr->prev == NULL && (rtr->prev = dlist_alloc()) == NULL) return -1; for(dn=dlist_head_node(rtr->prev); dn != NULL; dn=dlist_node_next(dn)) if(dlist_node_item(dn) == prev) return 0; if(dlist_tail_push(rtr->prev, prev) == NULL) return -1; return 0; } /* * sc_router_free * */ static void sc_router_free(sc_router_t *rtr) { if(rtr == NULL) return; if(rtr->addrs != NULL) slist_free(rtr->addrs); if(rtr->adj != NULL) dlist_free(rtr->adj); if(rtr->prev != NULL) dlist_free(rtr->prev); if(rtr->dstases != NULL) sc_stree_free(rtr->dstases, (sc_stree_free_t)sc_asmapc_free); if(rtr->adjases != NULL) sc_stree_free(rtr->adjases, (sc_stree_free_t)sc_asmapc_free); if(rtr->gapases != NULL) sc_stree_free(rtr->gapases, (sc_stree_free_t)sc_asmapc_free); free(rtr); return; } static sc_router_t *sc_router_alloc(void) { sc_router_t *rtr; if((rtr = malloc_zero(sizeof(sc_router_t))) == NULL || (rtr->addrs = slist_alloc()) == NULL) { sc_router_free(rtr); return NULL; } return rtr; } static sc_addr2router_t *sc_routerset_a2r_find(sc_routerset_t *set, scamper_addr_t *a) { sc_addr2router_t fm; fm.addr = a; assert(a != NULL); return splaytree_find(set->tree, &fm); } /* * sc_routerset_a2r_add: * * given an existing router, add an interface to it. the interface * is not already associated with a router in the set. */ static sc_addr2router_t *sc_routerset_a2r_add(sc_routerset_t *set, sc_router_t *rtr, scamper_addr_t *addr) { sc_addr2router_t *a2r; if((a2r = malloc_zero(sizeof(sc_addr2router_t))) == NULL) return NULL; a2r->router = rtr; a2r->addr = scamper_addr_use(addr); if(splaytree_insert(set->tree, a2r) == NULL) { sc_addr2router_free(a2r); return NULL; } if(slist_tail_push(rtr->addrs, a2r) == NULL) return NULL; return a2r; } static sc_addr2router_t *sc_routerset_a2r_get(sc_routerset_t *set, scamper_addr_t *addr) { sc_router_t *rtr = NULL; sc_addr2router_t *a2r; if((a2r = sc_routerset_a2r_find(set, addr)) != NULL) return a2r; if((rtr = sc_router_alloc()) == NULL || (rtr->node = dlist_tail_push(set->list, rtr)) == NULL) { if(rtr != NULL) sc_router_free(rtr); return NULL; } if((a2r = sc_routerset_a2r_add(set, rtr, addr)) == NULL) return NULL; return a2r; } static sc_router_t *sc_routerset_find(sc_routerset_t *set, scamper_addr_t *a) { sc_addr2router_t *a2r; if((a2r = sc_routerset_a2r_find(set, a)) == NULL) return NULL; return a2r->router; } static sc_router_t *sc_routerset_get(sc_routerset_t *set, scamper_addr_t *a) { sc_addr2router_t *a2r; if((a2r = sc_routerset_a2r_find(set, a)) != NULL) return a2r->router; if((a2r = sc_routerset_a2r_get(set, a)) != NULL) return a2r->router; return NULL; } static sc_router_t *sc_routerset_getnull(sc_routerset_t *set) { sc_router_t *rtr = NULL; if((rtr = sc_router_alloc()) == NULL || (rtr->node = dlist_tail_push(set->list, rtr)) == NULL) goto err; return rtr; err: if(rtr != NULL) sc_router_free(rtr); return NULL; } static void sc_routerset_pop(sc_routerset_t *set, sc_router_t *r) { dlist_node_pop(set->list, r->node); r->node = NULL; return; } static void sc_routerset_free(sc_routerset_t *set) { if(set == NULL) return; if(set->list != NULL) dlist_free_cb(set->list, (dlist_free_t)sc_router_free); if(set->tree != NULL) splaytree_free(set->tree, (splaytree_free_t)sc_addr2router_free); free(set); return; } static sc_routerset_t *sc_routerset_alloc(void) { sc_routerset_t *set; if((set = malloc_zero(sizeof(sc_routerset_t))) == NULL || (set->list = dlist_alloc()) == NULL || (set->tree = splaytree_alloc((splaytree_cmp_t)sc_addr2router_addr_cmp)) == NULL) { sc_routerset_free(set); return NULL; } return set; } /* * sc_routerset_merge: * * merge two routers. shift all the addresses, adjacent hops, and * associated data from b to a. */ static int sc_routerset_merge(sc_routerset_t *set, sc_router_t *a, sc_router_t *b) { sc_addr2router_t *a2r; sc_router_t *x; dlist_node_t *dn, *dn2; /* * update the earliest ttl the router was observed, and annotations * on the router. */ if(b->ttl != 0 && (b->ttl < a->ttl || a->ttl == 0)) a->ttl = b->ttl; a->flags |= b->flags; a->flags |= SC_ROUTER_FLAG_MERGED; /* * shift the addresses from router b to router a. the addresses * are distinct to each router */ while((a2r = slist_head_pop(b->addrs)) != NULL) { a2r->router = a; if(slist_tail_push(a->addrs, a2r) == NULL) return -1; } /* * shift adjacent routers from b to a, ensuring that the router * was not already recorded as adjacent on router a. */ while((x = dlist_head_pop(b->adj)) != NULL) { for(dn = dlist_head_node(a->adj); dn != NULL; dn = dlist_node_next(dn)) if(dlist_node_item(dn) == x) break; if(dn == NULL && dlist_tail_push(a->adj, x) == NULL) return -1; } if(b->prev != NULL) { while((x = dlist_head_pop(b->prev)) != NULL) { if(sc_router_prev_add(a, x) != 0) return -1; } } /* * go through other routers that have a pointer to the router about * to be removed */ for(dn = dlist_head_node(set->list); dn != NULL; dn = dlist_node_next(dn)) { x = dlist_node_item(dn); if(x->adj != NULL) { dn2 = dlist_head_node(x->adj); while(dn2 != NULL) { if(dlist_node_item(dn2) == b) { dlist_node_pop(x->adj, dn2); break; } dn2 = dlist_node_next(dn2); } } if(x->prev != NULL) { dn2 = dlist_head_node(x->prev); while(dn2 != NULL) { if(dlist_node_item(dn2) == b) { dlist_node_pop(x->prev, dn2); break; } dn2 = dlist_node_next(dn2); } } } sc_routerset_pop(set, b); sc_router_free(b); return 0; } static sc_router_t *sc_routerset_getpair(sc_routerset_t *set, scamper_addr_t *a, scamper_addr_t *b) { sc_addr2router_t *a2r_a, *a2r_b; sc_router_t *rtr; a2r_a = sc_routerset_a2r_find(set, a); a2r_b = sc_routerset_a2r_find(set, b); if(a2r_a == NULL && a2r_b == NULL) { if((rtr = sc_routerset_get(set, a)) == NULL || sc_routerset_a2r_add(set, rtr, b) == NULL) return NULL; } else if(a2r_a != NULL && a2r_b != NULL) { rtr = a2r_a->router; if(a2r_a->router != a2r_b->router) { while((a2r_a = slist_head_pop(rtr->addrs)) != NULL) { a2r_a->router = a2r_b->router; if(slist_tail_push(a2r_b->router->addrs, a2r_a) == NULL) return NULL; } sc_routerset_pop(set, rtr); sc_router_free(rtr); rtr = a2r_b->router; } } else if(a2r_a != NULL) { rtr = a2r_a->router; if(sc_routerset_a2r_add(set, rtr, b) == NULL) return NULL; } else { rtr = a2r_b->router; if(sc_routerset_a2r_add(set, rtr, a) == NULL) return NULL; } return rtr; } static int sc_router_ttlexp_count(const sc_router_t *rtr) { sc_addr2router_t *a2r; slist_node_t *sn; int ttlexpc = 0; for(sn=slist_head_node(rtr->addrs); sn != NULL; sn=slist_node_next(sn)) { a2r = slist_node_item(sn); if(a2r->ttlexp != 0) ttlexpc++; } return ttlexpc; } /* * sc_router_ispt2pt * * for the two routers, infer if they are connected by a pt2pt link: * if we find an address x on X that is in a /30 or /31 subnet of an * y on Y, and y was observed in a ttl-expired message. */ static int sc_router_ispt2pt(const sc_router_t *x, const sc_router_t *y) { sc_addr2router_t *a2r_x, *a2r_y; slist_node_t *sx, *sy; for(sy=slist_head_node(y->addrs); sy != NULL; sy = slist_node_next(sy)) { a2r_y = slist_node_item(sy); if(a2r_y->ttlexp != 0) continue; for(sx=slist_head_node(x->addrs); sx != NULL; sx=slist_node_next(sx)) { a2r_x = slist_node_item(sx); if(scamper_addr_prefixhosts(a2r_x->addr, a2r_y->addr) >= 30) return 1; } } return 0; } static int sc_router_isvp(const sc_router_t *rtr) { sc_addr2router_t *a2r; slist_node_t *sn; int vpc = 0; for(sn=slist_head_node(rtr->addrs); sn != NULL; sn=slist_node_next(sn)) { a2r = slist_node_item(sn); if(a2r->ttlexp == 0) continue; if(is_vp(a2r->addr) == 1) vpc++; else return 0; } if(vpc == 0) return 0; return 1; } static int sc_router_ispt2pt_vp(const sc_router_t *rtr) { dlist_node_t *dn; sc_router_t *prev; if(rtr->prev == NULL) return 0; for(dn=dlist_head_node(rtr->prev); dn != NULL; dn=dlist_node_next(dn)) { prev = dlist_node_item(dn); if(prev->owner_as == vpas[0] || (prev->owner_as == 0 && sc_router_isvp(prev) != 0)) { if(sc_router_ispt2pt(prev, rtr) != 0) return 1; } } return 0; } static int sc_router_isborder(const sc_router_t *rtr) { sc_router_t *adj; dlist_node_t *dn; if(rtr->owner_as == 0 || rtr->owner_as != vpas[0] || rtr->adj == NULL) return 0; for(dn = dlist_head_node(rtr->adj); dn != NULL; dn = dlist_node_next(dn)) { adj = dlist_node_item(dn); if(adj->owner_as == 0 || adj->owner_as != vpas[0]) return 1; } return 0; } static int sc_router_owner_cmp(const sc_router_t *a, const sc_router_t *b) { const sc_addr2router_t *a2ra, *a2rb; int oa, ob; if(a->owner_as != b->owner_as) { if(a->owner_as == vpas[0] || b->owner_as == vpas[0]) { if(a->owner_as == vpas[0]) return -1; if(b->owner_as == vpas[0]) return 1; } else { if(a->owner_as < b->owner_as) return -1; if(a->owner_as > b->owner_as) return 1; } } else if(a->owner_as == vpas[0] && b->owner_as == vpas[0]) { oa = sc_router_isborder(a); ob = sc_router_isborder(b); if(oa == 1 && ob == 0) return -1; if(oa == 0 && ob == 1) return 1; } a2ra = slist_head_item(a->addrs); a2rb = slist_head_item(b->addrs); if(a2ra != NULL && a2rb != NULL) return scamper_addr_human_cmp(a2ra->addr, a2rb->addr); if(a2ra != NULL && a2rb == NULL) return -1; if(a2ra == NULL && a2rb != NULL) return 1; if(a < b) return -1; if(a > b) return 1; return 0; } static void sc_router_setowner(sc_router_t *r, uint32_t as, uint8_t reason) { assert(as != 0); assert(reason != SC_ROUTER_OWNER_NONE); r->owner_as = as; r->owner_reason = reason; return; } static void sc_allyconftest_free(sc_allyconftest_t *act) { if(act == NULL) return; if(act->a != NULL) sc_target_free(act->a); if(act->b != NULL) sc_target_free(act->b); free(act); return; } static sc_allyconftest_t *sc_allyconftest_alloc(sc_ally_t *ally, int method) { sc_allyconftest_t *act; sc_test_t *test; if((act = malloc_zero(sizeof(sc_allyconftest_t))) == NULL) return NULL; act->ally = ally; act->count = allyconf; act->method = method; if((test = sc_test_alloc(TEST_ALLYCONF, act)) == NULL || sc_waittest_sec(test, allyconf_wait) != 0) { sc_allyconftest_free(act); if(test != NULL) sc_test_free(test); return NULL; } return act; } static void sc_allytest_free(sc_allytest_t *at) { if(at == NULL) return; if(at->addr_list != NULL) slist_free_cb(at->addr_list, (slist_free_t)sc_ping_free); if(at->routers != NULL) sc_routerset_free(at->routers); if(at->a != NULL) sc_target_free(at->a); if(at->b != NULL) sc_target_free(at->b); free(at); return; } static sc_allytest_t *sc_allytest_alloc(void) { sc_allytest_t *at = NULL; if((at = malloc_zero(sizeof(sc_allytest_t))) == NULL || (at->addr_list = slist_alloc()) == NULL || (at->routers = sc_routerset_alloc()) == NULL) goto err; return at; err: if(at != NULL) sc_allytest_free(at); return NULL; } /* * sc_allytest_next * * figure out the next pair of IP addresses that should be tested. the * function works by iterating through the addresses in the list, * only testing the addresses that do not belong to the same router */ static void sc_allytest_next(sc_allytest_t *at) { sc_ping_t *aseq, *bseq, *a, *b; int m; if(at->a != NULL) { sc_target_free(at->a); at->a = NULL; } if(at->b != NULL) { sc_target_free(at->b); at->b = NULL; } at->method = 0; at->attempt = 0; for(;;) { if((at->s2 = slist_node_next(at->s2)) == NULL && ((at->s1 = slist_node_next(at->s1)) == NULL || (at->s2 = slist_node_next(at->s1)) == NULL)) { at->s1 = at->s2 = NULL; break; } a = slist_node_item(at->s1); b = slist_node_item(at->s2); /* * if these addresses have been assigned to routers already, we * don't need to probe them */ if(sc_routerset_a2r_find(at->routers, a->addr) != NULL && sc_routerset_a2r_find(at->routers, b->addr) != NULL) continue; /* if we have already tried these addresses with ally, then skip */ if(sc_ally_find(a->addr, b->addr) != NULL) continue; /* * if we cannot probe them because they do not have a common * probe method to use, then skip them, though this could be * relaxed in the future to use different probe methods if we * assume a single shared counter. */ if((aseq = sc_ping_find(a->addr)) != NULL && (bseq = sc_ping_find(b->addr)) != NULL && sc_ping_method(aseq, bseq, &m) != 0) continue; break; } return; } static void sc_addr2name_free(sc_addr2name_t *a2n) { if(a2n == NULL) return; if(a2n->addr != NULL) scamper_addr_free(a2n->addr); if(a2n->name != NULL) free(a2n->name); free(a2n); return; } static int sc_addr2name_cmp(const sc_addr2name_t *a, const sc_addr2name_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static sc_addr2name_t *sc_addr2name_find(scamper_addr_t *addr) { sc_addr2name_t fm; if(ip2name_tree == NULL) return NULL; fm.addr = addr; return splaytree_find(ip2name_tree, &fm); } static void sc_addr2adj_free(sc_addr2adj_t *a2a) { int i; if(a2a == NULL) return; if(a2a->addr != NULL) scamper_addr_free(a2a->addr); for(i=0; i<2; i++) if(a2a->list[i] != NULL) slist_free_cb(a2a->list[i], (slist_free_t)sc_ping_free); free(a2a); return; } static sc_addr2adj_t *sc_addr2adj_alloc(scamper_addr_t *addr) { sc_addr2adj_t *a2a = NULL; if((a2a = malloc_zero(sizeof(sc_addr2adj_t))) == NULL || (a2a->list[0] = slist_alloc()) == NULL || (a2a->list[1] = slist_alloc()) == NULL) { sc_addr2adj_free(a2a); return NULL; } a2a->addr = scamper_addr_use(addr); return a2a; } static int sc_addr2adj_cmp(const sc_addr2adj_t *a, const sc_addr2adj_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static sc_addr2adj_t *sc_addr2adj_find(sc_stree_t *set, scamper_addr_t *addr) { sc_addr2adj_t fm; fm.addr = addr; return sc_stree_find(set, &fm); } static sc_addr2adj_t *sc_addr2adj_get(sc_stree_t *set, scamper_addr_t *addr) { sc_addr2adj_t *a2a; if((a2a = sc_addr2adj_find(set, addr)) != NULL) return a2a; if((a2a = sc_addr2adj_alloc(addr)) == NULL) return NULL; if(sc_stree_add(set, a2a) != 0) { sc_addr2adj_free(a2a); return NULL; } return a2a; } static int sc_farrouter_addnear(sc_farrouter_t *fr, sc_router_t *near) { if(slist_tail_push(fr->nears, near) == NULL) return -1; return 0; } static void sc_farrouter_free(sc_farrouter_t *fr) { if(fr == NULL) return; if(fr->nears != NULL) slist_free(fr->nears); free(fr); return; } static sc_farrouter_t *sc_farrouter_alloc(sc_router_t *far) { sc_farrouter_t *fr = NULL; if((fr = malloc_zero(sizeof(sc_farrouter_t))) == NULL || (fr->nears = slist_alloc()) == NULL) { sc_farrouter_free(fr); return NULL; } fr->far = far; return fr; } static int sc_farrouter_far_cmp(const sc_farrouter_t *a, const sc_farrouter_t *b) { if(a->far < b->far) return -1; if(a->far > b->far) return 1; return 0; } static int sc_farrouter_nears_cmp(const sc_farrouter_t *a, const sc_farrouter_t *b) { int ac = slist_count(a->nears); int bc = slist_count(b->nears); if(ac > bc) return -1; if(ac < bc) return 1; return 0; } static sc_farrouter_t *sc_farrouter_find(sc_stree_t *set, sc_router_t *far) { sc_farrouter_t fm; fm.far = far; return sc_stree_find(set, &fm); } static sc_farrouter_t *sc_farrouter_get(sc_stree_t *set, sc_router_t *far) { sc_farrouter_t *fr; if((fr = sc_farrouter_find(set, far)) != NULL) return fr; if((fr = sc_farrouter_alloc(far)) == NULL) return NULL; if(sc_stree_add(set, fr) != 0) { sc_farrouter_free(fr); return NULL; } return fr; } /* * sc_astraces_plus1 * * the previous traceroute did not help find an interdomain link that * we might trust. try a different address in the same IPv4 /24 or * IPv6 /120. The default is to try up to five consecutive addresses, * but that can be varied to a random address in each /26 or /122 if * -O randomdst is used. */ static int sc_astraces_plus1(sc_astraces_t *traces, scamper_addr_t *addr) { struct in6_addr in6; struct in_addr in; uint32_t x; uint8_t r; if(af == AF_INET) { memcpy(&in, addr->addr, sizeof(in)); x = ntohl(in.s_addr); if(random_dst != 0) { if((x & 0xC0) == 0xC0) return 0; random_u8(&r); x = (x & 0xFFFFFF00) | ((((x & 0xC0) >> 6) + 1) << 6) | (r & 0x3F); } else { if((x & 0xff) >= 5) return 0; x++; } in.s_addr = htonl(x); if((addr = scamper_addr_alloc(SCAMPER_ADDR_TYPE_IPV4, &in)) == NULL) return -1; } else { memcpy(&in6, addr->addr, sizeof(in6)); if(random_dst != 0) { x = in6.s6_addr[15]; if((x & 0xC0) == 0xC0) return 0; random_u8(&r); in6.s6_addr[15] = ((((x & 0xC0) >> 6) + 1) << 6) | (r & 0x3F); } else { if(in6.s6_addr[15] >= 5) return 0; in6.s6_addr[15]++; } if((addr = scamper_addr_alloc(SCAMPER_ADDR_TYPE_IPV6, &in6)) == NULL) return -1; } if(slist_head_push(traces->dsts, addr) == NULL) { scamper_addr_free(addr); return -1; } return 0; } static int sc_astraces_aliases_procset(slist_t *list) { sc_allytest_t *at = NULL; sc_test_t *test = NULL; sc_addr2router_t *a2r; sc_ping_t *a, *b; slist_node_t *sn, *sn2; sc_ally_t *ar; int total = 0, done = 0; /* all pairs for sets <= 10 is 55 worst case */ if(list == NULL || slist_count(list) < 2 || slist_count(list) > 10) return 0; if((at = sc_allytest_alloc()) == NULL) { logerr("%s: could not alloc allytest\n", __func__); goto err; } for(sn = slist_head_node(list); sn != NULL; sn = slist_node_next(sn)) { a2r = slist_node_item(sn); if(slist_tail_push(at->addr_list, a2r->data) == NULL) { logerr("%s: could not push addr on list\n", __func__); goto err; } a2r->data = NULL; } for(sn=slist_head_node(at->addr_list); sn != NULL; sn = slist_node_next(sn)) { a = slist_node_item(sn); for(sn2 = slist_node_next(sn); sn2 != NULL; sn2 = slist_node_next(sn2)) { b = slist_node_item(sn2); total++; if((ar = sc_ally_find(a->addr, b->addr)) != NULL) { done++; if(ar->result == SCAMPER_DEALIAS_RESULT_ALIASES && sc_routerset_getpair(at->routers, a->addr, b->addr) == NULL) { logerr("%s: could not add pair\n", __func__); goto err; } } else if(at->s1 == NULL) { at->s1 = sn; at->s2 = sn2; } } } logprint("%s: %u %u\n", __func__, done, total); if(done == total) { sc_allytest_free(at); return 0; } if((test = sc_test_alloc(TEST_ALLY, at)) == NULL || sc_waittest(test) != 0) { logerr("%s: could not schedule test\n", __func__); goto err; } return 0; err: if(at != NULL) sc_allytest_free(at); if(test != NULL) sc_test_free(test); return -1; } static int sc_astraces_aliases(sc_astraces_t *traces) { sc_routerset_t *rs = NULL; sc_addr2router_t *a2r; sc_stree_t *set = NULL; char buf[64], buf2[64]; slist_node_t *sn; dlist_node_t *dn; sc_ping_t *a, *b; sc_addr2adj_t *a2a; sc_router_t *ra, *rb; sc_indir_t *indir; sc_link_t *link; int i; if(traces->links == NULL) return 0; if((set = sc_stree_alloc((splaytree_cmp_t)sc_addr2adj_cmp)) == NULL) return -1; for(sn = slist_head_node(traces->links->list); sn != NULL; sn = slist_node_next(sn)) { link = slist_node_item(sn); indir = link->data; printf("%s %s\n", scamper_addr_tostr(link->a, buf, sizeof(buf)), scamper_addr_tostr(link->b, buf2, sizeof(buf2))); /* don't test aliases for outside routers more than one hop away */ if(is_vp(link->a) != 1) { if((a2a = sc_addr2adj_get(set, link->a)) == NULL || (b = sc_ping_alloc(link->b)) == NULL) goto err; b->indir.dst = scamper_addr_use(indir->dst); b->indir.csum = indir->csum; b->indir.ttl = indir->ttl+1; if(slist_tail_push(a2a->list[0], b) == NULL) goto err; } if((a2a = sc_addr2adj_get(set, link->b)) == NULL || (a = sc_ping_alloc(link->a)) == NULL) goto err; a->indir.dst = scamper_addr_use(indir->dst); a->indir.csum = indir->csum; a->indir.ttl = indir->ttl; if(slist_tail_push(a2a->list[1], a) == NULL) goto err; } if((rs = sc_routerset_alloc()) == NULL) goto err; for(sn = slist_head_node(set->list); sn != NULL; sn = slist_node_next(sn)) { a2a = slist_node_item(sn); for(i=0; i<2; i++) { if(a2a->list[i] == NULL || slist_count(a2a->list[i]) < 2) continue; /* get a pointer to a router object representing address A */ a = slist_head_pop(a2a->list[i]); if((a2r = sc_routerset_a2r_find(rs, a->addr)) != NULL) { sc_ping_free(a); } else { if((a2r = sc_routerset_a2r_get(rs, a->addr)) == NULL) goto err; a2r->data = a; } ra = a2r->router; /* go through all other addresses in the set B */ while((b = slist_head_pop(a2a->list[i])) != NULL) { if((a2r = sc_routerset_a2r_find(rs, b->addr)) == NULL) { if((a2r = sc_routerset_a2r_add(rs, ra, b->addr)) == NULL) goto err; a2r->data = b; continue; } if((rb = a2r->router) != ra) { while((a2r = slist_head_pop(rb->addrs)) != NULL) { a2r->router = ra; if(slist_tail_push(ra->addrs, a2r) == NULL) goto err; } sc_routerset_pop(rs, rb); sc_router_free(rb); } sc_ping_free(b); } } } for(dn = dlist_head_node(rs->list); dn != NULL; dn = dlist_node_next(dn)) { ra = dlist_node_item(dn); if(sc_astraces_aliases_procset(ra->addrs) != 0) { logerr("procset\n"); goto err; } } splaytree_inorder(rs->tree, sc_addr2router_free_ping, NULL); sc_routerset_free(rs); sc_stree_free(set, (slist_free_t)sc_addr2adj_free); return 0; err: logerr("%s: %s\n", __func__, strerror(errno)); if(set != NULL) sc_stree_free(set, (slist_free_t)sc_addr2adj_free); if(rs != NULL) sc_routerset_free(rs); return -1; } static void sc_astraces_link_free(sc_link_t *link) { if(link == NULL) return; if(link->data != NULL) sc_indir_free(link->data); sc_link_free(link); return; } static int sc_astraces_link_add(sc_astraces_t *traces, scamper_addr_t *a, scamper_addr_t *b, const sc_indir_t *indir_in) { sc_link_t fm, *link = NULL; sc_indir_t *indir = NULL; if(traces->links == NULL && (traces->links = sc_stree_alloc((splaytree_cmp_t)sc_link_cmp)) == NULL) { logerr("%s: traces->links: %s\n", __func__, strerror(errno)); goto err; } fm.a = a; fm.b = b; if(sc_stree_find(traces->links, &fm) != NULL) return 0; if((link = sc_link_alloc(a, b)) == NULL) { logerr("%s: link alloc: %s\n", __func__, strerror(errno)); goto err; } if((indir = sc_indir_alloc()) == NULL) { logerr("%s: indir alloc: %s\n", __func__, strerror(errno)); goto err; } indir->dst = scamper_addr_use(indir_in->dst); indir->ttl = indir_in->ttl; indir->csum = indir_in->csum; if(sc_stree_add(traces->links, link) != 0) { logerr("%s: link add: %s\n", __func__, strerror(errno)); goto err; } link->data = indir; return 0; err: if(link != NULL) sc_link_free(link); if(indir != NULL) sc_indir_free(indir); return -1; } static int sc_astraces_gss_add(sc_astraces_t *traces, scamper_addr_t *addr) { if(no_gss != 0) return 0; if(traces->gss == NULL && (traces->gss = sc_stree_alloc((splaytree_cmp_t)scamper_addr_cmp)) == NULL) return -1; if(sc_stree_find(traces->gss, addr) != NULL) return 0; if(sc_stree_add(traces->gss, addr) != 0) return -1; scamper_addr_use(addr); return 0; } static int sc_astraces_dst_add(sc_astraces_t *traces, void *addr) { scamper_addr_t *sa = NULL; int type; if(af == AF_INET) type = SCAMPER_ADDR_TYPE_IPV4; else type = SCAMPER_ADDR_TYPE_IPV6; if((sa = scamper_addr_alloc(type, addr)) == NULL || slist_tail_push(traces->dsts, sa) == NULL) goto err; return 0; err: if(sa != NULL) scamper_addr_free(sa); return -1; } static void sc_astraces_free(sc_astraces_t *traces) { if(traces == NULL) return; if(traces->dsts != NULL) slist_free(traces->dsts); if(traces->gss != NULL) sc_stree_free(traces->gss, (sc_stree_free_t)scamper_addr_free); if(traces->links != NULL) sc_stree_free(traces->links, (sc_stree_free_t)sc_astraces_link_free); free(traces); return; } static sc_astraces_t *sc_astraces_alloc(void) { sc_astraces_t *traces = NULL; if((traces = malloc_zero(sizeof(sc_astraces_t))) == NULL || (traces->dsts = slist_alloc()) == NULL) goto err; return traces; err: if(traces != NULL) sc_astraces_free(traces); return NULL; } static int sc_astraces_count(sc_astraces_t *a, int *count) { *count += slist_count(a->dsts); return 0; } /* * sc_astraces_count_cmp * * sort function to put large astraces first, to hopefully encourage * bdrmap to complete faster, rather than schedule large sets for the end. * used by -O impatient. */ static int sc_astraces_count_cmp(const sc_astraces_t *a, const sc_astraces_t *b) { int ac = slist_count(a->dsts); int bc = slist_count(b->dsts); if(ac > bc) return -1; if(ac < bc) return 1; return 0; } static int sc_astraces_shuffle(sc_astraces_t *traces, void *param) { slist_shuffle(traces->dsts); return 0; } static int sc_astraces_cmp(const sc_astraces_t *a, const sc_astraces_t *b) { return sc_asmap_cmp(a->asmap, b->asmap); } static sc_astraces_t *sc_astraces_get(splaytree_t *tree, sc_asmap_t *asmap) { sc_astraces_t fm, *traces; fm.asmap = asmap; if((traces = splaytree_find(tree, &fm)) != NULL) return traces; if((traces = sc_astraces_alloc()) == NULL) return NULL; traces->asmap = asmap; if(splaytree_insert(tree, traces) == NULL) goto err; return traces; err: if(traces != NULL) sc_astraces_free(traces); return NULL; } static int sc_traceset_cmp(const sc_traceset_t *a, const sc_traceset_t *b) { if(a->asn < b->asn) return -1; if(a->asn > b->asn) return 1; return 0; } static void sc_traceset_free(sc_traceset_t *ts) { if(ts == NULL) return; if(ts->list != NULL) slist_free_cb(ts->list, (slist_free_t)scamper_trace_free); free(ts); return; } static sc_traceset_t *sc_traceset_alloc(uint32_t asn) { sc_traceset_t *ts = NULL; if((ts = malloc_zero(sizeof(sc_traceset_t))) == NULL || (ts->list = slist_alloc()) == NULL) goto err; ts->asn = asn; return ts; err: if(ts != NULL) sc_traceset_free(ts); return NULL; } static sc_traceset_t *sc_traceset_find(uint32_t asn) { sc_traceset_t fm; fm.asn = asn; return splaytree_find(tracesets, &fm); } static sc_traceset_t *sc_traceset_get(uint32_t asn) { sc_traceset_t *ts = NULL; if((ts = sc_traceset_find(asn)) != NULL) return ts; if((ts = sc_traceset_alloc(asn)) == NULL || splaytree_insert(tracesets, ts) == NULL) goto err; return ts; err: if(ts != NULL) sc_traceset_free(ts); return NULL; } static int sc_delegated_cmp(const sc_delegated_t *a, const sc_delegated_t *b) { uint32_t sa, sb; sa = ntohl(a->y.s_addr) - ntohl(a->x.s_addr); sb = ntohl(b->y.s_addr) - ntohl(b->x.s_addr); if(sa > sb) return -1; if(sa < sb) return 1; return 0; } static sc_delegated_t *sc_delegated_find(scamper_addr_t *addr) { sc_delegated_t *dg; slist_node_t *sn; struct in_addr in; if(delegated == NULL) return NULL; memcpy(&in, addr->addr, sizeof(in)); in.s_addr = ntohl(in.s_addr); for(sn=slist_head_node(delegated); sn != NULL; sn=slist_node_next(sn)) { dg = slist_node_item(sn); if(in.s_addr >= ntohl(dg->x.s_addr) && in.s_addr <= ntohl(dg->y.s_addr)) break; } if(sn == NULL) return NULL; return slist_node_item(sn); } static uint8_t sc_delegated_netlen(sc_delegated_t *dg) { uint32_t size = ntohl(dg->y.s_addr) - ntohl(dg->x.s_addr); switch(size) { case 256: return 24; case 512: return 23; case 1024: return 22; case 2048: return 21; case 4096: return 20; case 8192: return 19; case 16384: return 18; case 32768: return 17; case 65536: return 16; case 131072: return 15; case 262144: return 14; case 524288: return 13; case 1048576: return 12; case 2097152: return 11; case 4194304: return 10; case 8388608: return 9; case 16777216: return 8; } return 0; } static void trace_dump(const scamper_trace_t *trace, sc_routerset_t *rtrset) { scamper_trace_hop_t *hop; sc_prefix_t *pfx; sc_router_t *rtr; char buf[128]; int i; /* dump the traceroute output */ printf("trace to %s", scamper_addr_tostr(trace->dst, buf, sizeof(buf))); if((pfx = sc_prefix_find(trace->dst)) != NULL) printf(" %s", sc_asmap_tostr(pfx->asmap, buf, sizeof(buf))); printf("\n"); for(i=trace->firsthop-1; ihop_count; i++) { printf("%2d ", i+1); if((hop = trace->hops[i]) == NULL) { printf("*\n"); continue; } printf("%s <%u,%u> %d", scamper_addr_tostr(hop->hop_addr, buf, sizeof(buf)), hop->hop_icmp_type, hop->hop_icmp_code, is_vp(hop->hop_addr)); if(is_ixp(hop->hop_addr) != 0) printf(" ixp"); else if((pfx = sc_prefix_find(hop->hop_addr)) != NULL) printf(" %s", sc_asmap_tostr(pfx->asmap, buf, sizeof(buf))); else printf(" null"); if(rtrset != NULL && (rtr = sc_routerset_find(rtrset, hop->hop_addr)) != NULL) printf(" %u:%s", rtr->owner_as, owner_reasonstr[rtr->owner_reason]); printf("\n"); } return; } static void traceset_dump(const sc_traceset_t *ts, sc_routerset_t *rtrset) { slist_node_t *sn; for(sn=slist_head_node(ts->list); sn != NULL; sn=slist_node_next(sn)) trace_dump(slist_node_item(sn), rtrset); printf("\n"); return; } static int do_method_trace(sc_test_t *test, char *cmd, size_t len) { sc_tracetest_t *tt = test->data; scamper_addr_t *addr; sc_target_t *found; slist_node_t *sn; size_t off = 0; char buf[128]; /* first, check to see if the test is runnable. if not block */ if((found = sc_target_find(tt->target)) != NULL && found->test != test) { if(sc_target_block(found, test) != 0) return -1; return 0; } else if(found == NULL) { /* add the test to the blocked list */ if(sc_target_add(tt->target) != 0) return -1; } string_concat(cmd, len, &off, "trace -w 1 -P icmp-paris"); if(firsthop > 1) string_concat(cmd, len, &off, " -f %u", firsthop); if(no_gss == 0 && tt->astraces->gss != NULL) { if(firsthop > 1) string_concat(cmd, len, &off, " -O dtree-noback"); sn = slist_head_node(tt->astraces->gss->list); while(sn != NULL) { addr = slist_node_item(sn); string_concat(cmd, len, &off, " -z %s", scamper_addr_tostr(addr,buf,sizeof(buf))); sn = slist_node_next(sn); } } string_concat(cmd, len, &off, " %s\n", scamper_addr_tostr(tt->target->addr, buf, sizeof(buf))); return off; } static int do_method_ping(sc_test_t *test, char *cmd, size_t len) { static const char *method[] = {"icmp-echo", "tcp-ack-sport", "udp-dport", "icmp-echo"}; static const char *wait[] = {"0.3", "0.5", "1", "0.5"}; sc_pingtest_t *pt = test->data; sc_ping_t *ping = pt->ping; size_t off = 0; char buf[128]; assert(pt->method >= 0); assert(pt->method < 4); assert(pt->method < 3 || ping->indir.dst != NULL); string_concat(cmd, len, &off, "ping -P %s -i %s -c %u -o %u", method[pt->method], wait[pt->method], attempts + 2, attempts); if(pt->method == METHOD_INDIR) string_concat(cmd, len, &off, " -m %u -C %u %s", ping->indir.ttl, ping->indir.csum, scamper_addr_tostr(ping->indir.dst, buf, sizeof(buf))); else string_concat(cmd, len, &off, " %s", scamper_addr_tostr(ping->addr, buf, sizeof(buf))); string_concat(cmd, len, &off, "\n"); return off; } /* * do_method_ipidseq_addr * * this function */ static int do_method_ipidseq_addr(sc_test_t *test, scamper_addr_t *addr, char *cmd, size_t len) { sc_pingtest_t *pt; sc_target_t *found; sc_test_t *tt; if((found = sc_target_findaddr(addr)) != NULL) { logprint("%s: ipidseq found %p\n", __func__, found); if(sc_target_block(found, test) != 0) return -1; return 0; } if((tt = sc_pingtest_alloc(addr)) == NULL) return -1; pt = tt->data; if(sc_target_block(pt->target, test) != 0) return -1; if(sc_target_add(pt->target) != 0) { logerr("%s: could not add target\n", __func__); return -1; } return do_method_ping(tt, cmd, len); } /* * do_method_ipidseq_ping * * this function is a hack function to use when we first need to determine * which probe methods might be able to get an incrementing IPID. The * ping structure is filled out with an indirect probing method. */ static int do_method_ipidseq_ping(sc_test_t *test, sc_ping_t *ping, char *cmd, size_t len) { sc_pingtest_t *pt; sc_target_t *found; sc_test_t *tt; if((found = sc_target_findaddr(ping->addr)) != NULL || (found = sc_target_findaddr(ping->indir.dst)) != NULL) { logprint("%s: ipidseq found %p\n", __func__, found); if(sc_target_block(found, test) != 0) return -1; return 0; } if((tt = sc_pingtest_alloc(ping->addr)) == NULL) return -1; pt = tt->data; if(sc_target_block(pt->target, test) != 0) return -1; if(sc_target_add(pt->target) != 0) { logerr("%s: could not add target\n", __func__); return -1; } /* set up the indirect probing */ pt->ping->indir.dst = scamper_addr_use(ping->indir.dst); pt->ping->indir.csum = ping->indir.csum; pt->ping->indir.ttl = ping->indir.ttl; /* only try and add t2 if we're probing a different address */ if(scamper_addr_cmp(ping->indir.dst, ping->addr) != 0) { if((pt->t2 = sc_target_alloc(ping->indir.dst)) == NULL) return -1; pt->t2->test = tt; if(sc_target_add(pt->t2) != 0) { logerr("%s: could not add t2\n", __func__); return -1; } } /* * if we have already probed this address before, and just need indirect * probing, then skip to that now */ if(pt->ping->methods[0] != IPID_NONE) pt->method = METHOD_INDIR; return do_method_ping(tt, cmd, len); } static int do_method_link(sc_test_t *test, char *cmd, size_t len) { static const char *method[] = {"icmp-echo", "tcp-ack", "udp-dport"}; static const uint16_t wait[] = {300, 500, 1000}; sc_linktest_t *lt = test->data; sc_link_t *link = lt->link; char a[128], b[128]; sc_target_t *found; sc_ping_t *ping; size_t off = 0; if(lt->step == TEST_LINK_PREFIXSCAN) { if((ping = sc_ping_find(link->a)) == NULL) return do_method_ipidseq_addr(test, link->a, cmd, len); while(ping->methods[lt->method] != IPID_INCR && lt->method < METHOD_UDP) lt->method++; if(ping->methods[lt->method] == IPID_INCR || (lt->method == METHOD_UDP && ping->methods[lt->method] != IPID_UNRESP)) { string_concat(cmd, len, &off, "dealias -m prefixscan"); if(fudge == 0) string_concat(cmd, len, &off, " -O inseq"); else string_concat(cmd, len, &off, " -f %u", fudge); string_concat(cmd, len, &off, " -W %u -p '-P %s' %s %s/30\n", wait[lt->method], method[lt->method], scamper_addr_tostr(link->a, a, sizeof(a)), scamper_addr_tostr(link->b, b, sizeof(b))); goto done; } lt->method = 0; if(no_ipopts != 0) { sc_linktest_free(lt); sc_test_free(test); goto done; } lt->step = TEST_LINK_RR; } if(lt->step == TEST_LINK_RR) { string_concat(cmd, len, &off, "ping -R %s\n", scamper_addr_tostr(link->b, b, sizeof(b))); } else if(lt->step == TEST_LINK_PSTS) { if(lt->method == 0) scamper_addr_tostr(link->a, a, sizeof(a)); else scamper_addr_tostr(lt->ab, a, sizeof(a)); scamper_addr_tostr(link->b, b, sizeof(b)); string_concat(cmd, len, &off, "ping -T tsprespec=%s,%s %s\n", b, a, b); } done: if(off == 0) return 0; if(((found = sc_target_find(lt->ta)) != NULL && found->test != test) || ((found = sc_target_find(lt->tb)) != NULL && found->test != test)) { if(sc_target_block(found, test) != 0) return -1; return 0; } if((sc_target_find(lt->ta) == NULL && sc_target_add(lt->ta) != 0) || (sc_target_find(lt->tb) == NULL && sc_target_add(lt->tb) != 0)) return -1; return off; } static int do_method_ally(sc_test_t *test, char *cmd, size_t len) { static const char *method[] = {"icmp-echo", "tcp-ack-sport", "udp-dport", "icmp-echo"}; static const uint16_t wait[] = {300, 500, 1000, 500}; sc_allytest_t *at = test->data; sc_ping_t *aseq = NULL, *bseq = NULL, *a, *b; sc_target_t *found; char ab[64], bb[64]; size_t off = 0; for(;;) { a = slist_node_item(at->s1); b = slist_node_item(at->s2); if((aseq = sc_ping_find(a->addr)) == NULL || (aseq->indir.dst == NULL && a->indir.dst != NULL)) return do_method_ipidseq_ping(test, a, cmd, len); if((bseq = sc_ping_find(b->addr)) == NULL || (bseq->indir.dst == NULL && b->indir.dst != NULL)) return do_method_ipidseq_ping(test, b, cmd, len); if(sc_ping_method(aseq, bseq, &at->method) != 0) { sc_allytest_next(at); if(at->s1 == NULL) { sc_allytest_free(at); sc_test_free(test); return 0; } continue; } break; } if(at->a == NULL) { if(at->method != METHOD_INDIR) at->a = sc_target_alloc(aseq->addr); else at->a = sc_target_alloc(aseq->indir.dst); if(at->a == NULL) return -1; at->a->test = test; } if(at->b == NULL) { if(at->method != METHOD_INDIR) at->b = sc_target_alloc(bseq->addr); else at->b = sc_target_alloc(bseq->indir.dst); if(at->b == NULL) return -1; at->b->test = test; } if(((found = sc_target_find(at->a)) != NULL && found->test != test) || ((found = sc_target_find(at->b)) != NULL && found->test != test)) { if(sc_target_block(found, test) != 0) return -1; return 0; } if((sc_target_find(at->a) == NULL && sc_target_add(at->a) != 0) || (sc_target_find(at->b) == NULL && sc_target_add(at->b) != 0)) { logerr("%s: could not add target %d\n", __func__, at->method); return -1; } string_concat(cmd, len, &off, "dealias -m ally -W %u -q %u", wait[at->method], attempts); if(fudge == 0) string_concat(cmd, len, &off, " -O inseq"); else string_concat(cmd, len, &off, " -f %d", fudge); if(at->method != METHOD_INDIR) { string_concat(cmd, len, &off, " -p '-P %s' %s %s", method[at->method], scamper_addr_tostr(aseq->addr, ab, sizeof(ab)), scamper_addr_tostr(bseq->addr, bb, sizeof(bb))); } else { string_concat(cmd, len, &off, " -p '-P %s -c %u -t %u -i %s'", method[at->method], aseq->indir.csum, aseq->indir.ttl, scamper_addr_tostr(aseq->indir.dst, ab, sizeof(ab))); string_concat(cmd, len, &off, " -p '-P %s -c %u -t %u -i %s'", method[at->method], bseq->indir.csum, bseq->indir.ttl, scamper_addr_tostr(bseq->indir.dst, bb, sizeof(bb))); } string_concat(cmd, len, &off, "\n"); return off; } static int do_method_allyconf(sc_test_t *test, char *cmd, size_t len) { static const char *method[] = {"icmp-echo", "tcp-ack-sport", "udp-dport", "icmp-echo"}; static const uint16_t wait[] = {300, 500, 1000, 500}; sc_allyconftest_t *act = test->data; sc_ping_t *aseq = NULL, *bseq = NULL; scamper_addr_t *a, *b; sc_target_t *found; char ab[64], bb[64]; size_t off = 0; assert(act->a == NULL); assert(act->b == NULL); if(act->method != METHOD_INDIR) { a = act->ally->a; b = act->ally->b; } else { if((aseq = sc_ping_find(act->ally->a)) == NULL || (bseq = sc_ping_find(act->ally->b)) == NULL) { logerr("%s: could not find ipidseq\n"); return -1; } a = aseq->indir.dst; b = aseq->indir.dst; } if(((found = sc_target_findaddr(a)) != NULL && found->test != test) || ((found = sc_target_findaddr(b)) != NULL && found->test != test)) { if(sc_target_block(found, test) != 0) { logerr("%s: could not block\n", __func__); return -1; } return 0; } if((act->a = sc_target_alloc(a)) == NULL || (act->b = sc_target_alloc(b)) == NULL) { logerr("%s: could not alloc target\n", __func__); return -1; } act->a->test = test; act->b->test = test; if((sc_target_find(act->a) == NULL && sc_target_add(act->a) != 0) || (sc_target_find(act->b) == NULL && sc_target_add(act->b) != 0)) { logerr("%s: could not add target %d\n", __func__, act->method); return -1; } string_concat(cmd, len, &off, "dealias -m ally -W %u -q %u -O inseq", wait[act->method], attempts+2); if(act->method != METHOD_INDIR) { string_concat(cmd, len, &off, " -p '-P %s' %s %s", method[act->method], scamper_addr_tostr(a, ab, sizeof(ab)), scamper_addr_tostr(b, bb, sizeof(bb))); } else { string_concat(cmd, len, &off, " -p '-P %s -c %u -t %u -i %s'", method[act->method], aseq->indir.csum, aseq->indir.ttl, scamper_addr_tostr(aseq->indir.dst, ab, sizeof(ab))); string_concat(cmd, len, &off, " -p '-P %s -c %u -t %u -i %s'", method[act->method], bseq->indir.csum, bseq->indir.ttl, scamper_addr_tostr(bseq->indir.dst, bb, sizeof(bb))); } string_concat(cmd, len, &off, "\n"); return off; } static int virgin_pop(sc_test_t **out) { scamper_addr_t *addr = NULL; sc_tracetest_t *tt; sc_astraces_t *traces; if((traces = slist_head_pop(virgin)) == NULL) { *out = NULL; return 0; } addr = slist_head_pop(traces->dsts); if((tt = sc_tracetest_alloc(addr)) == NULL) goto err; scamper_addr_free(addr); addr = NULL; tt->astraces = traces; *out = tt->target->test; return 0; err: return -1; } static int do_method(void) { static int (*const func[])(sc_test_t *, char *, size_t) = { do_method_trace, do_method_link, do_method_ping, do_method_ally, do_method_allyconf, }; sc_waittest_t *wt; sc_test_t *test; int off; if(more < 1) return 0; for(;;) { if((wt = heap_head_item(waiting)) != NULL && timeval_cmp(&now, &wt->tv) >= 0) { test = wt->test; heap_remove(waiting); free(wt); } else { if(virgin_pop(&test) != 0) return -1; if(test == NULL) return 0; } if((off = func[test->type](test, cmd, sizeof(cmd))) == -1) { logerr("%s: something went wrong, type %d\n", __func__, test->type); return -1; } /* got a command, send it */ if(off != 0) { write_wrap(scamper_fd, cmd, NULL, off); probing++; more--; logprint("p %d, w %d, v %d : %s", probing, heap_count(waiting), slist_count(virgin), cmd); break; } } return 0; } static int do_decoderead_dealias_pfxscan(scamper_dealias_t *dealias) { scamper_dealias_prefixscan_t *pfs = dealias->data; sc_linktest_t *lt; sc_target_t *tg; sc_test_t *test; sc_ally_t *ar; char a[32], b[32], ab[32]; scamper_addr_tostr(pfs->a, a, sizeof(a)); scamper_addr_tostr(pfs->b, b, sizeof(b)); if((tg = sc_target_findaddr(pfs->a)) == NULL) { logerr("%s: could not find %s:%s\n", __func__, a, b); return -1; } test = tg->test; assert(test->type == TEST_LINK); lt = test->data; if((pfs->ab == NULL || scamper_addr_prefixhosts(pfs->b, pfs->ab) < 30) && lt->method != METHOD_PFXS_LAST) { lt->method++; } else { if(pfs->ab != NULL) { /* * if we inferred a /30 mate, and not with the common-source-address * technique (i.e., it was derived from IP-ID) then record an * alias (if one does not already exist), and schedule a confirmation * sequence. */ if((pfs->flags & SCAMPER_DEALIAS_PREFIXSCAN_FLAG_CSA) == 0) { if(sc_ally_find(pfs->a, pfs->ab) == NULL) { if((ar = sc_ally_get(pfs->a, pfs->ab)) == NULL) { logerr("%s: could not get ally %s:%s: %s\n", __func__, a, scamper_addr_tostr(pfs->ab,b,sizeof(b)), strerror(errno)); return -1; } if(allyconf > 0 && sc_allyconftest_alloc(ar, lt->method) == NULL) { logerr("%s: could not add allyconftest: %s", __func__, strerror(errno)); return -1; } } } lt->ab = scamper_addr_use(pfs->ab); logprint("pfxscan %s %s finished: %s/%d\n", a, b, scamper_addr_tostr(pfs->ab, ab, sizeof(ab)), scamper_addr_prefixhosts(pfs->b, pfs->ab)); } else { logprint("pfxscan %s %s finished\n", a, b); } lt->method = 0; if(no_ipopts != 0) { sc_linktest_free(lt); sc_test_free(test); return 0; } lt->step = TEST_LINK_RR; } if(sc_waittest(test) != 0) { logerr("%s: could not waittest\n", __func__); return -1; } return 0; } static int do_decoderead_dealias_ally(scamper_dealias_t *dealias) { scamper_dealias_ally_t *ally = dealias->data; scamper_dealias_probe_t *probe; scamper_dealias_reply_t *reply; char buf[384], ab[32], bb[32]; sc_allytest_t *at = NULL; sc_allyconftest_t *act = NULL; sc_test_t *test = NULL; scamper_addr_t *p[2]; sc_target_t *tg; sc_ally_t *ar; size_t off = 0; uint32_t i; if((tg = sc_target_findaddr(ally->probedefs[0].dst)) == NULL) { logerr("%s: could not find %s\n", __func__, scamper_addr_tostr(ally->probedefs[0].dst, ab, sizeof(ab))); return -1; } test = tg->test; if(test->type == TEST_ALLY) { at = test->data; at->attempt++; p[0] = ((sc_ping_t *)slist_node_item(at->s1))->addr; p[1] = ((sc_ping_t *)slist_node_item(at->s2))->addr; } else if(test->type == TEST_ALLYCONF) { act = test->data; act->count--; p[0] = act->ally->a; p[1] = act->ally->b; } else { logerr("%s: unexpected test type %d\n", __func__, test->type); goto err; } string_concat(buf, sizeof(buf), &off, "ally %s:%s", scamper_addr_tostr(p[0], ab, sizeof(ab)), scamper_addr_tostr(p[1], bb, sizeof(bb))); /* check for indirect probing */ if(scamper_addr_cmp(p[0], ally->probedefs[0].dst) != 0) { string_concat(buf, sizeof(buf), &off, " indir %s:%s", scamper_addr_tostr(ally->probedefs[0].dst, ab, sizeof(ab)), scamper_addr_tostr(ally->probedefs[1].dst, bb, sizeof(bb))); /* if we inferred aliases, check the addresses returned */ if(dealias->result == SCAMPER_DEALIAS_RESULT_ALIASES) { for(i=0; iprobec; i++) { probe = dealias->probes[i]; reply = probe->replies[0]; if(scamper_addr_cmp(reply->src, p[probe->def->id]) != 0) break; } if(i != dealias->probec) dealias->result = SCAMPER_DEALIAS_RESULT_NONE; } } string_concat(buf, sizeof(buf), &off, " %s", scamper_dealias_result_tostr(dealias, ab, sizeof(ab))); logprint("%s\n", buf); if(at != NULL) { /* if we already have an ally record, skip over this test */ if(sc_ally_find(p[0], p[1]) != NULL) { sc_allytest_next(at); if(at->s1 == NULL) { sc_allytest_free(at); at = NULL; sc_test_free(test); test = NULL; } else if(sc_waittest(test) != 0) { logerr("%s: could not waittest\n", __func__); goto err; } return 0; } /* if we didn't get a result, do we try again? */ if(dealias->result == SCAMPER_DEALIAS_RESULT_NONE && at->attempt <= 4) { if(sc_waittest(test) != 0) { logerr("%s: could not waittest\n", __func__); goto err; } return 0; } else { /* we got a result, cache it so we don't try again */ if((ar = sc_ally_get(p[0], p[1])) == NULL) { logerr("%s: could not get ally\n", __func__); goto err; } ar->result = dealias->result; /* if we inferred aliases, try and confirm */ if(dealias->result == SCAMPER_DEALIAS_RESULT_ALIASES) { if(sc_routerset_getpair(at->routers, p[0], p[1]) == NULL) { logerr("%s: could not getpair\n", __func__); goto err; } if(allyconf > 0 && sc_allyconftest_alloc(ar, at->method) == NULL) { logerr("%s: could not add alloc allyconf\n", __func__); goto err; } } } /* move onto the next test pair */ sc_allytest_next(at); if(at->s1 == NULL) { sc_allytest_free(at); at = NULL; sc_test_free(test); test = NULL; } else if(sc_waittest(test) != 0) { logerr("%s: could not waittest\n", __func__); goto err; } } else if(act != NULL) { if(dealias->result == SCAMPER_DEALIAS_RESULT_NOTALIASES) act->ally->result = dealias->result; if(act->count > 0) { sc_target_free(act->a); act->a = NULL; sc_target_free(act->b); act->b = NULL; if(sc_waittest_sec(test, allyconf_wait) != 0) { logerr("%s: could not waittest_sec\n", __func__); goto err; } } else { sc_allyconftest_free(act); act = NULL; sc_test_free(test); test = NULL; } } return 0; err: if(act != NULL) sc_allyconftest_free(act); if(at != NULL) sc_allytest_free(at); if(test != NULL) sc_test_free(test); return -1; } static int do_decoderead_dealias(scamper_dealias_t *dealias) { if(dealias->method == SCAMPER_DEALIAS_METHOD_PREFIXSCAN) return do_decoderead_dealias_pfxscan(dealias); else if(dealias->method == SCAMPER_DEALIAS_METHOD_ALLY) return do_decoderead_dealias_ally(dealias); return -1; } static int do_decoderead_ping_link(sc_test_t *test, scamper_ping_t *ping) { sc_linktest_t *lt = test->data; if(lt->step == TEST_LINK_PSTS) { if(lt->method == 0 && lt->ab != NULL) { lt->method++; if(sc_waittest(test) != 0) return -1; return 0; } sc_linktest_free(lt); lt = NULL; sc_test_free(test); test = NULL; } else { lt->step = TEST_LINK_PSTS; if(sc_waittest(test) != 0) return -1; } return 0; } static int ping_classify(const scamper_addr_t *dst, const scamper_ping_t *ping) { scamper_ping_reply_t *rx; int rc = -1, echo = 0, bs = 0, nobs = 0; int i, samples[65536]; uint32_t u32, f, n0, n1; slist_t *list = NULL; slist_node_t *ln0, *ln1; if(ping->stop_reason == SCAMPER_PING_STOP_NONE || ping->stop_reason == SCAMPER_PING_STOP_ERROR) return IPID_UNRESP; if((list = slist_alloc()) == NULL) goto done; memset(samples, 0, sizeof(samples)); for(i=0; iping_sent; i++) { if((rx = ping->ping_replies[i]) != NULL && (SCAMPER_PING_REPLY_FROM_TARGET(ping, rx) || (SCAMPER_PING_REPLY_IS_ICMP_TTL_EXP(rx) && scamper_addr_cmp(dst, rx->addr) == 0))) { /* * if at least two of four samples have the same ipid as what was * sent, then declare it echos. this handles the observed case * where some responses echo but others increment. */ if(rx->probe_ipid == rx->reply_ipid && ++echo > 1) { rc = IPID_ECHO; goto done; } /* * if two responses have the same IPID value, declare that it * replies with a constant IPID */ if(++samples[rx->reply_ipid] > 1) { rc = IPID_CONST; goto done; } if(slist_tail_push(list, rx) == NULL) goto done; } } if(slist_count(list) < attempts) { rc = IPID_UNRESP; goto done; } f = (fudge == 0) ? 5000 : fudge; ln0 = slist_head_node(list); ln1 = slist_node_next(ln0); while(ln1 != NULL) { rx = slist_node_item(ln0); n0 = rx->reply_ipid; rx = slist_node_item(ln1); n1 = rx->reply_ipid; if(n0 < n1) u32 = n1 - n0; else u32 = (n1 + 0x10000) - n0; if(u32 <= f) nobs++; n0 = byteswap16(n0); n1 = byteswap16(n1); if(n0 < n1) u32 = n1 - n0; else u32 = (n1 + 0x10000) - n0; if(u32 <= f) bs++; ln0 = ln1; ln1 = slist_node_next(ln0); } if(nobs != attempts-1 && bs != attempts-1) rc = IPID_RAND; else rc = IPID_INCR; done: if(list != NULL) slist_free(list); return rc; } /* * trace_lasthop * * process the traceroute, returning the last hop that can be trusted * in this traceroute. in this case, we are looking at looking for the * first repeated address in the traceroute, where the repeated address * is more than one hop away. */ static int trace_lasthop(scamper_trace_t *trace) { scamper_trace_hop_t *hop; int i, j, v, L = 0, V = 0; /* * if there is an address from outside of the network in amongst * addresses within the the network, then ignore this traceroute * entirely. */ for(i=trace->firsthop-1; ihop_count; i++) { if((hop = trace->hops[i]) == NULL) continue; v = is_vp(hop->hop_addr); if(v == 0) V = 1; else if(v == 1 && V == 1) return 0; } for(i=trace->firsthop-1; ihop_count; i++) { if((hop = trace->hops[i]) == NULL) continue; for(j=i+1; jhop_count; j++) { if(trace->hops[j] == NULL) continue; if(scamper_addr_cmp(hop->hop_addr, trace->hops[j]->hop_addr) != 0) continue; if(i + 1 == j) { if(L > 0) return i + 1; L++; continue; } else { return i + 1; } } } return trace->hop_count; } static int do_decoderead_ping_ping(sc_test_t *test, scamper_ping_t *ping) { sc_pingtest_t *pt = test->data; int class = ping_classify(pt->ping->addr, ping); char msg[256], buf[128]; size_t off; int i; if(class == -1) return -1; if(pt->method == METHOD_ICMP || pt->method == METHOD_INDIR) assert(SCAMPER_PING_METHOD_IS_ICMP(ping)); else if(pt->method == METHOD_TCP) assert(SCAMPER_PING_METHOD_IS_TCP(ping)); else if(pt->method == METHOD_UDP) assert(SCAMPER_PING_METHOD_IS_UDP(ping)); else return -1; pt->ping->methods[pt->method] = class; pt->method++; if(pt->method < 3 || (pt->method == 3 && pt->ping->indir.dst != NULL)) { if(sc_waittest(test) != 0) return -1; } else { off = 0; string_concat(msg, sizeof(msg), &off, "ping %s:", scamper_addr_tostr(pt->ping->addr, buf, sizeof(buf))); for(i=0; imethod; i++) string_concat(msg, sizeof(msg), &off, " %s", class_tostr(buf, sizeof(buf), pt->ping->methods[i])); logprint("%s\n", msg); sc_pingtest_free(pt); sc_test_free(test); } return 0; } static int do_decoderead_ping(scamper_ping_t *ping) { sc_target_t *target; sc_test_t *test; char buf[128]; if((target = sc_target_findaddr(ping->dst)) == NULL) { fprintf(stderr, "%s: could not find %s\n", __func__, scamper_addr_tostr(ping->dst, buf, sizeof(buf))); return -1; } test = target->test; assert(test != NULL); if(test->type == TEST_LINK) return do_decoderead_ping_link(test, ping); else if(test->type == TEST_PING) return do_decoderead_ping_ping(test, ping); return -1; } static int do_decoderead_trace(scamper_trace_t *trace) { scamper_trace_hop_t *hop, *x, *y; scamper_addr_t *addr; sc_tracetest_t *tt; sc_astraces_t *astraces; sc_target_t *target; sc_indir_t indir; sc_test_t *test; char buf[128]; int i, p1, zttl, lh, lv; logprint("trace %s finished\n", scamper_addr_tostr(trace->dst, buf, sizeof(buf))); if((target = sc_target_findaddr(trace->dst)) == NULL) goto err; test = target->test; tt = test->data; astraces = tt->astraces; /* don't need the test anymore */ sc_tracetest_free(tt); tt = NULL; sc_test_free(test); test = NULL; /* dump the traceroute output */ trace_dump(trace, NULL); /* figure out how far in the trace we should consider processing */ if((lh = trace_lasthop(trace)) == 0) goto done; /* make a note of the last hop mapped to the VP */ lv = -1; for(i=trace->firsthop-1; ihops[i]) != NULL && is_vp(hop->hop_addr) == 1) lv = i; /* figure out if we need to probe another address in the same subnet */ p1 = 1; if(lv != -1) i = lv + 1; else i = trace->firsthop-1; while(i < lh) { if((hop = trace->hops[i]) != NULL && is_vp(hop->hop_addr) == 0) { if(scamper_addr_cmp(trace->dst, hop->hop_addr) != 0) p1 = 0; break; } i++; } if(p1 != 0 && sc_astraces_plus1(astraces, trace->dst) != 0) goto err; /* if we never found a VP address, we're done for now */ if(lv < 0) goto done; /* these fields do not change for this traceroute, so set them now */ indir.dst = trace->dst; indir.csum = trace->dport; for(i=trace->firsthop-1; i<=lv; i++) { if((hop = trace->hops[i]) == NULL) continue; /* * check if the hop being examined might be a fake hop caused by * zero-ttl forwarding */ if(i+1 < lh && (y = trace->hops[i+1]) != NULL && scamper_addr_cmp(hop->hop_addr, y->hop_addr) == 0) zttl = 1; else zttl = 0; /* * keep track of links seen towards the neighbor network that we * will test for aliases. do not test links where the hop being * examined might not be adjacent to X because of zero-ttl * forwarding */ if(i-1 >= trace->firsthop-1 && (x = trace->hops[i-1]) != NULL && scamper_addr_cmp(x->hop_addr, hop->hop_addr) != 0 && zttl == 0) { indir.ttl = x->hop_probe_ttl; if(sc_astraces_link_add(astraces, x->hop_addr, hop->hop_addr, &indir) != 0) goto err; } } /* linktest the apparent last hop in the VP network */ if(af == AF_INET && lv-1 >= trace->firsthop-1 && (x = trace->hops[lv-1]) != NULL && scamper_addr_cmp(x->hop_addr, trace->hops[lv]->hop_addr) != 0 && sc_linktest_alloc(x->hop_addr, trace->hops[lv]->hop_addr) != 0) goto err; if(lv+1 < lh && (x = trace->hops[lv+1]) != NULL) { assert(scamper_addr_cmp(trace->hops[lv]->hop_addr, x->hop_addr) != 0); if(lv+2 < lh) y = trace->hops[lv+2]; else y = NULL; if(y == NULL || scamper_addr_cmp(x->hop_addr, y->hop_addr) != 0) { /* linktest the apparent first hop in the neighbor network */ if(af == AF_INET && sc_linktest_alloc(trace->hops[lv]->hop_addr, x->hop_addr) != 0) goto err; /* make note of apparent links to help with alias resolution */ indir.ttl = trace->hops[lv]->hop_probe_ttl; if(sc_astraces_link_add(astraces, trace->hops[lv]->hop_addr, x->hop_addr, &indir) != 0) goto err; /* * also make note of links after first VP hop, to help with * resolving aliases for routers with neighbor address space. */ if(y != NULL) { indir.ttl = x->hop_probe_ttl; if(sc_astraces_link_add(astraces, x->hop_addr, y->hop_addr, &indir) != 0) goto err; } } /* add the second hop past the last VP address to the GSS */ if(y != NULL && SCAMPER_TRACE_HOP_IS_ICMP_TTL_EXP(y) && scamper_addr_cmp(trace->dst, y->hop_addr) != 0 && slist_count(astraces->dsts) > 0 && is_vp(y->hop_addr) != 1 && sc_astraces_gss_add(astraces, y->hop_addr) != 0) goto err; } done: if((addr = slist_head_pop(astraces->dsts)) == NULL) { /* figure out aliases to test for */ if(sc_astraces_aliases(astraces) != 0) goto err; sc_astraces_free(astraces); return 0; } if((tt = sc_tracetest_alloc(addr)) == NULL) goto err; scamper_addr_free(addr); addr = NULL; tt->astraces = astraces; if(sc_waittest(tt->target->test) != 0) goto err; return 0; err: printf("do_decoderead_trace: error\n"); return -1; } static int do_decoderead(void) { void *data; uint16_t type; int rc = -1; /* try and read a traceroute from the warts decoder */ if(scamper_file_read(decode_in, ffilter, &type, &data) != 0) { logerr("%s: scamper_file_read errno %d\n", __func__, errno); return -1; } if(data == NULL) { if(scamper_file_geteof(decode_in) != 0) { scamper_file_close(decode_in); decode_in = NULL; decode_in_fd = -1; } return 0; } probing--; if(scamper_file_write_obj(outfile, type, data) != 0) { logerr("%s: could not write obj %d\n", __func__, type); /* XXX: free data */ return -1; } if(type == SCAMPER_FILE_OBJ_PING) { rc = do_decoderead_ping(data); scamper_ping_free(data); } else if(type == SCAMPER_FILE_OBJ_TRACE) { rc = do_decoderead_trace(data); scamper_trace_free(data); } else if(type == SCAMPER_FILE_OBJ_DEALIAS) { rc = do_decoderead_dealias(data); scamper_dealias_free(data); } return rc; } static int do_scamperread(void) { ssize_t rc; uint8_t uu[64]; char *ptr, *head; char buf[512]; void *tmp; long l; size_t i, uus, linelen; if((rc = read(scamper_fd, buf, sizeof(buf))) > 0) { if(readbuf_len == 0) { if((readbuf = memdup(buf, rc)) == NULL) { logerr("%s: could not memdup %d bytes", __func__, rc); return -1; } readbuf_len = rc; } else { if((tmp = realloc(readbuf, readbuf_len + rc)) != NULL) { readbuf = tmp; memcpy(readbuf+readbuf_len, buf, rc); readbuf_len += rc; } else { logerr("%s: could not realloc %d bytes",__func__,readbuf_len+rc); return -1; } } } else if(rc == 0) { logprint("disconnected\n"); close(scamper_fd); scamper_fd = -1; close(decode_out_fd); decode_out_fd = -1; return 0; } else if(errno == EINTR || errno == EAGAIN) { return 0; } else { logerr("could not read: errno %d\n", errno); return -1; } /* process whatever is in the readbuf */ if(readbuf_len == 0) return 0; head = readbuf; for(i=0; i 0) { uus = sizeof(uu); if(uudecode_line(head, linelen, uu, &uus) != 0) { logerr("could not uudecode_line\n"); return -1; } if(uus != 0) write_wrap(decode_out_fd, uu, NULL, uus); data_left -= (linelen + 1); } /* if the scamper process is asking for more tasks, give it more */ else if(linelen == 4 && strncasecmp(head, "MORE", linelen) == 0) { more++; if(do_method() != 0) return -1; } /* new piece of data */ else if(linelen > 5 && strncasecmp(head, "DATA ", 5) == 0) { l = strtol(head+5, &ptr, 10); if(*ptr != '\n' || l < 1) { head[linelen] = '\0'; logerr("could not parse %s\n", head); return -1; } data_left = l; } /* feedback letting us know that the command was accepted */ else if(linelen >= 2 && strncasecmp(head, "OK", 2) == 0) { /* nothing to do */ } /* feedback letting us know that the command was not accepted */ else if(linelen >= 3 && strncasecmp(head, "ERR", 3) == 0) { logerr("got error\n"); return -1; } else { head[linelen] = '\0'; logerr("unknown response '%s'\n", head); return -1; } head = &readbuf[i+1]; } } if(head != &readbuf[readbuf_len]) { readbuf_len = &readbuf[readbuf_len] - head; ptr = memdup(head, readbuf_len); free(readbuf); readbuf = ptr; } else { readbuf_len = 0; free(readbuf); readbuf = NULL; } return 0; } static int do_scamperconnect(void) { struct sockaddr_un sun; struct sockaddr_in sin; struct in_addr in; if(options & OPT_PORT) { inet_aton("127.0.0.1", &in); sockaddr_compose((struct sockaddr *)&sin, AF_INET, &in, port); if((scamper_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { logerr("%s: could not inet socket: %s\n", __func__, strerror(errno)); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sin, sizeof(sin)) != 0) { logerr("%s: could not inet connect: %s\n", __func__, strerror(errno)); return -1; } return 0; } else if(options & (OPT_UNIX | OPT_REMOTE)) { if(sockaddr_compose_un((struct sockaddr *)&sun, unix_name) != 0) { logerr("could not build sockaddr_un\n"); return -1; } if((scamper_fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { logerr("%s: could not unix socket: %s\n", __func__, strerror(errno)); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sun, sizeof(sun)) != 0) { logerr("%s: could not unix connect: %s\n", __func__, strerror(errno)); return -1; } return 0; } return -1; } static int delegated_line(char *line, void *param) { sc_delegated_t *del = NULL; char *ptr, *net, *size; long lo; if(line[0] == '#') return 0; /* skip over RIR label */ ptr = line; while(*ptr != '|' && *ptr != '\0') ptr++; if(*ptr == '\0') return -1; ptr++; /* skip over country label */ while(*ptr != '|' && *ptr != '\0') ptr++; if(*ptr == '\0') return -1; ptr++; /* make sure this is an IPv4 record */ if(strncasecmp(ptr, "ipv4|", 5) != 0) return 0; ptr += 5; /* got to the network part. null terminate at the | */ net = ptr; while(*ptr != '|' && *ptr != '\0') ptr++; if(*ptr == '\0') return -1; *ptr = '\0'; ptr++; /* got to the size part. null terminate at the | */ size = ptr; while(*ptr != '|' && *ptr != '\0') ptr++; if(*ptr == '\0') return -1; *ptr = '\0'; ptr++; if(string_tolong(size, &lo) != 0) return -1; /* skip over date part */ while(*ptr != '|' && *ptr != '\0') ptr++; if(*ptr == '\0') return -1; ptr++; /* ensure the block is either allocated or assigned */ if(strncasecmp(ptr,"allocated",9) != 0 && strncasecmp(ptr,"assigned",8) != 0) return 0; if((del = malloc(sizeof(sc_delegated_t))) == NULL) return -1; if(inet_pton(AF_INET, net, &del->x) != 1) goto err; del->y.s_addr = htonl(ntohl(del->x.s_addr) + lo); if(slist_tail_push(delegated, del) == NULL) goto err; return 0; err: if(del != NULL) free(del); return -1; } static int ip2name_line(char *line, void *param) { scamper_addr_t sa; sc_addr2name_t *a2n; struct in_addr in; struct in6_addr in6; char *ip, *name; if(line[0] == '#') return 0; ip = line; name = line; while(isspace(*name) == 0 && *name != '\0') name++; if(*name == '\0') return 0; *name = '\0'; name++; while(isspace(*name) != 0) name++; if(af == AF_INET) { if(inet_pton(AF_INET, ip, &in) != 1) return -1; sa.type = SCAMPER_ADDR_TYPE_IPV4; sa.addr = ∈ if(scamper_addr_isreserved(&sa)) return 0; } else { if(inet_pton(AF_INET6, ip, &in6) != 1) return -1; sa.type = SCAMPER_ADDR_TYPE_IPV6; sa.addr = &in6; if(scamper_addr_isreserved(&sa)) return 0; } /* skip over duplicate entry */ if(sc_addr2name_find(&sa) != NULL) return 0; if((a2n = malloc_zero(sizeof(sc_addr2name_t))) == NULL || (a2n->addr = scamper_addr_alloc(sa.type, sa.addr)) == NULL || (a2n->name = strdup(name)) == NULL || splaytree_insert(ip2name_tree, a2n) == NULL) { if(a2n != NULL) sc_addr2name_free(a2n); return -1; } return 0; } static int ip2as_line(char *line, void *param) { slist_t **lists = param; scamper_addr_t sa; sc_prefix_t *p = NULL; char *n, *m, *a, *at; struct in_addr in; struct in6_addr in6; uint32_t u32, *ases = NULL; int asc = 0, last = 0; long lo; if(line[0] == '#') return 0; n = line; m = line; while(isspace(*m) == 0 && *m != '\0') m++; if(*m == '\0') return -1; *m = '\0'; m++; while(isspace(*m) != 0) m++; if(string_tolong(m, &lo) != 0) return -1; a = m; while(isspace(*a) == 0 && *a != '\0') a++; if(*a == '\0') return -1; *a = '\0'; a++; while(isspace(*a) != 0) a++; if(af == AF_INET) { if(lo < IPV4_PREFIX_MIN || lo > IPV4_PREFIX_MAX) return 0; if(inet_pton(AF_INET, n, &in) != 1) return -1; sa.type = SCAMPER_ADDR_TYPE_IPV4; sa.addr = ∈ if(scamper_addr_isreserved(&sa)) return 0; if((p = sc_prefix_alloc(&in, lo)) == NULL) goto err; } else { if(lo < IPV6_PREFIX_MIN || lo > IPV6_PREFIX_MAX) return 0; if(inet_pton(AF_INET6, n, &in6) != 1) return -1; sa.type = SCAMPER_ADDR_TYPE_IPV6; sa.addr = &in6; if(scamper_addr_isreserved(&sa)) return 0; if((p = sc_prefix_alloc(&in6, lo)) == NULL) goto err; } for(at = a; last == 0; at++) { if(*at != '_' && *at != ',' && *at != ' ' && *at != '\0') continue; if(*at == ' ' || *at == '\0') last = 1; *at = '\0'; u32 = atoi(a); /* skip over private / reserved ASNs */ if(u32 == 0 || u32 == 23456 || (u32 >= 64512 && u32 <= 65535) || u32 >= 4200000000) continue; if(uint32_add(&ases, &asc, u32) != 0) goto err; a = at + 1; } /* if the prefix was only announced by a private ASN, skip over it */ if(asc == 0) { sc_prefix_free(p); return 0; } if((af == AF_INET && slist_tail_push(lists[lo-IPV4_PREFIX_MIN],p) == NULL) || (af == AF_INET6 && slist_tail_push(lists[lo-IPV6_PREFIX_MIN],p) == NULL)) goto err; qsort(ases, asc, sizeof(uint32_t), uint32_cmp); if((p->asmap = sc_asmap_get(ases, asc)) == NULL) goto err; free(ases); return 0; err: if(ases != NULL) free(ases); if(p != NULL) sc_prefix_free(p); return -1; } static int relfile_line(char *line, void *param) { static int linec = 0; char *as, *bs, *rs; long a, b, r; linec++; if(line[0] == '#') return 0; as = line; string_nullterm_char(as, '|', &bs); if(bs == NULL) { printf("line %d malformed\n", linec); return -1; } string_nullterm_char(bs, '|', &rs); if(rs == NULL) { printf("line %d malformed\n", linec); return -1; } if(string_isnumber(as) == 0 || string_isnumber(bs) == 0 || string_isnumber(rs) == 0 || string_tolong(as, &a) != 0 || a < 1 || string_tolong(bs, &b) != 0 || b < 1 || string_tolong(rs, &r) != 0 || r < -1 || r > 1) { printf("line %d %s %s %s\n", linec, as, bs, rs); return -1; } if(sc_asrel_add(a, b, r) != 0) { printf("line %d %u %u %d\n", linec, (uint32_t)a, (uint32_t)b, (int)r); return -1; } if(r == -1) { if(sc_prov_add(b, a) != 0) return -1; } else if(r == 1) { if(sc_prov_add(a, b) != 0) return -1; } return 0; } static int vpas_line(char *line, void *param) { long lo; if(string_tolong(line, &lo) != 0 || lo < 1 || uint32_add(&vpas, &vpasc, lo) != 0) return -1; return 0; } static int do_targetips(void) { splaytree_t *astraces = NULL; sc_astraces_t *traces = NULL; struct in6_addr in6; struct in_addr in; sc_prefix_t *pfx; void *addr; int i, rc; if((astraces = splaytree_alloc((splaytree_cmp_t)sc_astraces_cmp)) == NULL) goto err; for(i=0; iasmap)) { fprintf(stderr, "address %s is announced by the VP\n", opt_args[i]); goto err; } if((traces = sc_astraces_get(astraces, pfx->asmap)) == NULL) goto err; sc_astraces_dst_add(traces, addr); } splaytree_inorder(astraces, tree_to_slist, virgin); splaytree_free(astraces, NULL); return 0; err: if(astraces != NULL) splaytree_free(astraces, NULL); return -1; } static int do_targetases(void) { long lo; int i; for(i=0; i= 0) { fprintf(stderr, "%ld is also a VP ASN\n", lo); return -1; } if(uint32_add(&targetas, &targetasc, lo) != 0) { fprintf(stderr, "could not add %ld to targetas set\n", lo); return -1; } } qsort(targetas, targetasc, sizeof(uint32_t), uint32_cmp); return 0; } static int do_vpas(void) { struct stat sb; char *vp = NULL, *cur, *next; long lo; if(stat(vpas_str, &sb) == 0) { if(file_lines(vpas_str, vpas_line, NULL) != 0) { fprintf(stderr, "could not read file %s\n", vpas_str); goto err; } } else { if((vp = strdup(vpas_str)) == NULL) { fprintf(stderr, "could not dup vpas_str: %s\n", strerror(errno)); goto err; } cur = vp; while(cur != NULL) { string_nullterm_char(cur, ',', &next); if(string_tolong(cur, &lo) != 0 || lo < 1 || uint32_add(&vpas, &vpasc, lo) != 0) { fprintf(stderr, "malformed -v %s: not a file or set of ASes\n", vpas_str); goto err; } cur = next; } free(vp); vp = NULL; } return 0; err: if(vp != NULL) free(vp); return -1; } static int rec_target_4(sc_prefix_nest_t *nest, struct in_addr *in) { static const uint32_t add[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 8388608, 4194304, 2097152, 1048576, 524288, 262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, }; sc_prefix_nest_t *nest2; slist_node_t *sn; uint32_t x, y, f = ntohl(nest->pfx->pfx.v4->net.s_addr); /* if there are no nested prefixes, pick the first address in the prefix */ if(nest->list == NULL) { in->s_addr = htonl(f+1); return 1; } /* find address in the prefix not covered by a more specific */ x = f; slist_qsort(nest->list, (slist_cmp_t)sc_prefix_nest_cmp); for(sn = slist_head_node(nest->list); sn != NULL; sn = slist_node_next(sn)) { nest2 = slist_node_item(sn); y = ntohl(nest2->pfx->pfx.v4->net.s_addr); if(y != x) { in->s_addr = htonl(x+1); return 1; } x += add[nest2->pfx->pfx.v4->len]; } /* if there is uncovered space at the top of the prefix then use that */ if(sn == NULL && x < f + add[nest->pfx->pfx.v4->len]) { in->s_addr = htonl(x+1); return 1; } return 0; } static int add6(struct in6_addr *in, int bitlen) { static const uint8_t add[] = {0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01}; int j = (bitlen-1) / 8; int k = (bitlen-1) % 8; if(((int)in->s6_addr[j]) + add[k] <= 255) { in->s6_addr[j] += add[k]; return 0; } in->s6_addr[j--] = 0; while(j >= 0) { if(in->s6_addr[j] < 255) break; in->s6_addr[j--] = 0; } if(j < 0) return -1; in->s6_addr[j]++; return 0; } static int rec_target_6(sc_prefix_nest_t *nest, struct in6_addr *in) { sc_prefix_nest_t *nest2; struct in6_addr f, x, y; slist_node_t *sn; /* if there are no nested prefixes, pick the first address in the prefix */ if(nest->list == NULL) { memcpy(in, &nest->pfx->pfx.v6->net, sizeof(struct in6_addr)); in->s6_addr[15] = 1; return 1; } /* find address in the prefix not covered by a more specific */ memcpy(&x, &nest->pfx->pfx.v6->net, sizeof(struct in6_addr)); slist_qsort(nest->list, (slist_cmp_t)sc_prefix_nest_cmp); for(sn = slist_head_node(nest->list); sn != NULL; sn = slist_node_next(sn)) { nest2 = slist_node_item(sn); memcpy(&y, &nest2->pfx->pfx.v6->net, sizeof(struct in6_addr)); if(memcmp(&x, &y, sizeof(struct in6_addr)) != 0) { memcpy(in, &x, sizeof(struct in6_addr)); in->s6_addr[15] = 1; return 1; } add6(&x, nest2->pfx->pfx.v6->len); } /* if there is uncovered space at the top of the prefix then use that */ memcpy(&f, &nest->pfx->pfx.v6->net, sizeof(struct in6_addr)); add6(&f, nest->pfx->pfx.v6->len); if(sn == NULL && addr6_cmp(&x, &f) < 0) { memcpy(in, &x, sizeof(struct in6_addr)); in->s6_addr[15] = 1; return 1; } return 0; } static int do_targets_rec(slist_t *list, splaytree_t *astraces) { int i, j, probe; sc_prefix_nest_t *nest; sc_astraces_t *traces; struct in_addr in; struct in6_addr in6; slist_node_t *sn; void *ptr; for(sn = slist_head_node(list); sn != NULL; sn = slist_node_next(sn)) { nest = slist_node_item(sn); ptr = NULL; if(af == AF_INET) { if(rec_target_4(nest, &in) == 1) ptr = ∈ } else { if(rec_target_6(nest, &in6) == 1) ptr = &in6; } if(ptr != NULL) { probe = 0; if(targetasc > 0) { for(i=0; ipfx->asmap->asc && probe == 0; j++) if(targetas[i] == nest->pfx->asmap->ases[j]) probe = 1; } else { if(sc_asmap_isvp(nest->pfx->asmap) == 0) { assert(nest->pfx == sc_prefix_find_in(ptr)); probe = 1; } } if(probe != 0) { if((traces = sc_astraces_get(astraces, nest->pfx->asmap)) == NULL) return -1; sc_astraces_dst_add(traces, ptr); } } if(nest->list != NULL) do_targets_rec(nest->list, astraces); } return 0; } /* * do_targets * * go through the list of prefixes nesting prefixes enclosed in a less * specific prefix. the prefixes list is sorted from less to more * specific prefix. the actual target list creation is done in * do_targets_rec, which recurses through the nested prefixes. * */ static int do_targets(void) { splaytree_t *astracestree = NULL; sc_prefix_nest_t *nest; prefixtree_t *tree = NULL; prefix4_t *p4; prefix6_t *p6; slist_node_t *sn; sc_prefix_t *pfx; slist_t *root = NULL; int count = 0; if((tree = prefixtree_alloc(af)) == NULL || (root = slist_alloc()) == NULL) goto err; for(sn = slist_head_node(prefixes); sn != NULL; sn = slist_node_next(sn)) { pfx = slist_node_item(sn); if(af == AF_INET) { /* if there is no enclosing prefix, this is a root prefix */ if((p4 = prefixtree_find_best4(tree, pfx->pfx.v4)) == NULL) { if((p4 = prefix4_dup(pfx->pfx.v4)) == NULL || prefixtree_insert4(tree, p4) == NULL || (p4->ptr = sc_prefix_nest_alloc(pfx)) == NULL || slist_tail_push(root, p4->ptr) == NULL) goto err; continue; } nest = p4->ptr; } else { if((p6 = prefixtree_find_best6(tree, pfx->pfx.v6)) == NULL) { if((p6 = prefix6_dup(pfx->pfx.v6)) == NULL || prefixtree_insert6(tree, p6) == NULL || (p6->ptr = sc_prefix_nest_alloc(pfx)) == NULL || slist_tail_push(root, p6->ptr) == NULL) goto err; continue; } nest = p6->ptr; } /* go through all nested prefixes until we get to the last one */ while(nest != NULL) { /* create a prefixtree as needed */ if(nest->pt == NULL) { if((nest->pt = prefixtree_alloc(af)) == NULL || (nest->list = slist_alloc()) == NULL) goto err; } if(af == AF_INET) { if((p4 = prefixtree_find_best4(nest->pt, pfx->pfx.v4)) == NULL) break; nest = p4->ptr; } else { if((p6 = prefixtree_find_best6(nest->pt, pfx->pfx.v6)) == NULL) break; nest = p6->ptr; } } if(af == AF_INET) { if((p4 = prefix4_dup(pfx->pfx.v4)) == NULL || prefixtree_insert4(nest->pt, p4) == NULL || (p4->ptr = sc_prefix_nest_alloc(pfx)) == NULL || slist_tail_push(nest->list, p4->ptr) == NULL) goto err; } else { if((p6 = prefix6_dup(pfx->pfx.v6)) == NULL || prefixtree_insert6(nest->pt, p6) == NULL || (p6->ptr = sc_prefix_nest_alloc(pfx)) == NULL || slist_tail_push(nest->list, p6->ptr) == NULL) goto err; } } if((astracestree = splaytree_alloc((splaytree_cmp_t)sc_astraces_cmp)) == NULL) goto err; do_targets_rec(root, astracestree); while((nest = slist_head_pop(root)) != NULL) sc_prefix_nest_free(nest); slist_free(root); root = NULL; if(af == AF_INET) prefixtree_free_cb(tree, (prefix_free_t)prefix4_free); else prefixtree_free_cb(tree, (prefix_free_t)prefix6_free); tree = NULL; splaytree_inorder(astracestree, tree_to_slist, virgin); splaytree_free(astracestree, NULL); astracestree = NULL; slist_foreach(virgin, (slist_foreach_t)sc_astraces_count, &count); printf("count %d\n", count); if(impatient) slist_qsort(virgin, (slist_cmp_t)sc_astraces_count_cmp); else slist_shuffle(virgin); slist_foreach(virgin, (slist_foreach_t)sc_astraces_shuffle, NULL); return 0; err: return -1; } static int do_ip2as(void) { slist_node_t *sn; sc_prefix_t *p; slist_t **lists; int i, j; if((asmaptree = splaytree_alloc((splaytree_cmp_t)sc_asmap_cmp)) == NULL) goto err; if(af == AF_INET) j = IPV4_PREFIX_MAX - IPV4_PREFIX_MIN + 1; else j = IPV6_PREFIX_MAX - IPV6_PREFIX_MIN + 1; if((lists = malloc_zero(sizeof(slist_t *) * j)) == NULL) goto err; for(i=0; ipfx.v4) == NULL) || (af == AF_INET6 && prefixtree_insert6(ip2as_pt,p->pfx.v6) == NULL)) goto err; } return 0; err: fprintf(stderr, "could not load ip2as\n"); return -1; } static int ixp_line(char *line, void *param) { struct addrinfo hints, *res, *res0; prefix4_t *p4; prefix6_t *p6; char *pf; void *va; long lo; if(line[0] == '#') return 0; string_nullterm_char(line, '/', &pf); if(pf == NULL) return -1; string_nullterm_char(pf, ' ', NULL); if(string_tolong(pf, &lo) != 0 || lo < 0) return -1; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = IPPROTO_UDP; hints.ai_family = AF_UNSPEC; if(getaddrinfo(line, NULL, &hints, &res0) != 0 || res0 == NULL) return -1; for(res = res0; res != NULL; res = res->ai_next) { if(res->ai_family == PF_INET) { if(af != AF_INET) break; va = &((struct sockaddr_in *)res->ai_addr)->sin_addr; if((p4 = prefix4_alloc(va, lo, NULL)) == NULL) return -1; p4->ptr = p4; if(prefixtree_insert4(ixp_pt, p4) == NULL) return -1; break; } else if(res->ai_family == PF_INET6) { if(af != AF_INET6) break; va = &((struct sockaddr_in6 *)res->ai_addr)->sin6_addr; if((p6 = prefix6_alloc(va, lo, NULL)) == NULL) return -1; p6->ptr = p6; if(prefixtree_insert6(ixp_pt, p6) == NULL) return -1; break; } } freeaddrinfo(res0); return 0; } static int do_ixp(void) { if((ixp_pt = prefixtree_alloc(af)) == NULL) return -1; if(file_lines(ixp_fn, ixp_line, NULL) != 0) { logerr("could not read %s\n", ixp_fn); return -1; } return 0; } static int bdrmap_data(void) { struct timeval tv, *tv_ptr; sc_waittest_t *wait; sc_test_t *test; fd_set rfds; int pair[2]; int nfds, rc = -1; gettimeofday_wrap(&tv); srandom(tv.tv_usec); if((targets = splaytree_alloc((splaytree_cmp_t)sc_target_cmp)) == NULL || (links = splaytree_alloc((splaytree_cmp_t)sc_link_cmp)) == NULL || (pings = splaytree_alloc((splaytree_cmp_t)sc_ping_cmp)) == NULL || (virgin = slist_alloc()) == NULL || (waiting = heap_alloc(sc_waittest_cmp)) == NULL) goto done; if(options & OPT_TARGETIPS) { if(do_targetips() != 0) goto done; } else { if((options & OPT_TARGETASES) && do_targetases() != 0) goto done; if(do_targets() != 0) goto done; } if(do_scamperconnect() != 0 || (outfile = scamper_file_open(outfile_fn, 'w', "warts")) == NULL || socketpair(AF_UNIX, SOCK_STREAM, 0, pair) != 0) goto done; decode_in_fd = pair[0]; decode_out_fd = pair[1]; decode_in = scamper_file_openfd(decode_in_fd, NULL, 'r', "warts"); if(decode_in == NULL) goto done; if(fcntl_set(decode_in_fd, O_NONBLOCK) == -1) goto done; if((options & OPT_REMOTE) == 0 && write_wrap(scamper_fd, "attach\n", NULL, 7) != 0) { logerr("could not attach to scamper process\n"); goto done; } for(;;) { nfds = 0; FD_ZERO(&rfds); if(scamper_fd < 0 && decode_in_fd < 0) { rc = 0; break; } if(scamper_fd >= 0) { FD_SET(scamper_fd, &rfds); if(nfds < scamper_fd) nfds = scamper_fd; } if(decode_in_fd >= 0) { FD_SET(decode_in_fd, &rfds); if(nfds < decode_in_fd) nfds = decode_in_fd; } /* * need to set a timeout on select if scamper's processing window is * not full and there is a trace in the waiting queue. */ tv_ptr = NULL; if(more > 0) { gettimeofday_wrap(&now); /* * if there is something ready to probe now, then try and * do it. */ wait = heap_head_item(waiting); if(slist_count(virgin) > 0 || (wait != NULL && timeval_cmp(&wait->tv, &now) <= 0)) { if(do_method() != 0) break; } /* * if we could not send a new command just yet, but scamper * wants one, then wait for an appropriate length of time. */ wait = heap_head_item(waiting); if(more > 0 && tv_ptr == NULL && wait != NULL) { tv_ptr = &tv; if(timeval_cmp(&wait->tv, &now) > 0) timeval_diff_tv(&tv, &now, &wait->tv); else memset(&tv, 0, sizeof(tv)); } } if(splaytree_count(targets) == 0 && slist_count(virgin) == 0 && heap_count(waiting) == 0) { logprint("done\n"); rc = 0; break; } if(select(nfds+1, &rfds, NULL, NULL, tv_ptr) < 0) { if(errno == EINTR) continue; logerr("select error\n"); break; } gettimeofday_wrap(&now); if(more > 0 && do_method() != 0) break; if(scamper_fd >= 0 && FD_ISSET(scamper_fd, &rfds)) { if(do_scamperread() != 0) break; } if(decode_in_fd >= 0 && FD_ISSET(decode_in_fd, &rfds)) { if(do_decoderead() != 0) break; } } done: if(targetas != NULL) free(targetas); if(targets != NULL) splaytree_free(targets, NULL); if(virgin != NULL) { while((test = slist_head_pop(virgin)) != NULL) { sc_tracetest_free(test->data); sc_test_free(test); } slist_free(virgin); } if(waiting != NULL) heap_free(waiting, NULL); if(outfile != NULL) scamper_file_close(outfile); if(decode_in != NULL) scamper_file_close(decode_in); if(logfile != NULL) fclose(logfile); return rc; } typedef struct sc_link4 { uint8_t ttl; /* minimum distance in path link was observed */ sc_stree_t *dstases; /* ASes link was seen in path towards */ sc_stree_t *adjases; /* ASes for next hops when Y is unannounced space */ sc_stree_t *gapases; /* ASes for next hops when gap after Y */ } sc_link4_t; static sc_link4_t *sc_link4_alloc(void) { sc_link4_t *l4 = NULL; if((l4 = malloc_zero(sizeof(sc_link4_t))) == NULL || (l4->dstases=sc_stree_alloc((splaytree_cmp_t)sc_asmapc_as_cmp)) == NULL) return NULL; return l4; } static void sc_link4_free(sc_link4_t *l4) { if(l4 == NULL) return; if(l4->dstases != NULL) sc_stree_free(l4->dstases, (sc_stree_free_t)sc_asmapc_free); if(l4->adjases != NULL) sc_stree_free(l4->adjases, (sc_stree_free_t)sc_asmapc_free); if(l4->gapases != NULL) sc_stree_free(l4->gapases, (sc_stree_free_t)sc_asmapc_free); free(l4); return; } static void sc_link_free_link4(sc_link_t *link) { if(link == NULL) return; if(link->data != NULL) sc_link4_free(link->data); sc_link_free(link); return; } static int sc_link4_addadj(sc_link4_t *l4, sc_prefix_t *pfx) { sc_asmapc_t *asmapc; if(l4->adjases == NULL && (l4->adjases = sc_stree_alloc((splaytree_cmp_t)sc_asmapc_as_cmp)) == NULL) return -1; if((asmapc = sc_asmapc_get(l4->adjases, pfx->asmap)) == NULL) return -1; asmapc->c++; return 0; } static int sc_link4_addgap(sc_link4_t *l4, sc_prefix_t *pfx) { sc_asmapc_t *asmapc; if(l4->gapases == NULL && (l4->gapases = sc_stree_alloc((splaytree_cmp_t)sc_asmapc_as_cmp)) == NULL) return -1; if((asmapc = sc_asmapc_get(l4->gapases, pfx->asmap)) == NULL) return -1; asmapc->c++; return 0; } static int init_1(void) { rtrset = sc_routerset_alloc(); links = splaytree_alloc((splaytree_cmp_t)sc_link_cmp); tracesets = splaytree_alloc((splaytree_cmp_t)sc_traceset_cmp); held = slist_alloc(); return 0; } static int process_1_dealias(scamper_dealias_t *dealias) { scamper_dealias_prefixscan_t *pfs; scamper_dealias_ally_t *ally; scamper_dealias_probe_t *probe; scamper_dealias_reply_t *reply; scamper_addr_t *a, *b; sc_link_t *link; sc_ally_t *ar; uint32_t i; int ok, rc = -1; if(SCAMPER_DEALIAS_METHOD_IS_PREFIXSCAN(dealias)) { pfs = dealias->data; if(pfs->ab != NULL && scamper_addr_prefixhosts(pfs->b, pfs->ab) >= 30) { if((link = sc_link_get(pfs->a, pfs->b)) == NULL) goto done; if((pfs->flags & SCAMPER_DEALIAS_PREFIXSCAN_FLAG_CSA) != 0) { if(sc_routerset_getpair(rtrset, pfs->a, pfs->ab) == NULL) goto done; } else { if((ar = sc_ally_get(pfs->a, pfs->ab)) == NULL) goto done; if(ar->result != SCAMPER_DEALIAS_RESULT_NOTALIASES) ar->result = SCAMPER_DEALIAS_RESULT_ALIASES; } } /* * check for unreachable port responses that suggest might be useful * to build routers with using CSA. */ if(pfs->probedefc > 0 && SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP(&pfs->probedefs[0])) { for(i=0; iprobec; i++) { probe = dealias->probes[i]; if(probe->replyc == 0) continue; reply = probe->replies[0]; if(SCAMPER_DEALIAS_REPLY_IS_ICMP_UNREACH_PORT(reply) == 0 || scamper_addr_cmp(reply->src, probe->def->dst) == 0 || scamper_addr_isreserved(reply->src) != 0 || sc_link_find(probe->def->dst, reply->src) != NULL || sc_link_find(reply->src, probe->def->dst) != NULL) continue; if((scamper_addr_cmp(probe->def->dst, pfs->a) == 0 || scamper_addr_prefixhosts(pfs->b, probe->def->dst) >= 30) && sc_routerset_getpair(rtrset,probe->def->dst,reply->src) == NULL) goto done; } } rc = 0; } else if(SCAMPER_DEALIAS_METHOD_IS_ALLY(dealias)) { ally = dealias->data; ok = 0; ar = NULL; if(ally->probedefs[0].ttl == 255) { a = ally->probedefs[0].dst; b = ally->probedefs[1].dst; ok = 1; } else { for(i=0; iprobec; i++) { if(dealias->probes[i] == NULL || dealias->probes[i]->replyc == 0) break; if(scamper_addr_cmp(dealias->probes[i%2]->replies[0]->src, dealias->probes[i]->replies[0]->src) != 0) break; } if(i == dealias->probec && i >= 2 && scamper_addr_cmp(dealias->probes[0]->replies[0]->src, dealias->probes[1]->replies[0]->src) != 0) { ok = 1; a = dealias->probes[0]->replies[0]->src; b = dealias->probes[1]->replies[0]->src; } } if(ok && (ar = sc_ally_get(a, b)) == NULL) goto done; if(ar != NULL && (ar->result == SCAMPER_DEALIAS_RESULT_NONE || dealias->result == SCAMPER_DEALIAS_RESULT_NOTALIASES)) ar->result = dealias->result; rc = 0; } else { rc = 0; } done: scamper_dealias_free(dealias); return rc; } static sc_link_t *process_1_link(scamper_trace_hop_t *x, scamper_trace_hop_t *y, sc_asmap_t *dst) { sc_link_t *link; sc_link4_t *link4; sc_asmapc_t *asmapc; /* get a link for this hop, to be further annotated */ if((link = sc_link_get(x->hop_addr, y->hop_addr)) == NULL) return NULL; if((link4 = link->data) == NULL) { if((link4 = sc_link4_alloc()) == NULL) return NULL; link->data = link4; link4->ttl = x->hop_probe_ttl; } /* * record the earliest distance in a path the link was seen, * to help with later processing the links in topological order */ if(link4->ttl > x->hop_probe_ttl) link4->ttl = x->hop_probe_ttl; /* * keep a track of which networks were seen when tracing through * this link */ if((asmapc = sc_asmapc_get(link4->dstases, dst)) == NULL) return NULL; asmapc->c++; return link; } /* * process_1_trace_unrouted * * take a pass through the traceroute, marking unrouted address space * as belonging to the VP if it is found in a path ahead of other VP * address space. * * -1: error condition, sc_bdrmap should halt. * 0: no unrouted address space, process the trace. * 1: unrouted address space, but origin not determined yet. * 2: inferred some address space was announced by VP. */ static int process_1_trace_unrouted(scamper_trace_t *trace, int lh) { scamper_trace_hop_t *x; scamper_addr_t *addr; sc_delegated_t *dg; slist_t *list = NULL; sc_prefix_t *pfx; uint32_t as = vpas[0]; int i, vp, modified = 0, rc = -1; uint8_t netlen; /* * make an initial pass through to flag any unrouted addresses with * an inferred AS if they are internal VP addresses */ if((list = slist_alloc()) == NULL) goto done; for(i=trace->firsthop-1; ihops[i]) == NULL) continue; /* if we have come to an external hop, stop */ if((vp = is_vp(x->hop_addr)) == 0) break; /* * if this is a VP hop, and there are unrouted addresses in previous * hops, then manually create a prefix for them now */ if(vp == 1 && slist_count(list) > 0) { while((addr = slist_head_pop(list)) != NULL) { if(sc_prefix_find_in(addr->addr) != NULL) continue; if((dg = sc_delegated_find(addr)) != NULL && (netlen = sc_delegated_netlen(dg)) != 0) { pfx = sc_prefix_alloc(&dg->x, netlen); } else { pfx = sc_prefix_alloc(addr->addr, af == AF_INET ? 32 : 128); } if(pfx == NULL) goto done; if((pfx->asmap = sc_asmap_get(&as, 1)) == NULL) goto done; if(af == AF_INET) { if(prefixtree_insert4(ip2as_pt, pfx->pfx.v4) == NULL) goto done; } else { if(prefixtree_insert6(ip2as_pt, pfx->pfx.v6) == NULL) goto done; } if(slist_tail_push(prefixes, pfx) == NULL) goto done; modified = 1; } slist_empty(list); } else { /* * we do not know if this is a VP hop, but we know that it is not * an IXP hop or using reserved IP addresses, so infer that it * is */ if(is_ixp(x->hop_addr) == 0 && is_reserved(x->hop_addr) == 0 && slist_tail_push(list, x->hop_addr) == NULL) goto done; } } if(modified != 0) rc = 2; else if(slist_count(list) > 0) rc = 1; else rc = 0; done: slist_free(list); list = NULL; return rc; } static int process_1_trace_work(scamper_trace_t *trace, int lh) { scamper_trace_hop_t *x, *y, *z; sc_traceset_t *ts; sc_link_t *link; sc_link4_t *link4; sc_prefix_t *dst, *pfx; int i, j, r, vp, ttlnn = 0; uint32_t asn, sib; /* get the target prefix to annotate links with */ if((dst = sc_prefix_find(trace->dst)) == NULL) return 0; for(i=trace->firsthop-1; ihops[i]) == NULL || (y = trace->hops[i+1]) == NULL || scamper_addr_cmp(x->hop_addr, y->hop_addr) == 0 || SCAMPER_TRACE_HOP_IS_ICMP_TTL_EXP(x) == 0 || SCAMPER_TRACE_HOP_IS_ICMP_TTL_EXP(y) == 0 || scamper_addr_cmp(y->hop_addr, trace->dst) == 0 || scamper_addr_isreserved(x->hop_addr) || scamper_addr_isreserved(y->hop_addr)) continue; /* * do not form a link between X and Y if Y and Z are the same * address as that implies X and Y are not adjacent, because of * zero-ttl forwarding or similar at the hop for Y. note that * we do not check quoted TTL values as we see these cases where * the TTL is not zero at hop Z. */ if(i < lh-2 && (z = trace->hops[i+2]) != NULL && scamper_addr_cmp(y->hop_addr, z->hop_addr) == 0 && SCAMPER_TRACE_HOP_IS_ICMP_TTL_EXP(z)) continue; /* * stop as soon as we encounter an address from outside of this * network's address space. */ if(is_vp(x->hop_addr) == 0) { ttlnn = 1; break; } /* get a link for the hop, annotated with the destinations probed */ if((link = process_1_link(x, y, dst->asmap)) == NULL) return -1; link4 = link->data; /* * if Y is not announced by the VP, or is unannounced/reserved * address space, then annotate the link with information on the * first hop past the address space that is announced by some * network */ vp = is_vp(y->hop_addr); if(vp == 0 || (vp == 2 && is_ixp(y->hop_addr) == 0)) { for(j=i+2; jhops[j]) == NULL || SCAMPER_TRACE_HOP_IS_ICMP_TTL_EXP(z) == 0 || scamper_addr_isreserved(z->hop_addr) || (pfx = sc_prefix_find(z->hop_addr)) == NULL) continue; if(sc_link4_addadj(link4, pfx) != 0) return -1; break; } if(vp == 0) { ttlnn = 1; break; } } /* * if there is a gap in this trace at the next hop, make a note * of the AS seen next */ if(i+2 < lh && trace->hops[i+2] == NULL) { for(j = i+2; j < lh; j++) { if((z = trace->hops[j]) != NULL) { if((pfx = sc_prefix_find(z->hop_addr)) != NULL && sc_link4_addgap(link4, pfx) != 0) return -1; break; } } } } /* * if there was no TTL expired message in the neighbor network, * and the traceroute was towards a known peer or customer, then * save the trace for possible use later */ if(ttlnn == 0 && asmap_r(dst->asmap, &sib, &asn, &r) == 0 && r != 1) { if((ts = sc_traceset_get(asn)) == NULL) return -1; if(slist_tail_push(ts->list, trace) == NULL) return -1; return 1; } return 0; } static int process_1_trace(scamper_trace_t *trace) { slist_t *tmp; int rc, lh; /* * check to see if this traceroute should be included in border map * construction: i.e. make sure the traceroute is not towards an address * in the VP's network, and the path is trustworthy */ if(is_vp(trace->dst) != 0 || (lh = trace_lasthop(trace)) == 0) { scamper_trace_free(trace); return 0; } /* * ensure any unrouted address space is handled early. * if there is no unrouted space to take care of (rc == 0) then * process the trace and be done. otherwise, put it on a list * to process later. */ if((rc = process_1_trace_unrouted(trace, lh)) < 0) { scamper_trace_free(trace); return -1; } if(rc != 0) { /* process the trace later */ if(slist_tail_push(held, trace) == NULL) { scamper_trace_free(trace); return -1; } /* if the address space was not modified, continue onwards */ if(rc == 1) return 0; if((tmp = slist_alloc()) == NULL) return -1; while((trace = slist_head_pop(held)) != NULL) { if((lh = trace_lasthop(trace)) == 0) { scamper_trace_free(trace); continue; } if((rc = process_1_trace_unrouted(trace, lh)) < 0) { scamper_trace_free(trace); return -1; } if(rc == 0) { if((rc = process_1_trace_work(trace, lh)) < 0) { scamper_trace_free(trace); return -1; } if(rc == 0) scamper_trace_free(trace); continue; } slist_tail_push(tmp, trace); if(rc == 2) slist_concat(held, tmp); } slist_concat(held, tmp); slist_free(tmp); return 0; } if((rc = process_1_trace_work(trace, lh)) < 0) { scamper_trace_free(trace); return -1; } if(rc == 1) return 0; scamper_trace_free(trace); return 0; } /* * process_1_ping * * for the pings we sent to test IPID behavior, check if there are * different source addresses used to respond for a cheap alias * resolution * */ static int process_1_ping(scamper_ping_t *ping) { scamper_ping_reply_t *r; uint16_t i; if(SCAMPER_PING_METHOD_IS_UDP(ping) == 0) goto done; for(i=0; iping_sent; i++) { r = ping->ping_replies[i]; while(r != NULL) { if(SCAMPER_PING_REPLY_IS_ICMP_UNREACH_PORT(r) && scamper_addr_cmp(r->addr, ping->dst) != 0 && scamper_addr_isreserved(r->addr) == 0 && sc_link_find(ping->dst, r->addr) == NULL && sc_link_find(r->addr, ping->dst) == NULL && sc_routerset_getpair(rtrset, ping->dst, r->addr) == NULL) goto err; r = r->next; } } done: scamper_ping_free(ping); return 0; err: scamper_ping_free(ping); return -1; } /* * sc_asrel_to_vpasc * * if the relationship involves a VP ASN, put it in the neighs structure * as an sc_asc_t. */ static int sc_asrel_to_vpasc(sc_stree_t *neighs, sc_asrel_t *r) { uint32_t as; if(is_vpas(r->a)) { if(is_vpas(r->b)) return 0; as = r->b; } else if(is_vpas(r->b)) { as = r->a; } else return 0; if(sc_asc_get(neighs, as) == NULL) return -1; return 0; } static sc_stree_t *asmap_to_asset(sc_stree_t *set) { sc_asmapc_t *asmapc; sc_stree_t *asset; slist_node_t *sn; sc_asc_t *asc; int i; if((asset = sc_stree_alloc((splaytree_cmp_t)sc_asc_as_cmp)) == NULL) return NULL; for(sn=slist_head_node(set->list); sn != NULL; sn=slist_node_next(sn)) { asmapc = slist_node_item(sn); for(i=0; iasmap->asc; i++) { if(is_vpas(asmapc->asmap->ases[i])) continue; if((asc = sc_asc_get(asset, asmapc->asmap->ases[i])) == NULL) { sc_stree_free(asset, free); return NULL; } asc->c++; } } return asset; } /* * owner_1_graph: * * given a set of ASes, observed at a given hop, infer who might * be the provider involved based on inferred AS relationships. */ static int owner_1_graph(sc_stree_t *set, uint32_t *as) { sc_stree_t *asset = NULL; slist_node_t *sn, *sn2; sc_asc_t *asc, *asc2; sc_asmap_t *asmap; uint32_t u32; int i, r; /* * if the set contains one asmap, and that asmap is a MOAS of size 2, * then try and reason about who the owning AS might be. */ if(slist_count(set->list) == 1 && ((sc_asmapc_t *)slist_head_item(set->list))->asmap->asc == 2) { asmap = ((sc_asmapc_t *)slist_head_item(set->list))->asmap; /* if one of the two ASes is a customer of the VP, pick that one */ for(i=0; i<2; i++) { if(is_vpas(asmap->ases[i])) continue; if(vp_r(asmap->ases[i], &u32, &r) == 0 && r == -1) { *as = asmap->ases[i]; return 0; } } /* if one of the two ASes is a customer of the other, pick that one */ u32 = 0; if(sc_asrel_r(asmap->ases[0], asmap->ases[1], &r) == 0) { if(r == -1) u32 = asmap->ases[1]; else if(r == 1) u32 = asmap->ases[0]; } if(u32 != 0 && is_vpas(u32) == 0) { *as = u32; return 0; } } if((asset = asmap_to_asset(set)) == NULL) return -1; if(slist_count(asset->list) == 0) { *as = 0; goto done; } /* * if the set had more than one ASN in it, but that ASN was in every * prefix, then choose that ASN. */ slist_qsort(asset->list, (slist_cmp_t)sc_asc_c_cmp); asc = slist_head_item(asset->list); if(asc->c == slist_count(set->list)) { *as = asc->as; goto done; } /* reset the count per AS, because we are going to use it next */ for(sn=slist_head_node(asset->list); sn != NULL; sn=slist_node_next(sn)) { asc = slist_node_item(sn); asc->c = 0; } /* * the AS with the most customers in the set is inferred to be the owner * by graph */ for(sn=slist_head_node(asset->list); sn != NULL; sn=slist_node_next(sn)) { asc = slist_node_item(sn); for(sn2=slist_node_next(sn); sn2 != NULL; sn2=slist_node_next(sn2)) { asc2 = slist_node_item(sn2); if(sc_asrel_r(asc->as, asc2->as, &r) == 0) { if(r == -1) asc->c++; else if(r == 1) asc2->c++; } } } slist_qsort(asset->list, (slist_cmp_t)sc_asc_c_cmp); asc = slist_head_item(asset->list); *as = asc->as; done: if(asset != NULL) sc_stree_free(asset, (sc_stree_free_t)sc_asc_free); return 0; } static int owner_1_asmap(sc_router_t *y, sc_asmap_t **asmap) { sc_stree_t *yas_set = NULL; sc_asmapc_t *asmapc; sc_addr2router_t *a2r; sc_prefix_t *pfx; slist_node_t *sn; int rc = -1; *asmap = NULL; if((yas_set = sc_stree_alloc((splaytree_cmp_t)sc_asmapc_as_cmp)) == NULL) goto done; for(sn=slist_head_node(y->addrs); sn != NULL; sn=slist_node_next(sn)) { a2r = slist_node_item(sn); if(a2r->ttlexp == 0 || is_vp(a2r->addr) == 1 || is_ixp(a2r->addr) == 1) continue; /* assemble list of ASes that announce prefixes seen for this router */ if((pfx = sc_prefix_find(a2r->addr)) != NULL) { if((asmapc = sc_asmapc_get(yas_set, pfx->asmap)) == NULL) goto done; asmapc->c++; } } if(slist_count(yas_set->list) == 0) { rc = 0; goto done; } slist_qsort(yas_set->list, (slist_cmp_t)sc_asmapc_c_cmp); asmapc = slist_head_item(yas_set->list); *asmap = asmapc->asmap; rc = 1; done: if(yas_set != NULL) sc_stree_free(yas_set, (sc_stree_free_t)sc_asmapc_free); return rc; } /* * owner_1_thirdparty: * * infer if the thirdparty heuristic applies to this router */ static int owner_1_thirdparty(sc_router_t *y, uint32_t *owner, uint32_t *tp) { sc_stree_t *yas_set = NULL; uint32_t y_asn, dst_asn; sc_addr2router_t *a2r; sc_asmapc_t *asmapc; sc_prefix_t *pfx; slist_node_t *sn; sc_asmap_t *yas; int i, j, r, rc = -1; if(y->dstases == NULL || slist_count(y->dstases->list) != 1) return 0; if((yas_set = sc_stree_alloc((splaytree_cmp_t)sc_asmapc_as_cmp)) == NULL) goto done; for(sn=slist_head_node(y->addrs); sn != NULL; sn=slist_node_next(sn)) { a2r = slist_node_item(sn); if(a2r->ttlexp == 0 || is_vp(a2r->addr) == 1 || is_ixp(a2r->addr) == 1) continue; /* assemble list of ASes that announce prefixes seen for this router */ if((pfx = sc_prefix_find(a2r->addr)) != NULL && sc_asmapc_get(yas_set, pfx->asmap) == NULL) goto done; } if(slist_count(yas_set->list) != 1) { rc = 0; goto done; } yas = ((sc_asmapc_t *)slist_head_item(yas_set->list))->asmap; asmapc = slist_head_item(y->dstases->list); for(i=0; iasc; i++) { y_asn = yas->ases[i]; if(is_vpas(y_asn)) continue; for(j=0; jasmap->asc; j++) { dst_asn = asmapc->asmap->ases[j]; if(is_vpas(dst_asn)) continue; if(sc_asrel_r(dst_asn, y_asn, &r) == 0 && r == 1) { *owner = dst_asn; *tp = y_asn; rc = 1; goto done; } } } done: if(yas_set != NULL) sc_stree_free(yas_set, (slist_free_t)sc_asmapc_free); return rc; } /* * owner_1_traceset: * * infer the near router involved in an interdomain interconnection where * the far router is unresponsive, or might send an ICMP echo or unreach. */ static int owner_1_traceset(sc_routerset_t *set, sc_traceset_t *ts) { sc_router_t *near_rtr = NULL, *last_rtr, *rtr; scamper_trace_hop_t *far_hop = NULL, *hop; scamper_trace_t *trace; slist_t *fars = NULL; slist_node_t *sn; uint16_t i; if((fars = slist_alloc()) == NULL) return -1; for(sn = slist_head_node(ts->list); sn != NULL; sn = slist_node_next(sn)) { trace = slist_node_item(sn); last_rtr = NULL; for(i=0; ihop_count; i++) { if((hop = trace->hops[i]) == NULL) continue; if(SCAMPER_TRACE_HOP_IS_ICMP_TTL_EXP(hop) == 0) { if(i > 0 && trace->hops[i-1] != NULL && sc_routerset_find(set,trace->hops[i-1]->hop_addr) == last_rtr) slist_tail_push(fars, hop); break; } if((rtr = sc_routerset_find(set, hop->hop_addr)) == NULL) continue; if(is_vpas(rtr->owner_as)) last_rtr = rtr; } if(near_rtr == NULL) near_rtr = last_rtr; else if(near_rtr != last_rtr) goto done; } if(near_rtr == NULL) goto done; /* if there is no set of adjacent routers, then build a fake adjacency */ if(slist_count(fars) == 0) { slist_free(fars); fars = NULL; if((rtr = sc_routerset_getnull(set)) == NULL) goto err; rtr->owner_as = ts->asn; rtr->ttl = near_rtr->ttl + 1; rtr->owner_reason = SC_ROUTER_OWNER_SILENT; if(sc_router_adj_add(near_rtr, rtr) != 0) goto err; return 1; } for(sn=slist_head_node(fars); sn != NULL; sn=slist_node_next(sn)) { hop = slist_node_item(sn); if(far_hop == NULL) far_hop = hop; else if(scamper_addr_cmp(far_hop->hop_addr, hop->hop_addr) != 0) break; } if(sn != NULL || far_hop == NULL) goto done; if((rtr = sc_routerset_find(set, far_hop->hop_addr)) != NULL) { if(rtr->owner_as != 0) goto done; } else { if((rtr = sc_routerset_get(set, far_hop->hop_addr)) == NULL) goto err; rtr->ttl = near_rtr->ttl + 1; } rtr->owner_reason = SC_ROUTER_OWNER_ICMP; rtr->owner_as = ts->asn; if(sc_router_adj_add(near_rtr, rtr) != 0) goto err; return 1; done: if(fars != NULL) slist_free(fars); return 0; err: if(fars != NULL) slist_free(fars); return -1; } /* * owner_1: * * infer ownership for router Y. * * ixpc: the number of IXP ttlexp interfaces on router Y * vpc: the number of VP ttlexp interfaces on router Y * yas_set: networks announcing ttlexp interfaces on router Y * a2r_list: the ttlexp interfaces on router Y */ static int owner_1(sc_router_t *y, uint32_t *owner_as, uint8_t *owner_reason) { sc_stree_t *yas_set = NULL, *zas_set = NULL, *zas2_set = NULL; sc_stree_t *adj_set = NULL, *ixp_set = NULL, *tp_set = NULL; slist_t *a2r_list = NULL; sc_addr2router_t *a2r; dlist_node_t *dn; slist_node_t *sn, *sn2; sc_asmap_t *yas, *zas; sc_asmapc_t *asmapc, *asmapc2, *asmapc3; sc_asc_t *asc; sc_ixpc_t *ixppfxc; sc_prefix_t *pfx; sc_router_t *z; sc_prov_t *prov; uint32_t y_asn, dst_asn, z_asn, sib, neigh; uint32_t y_dstases_owner = 0, zas_set_owner = 0; int i, j, r, ixpc, vpc, rc = -1; int a2r_count, yas_count, zas_count, y_dstases_count; uint8_t u8; *owner_as = 0; *owner_reason = SC_ROUTER_OWNER_NONE; if(y->owner_as != 0) goto done; if((a2r_list = slist_alloc()) == NULL || (yas_set = sc_stree_alloc((splaytree_cmp_t)sc_asmapc_as_cmp)) == NULL || (zas_set = sc_stree_alloc((splaytree_cmp_t)sc_asmapc_as_cmp)) == NULL || (ixp_set = sc_stree_alloc((splaytree_cmp_t)sc_ixpc_pfx_cmp)) == NULL) goto done; /* * assemble the list of IP addresses seen in traceroutes for this router, * counting the number originated by the VP's network, and who announces * the router's address space in BGP. */ vpc = 0; ixpc = 0; for(sn=slist_head_node(y->addrs); sn != NULL; sn=slist_node_next(sn)) { a2r = slist_node_item(sn); if(a2r->ttlexp == 0) continue; if(slist_tail_push(a2r_list, a2r) == NULL) goto done; if(is_vp(a2r->addr) == 1) vpc++; else if(is_ixp(a2r->addr) == 1) ixpc++; /* assemble list of ASes that announce prefixes seen for this router */ if((pfx = sc_prefix_find(a2r->addr)) != NULL && sc_asmapc_get(yas_set, pfx->asmap) == NULL) goto done; } if(slist_count(a2r_list) == 0) { rc = 0; goto done; } /* * assemble the list of neighboring prefixes covering addresses seen * in traceroutes to neighboring routers */ for(dn = (y->adj != NULL) ? dlist_head_node(y->adj) : NULL; dn != NULL; dn = dlist_node_next(dn)) { z = dlist_node_item(dn); for(sn2=slist_head_node(z->addrs); sn2 != NULL; sn2=slist_node_next(sn2)) { a2r = slist_node_item(sn2); if(a2r->ttlexp == 0) continue; if(is_ixp(a2r->addr)) { if((ixppfxc = sc_ixpc_get(ixp_set, a2r->addr)) == NULL) goto done; ixppfxc->c++; } else if((pfx = sc_prefix_find(a2r->addr)) != NULL && sc_asmap_isvp(pfx->asmap) == 0) { if((asmapc = sc_asmapc_get(zas_set, pfx->asmap)) == NULL) goto done; asmapc->c++; } } } /* * sort the list of adjacent ASes so that the AS with the most * adjacent interfaces is found first. * * sort the IXP prefixes so that the prefix with the most IP addresses * observed is found first */ slist_qsort(zas_set->list, (slist_cmp_t)sc_asmapc_c_cmp); slist_qsort(ixp_set->list, (slist_cmp_t)sc_ixpc_c_cmp); /* get a bunch of count values now that the lists have settled */ zas_count = slist_count(zas_set->list); yas_count = slist_count(yas_set->list); a2r_count = slist_count(a2r_list); y_dstases_count = y->dstases != NULL ? slist_count(y->dstases->list) : 0; /* * if there are addresses announced by the VP observed adjacent to this * router and observed in an IP-level link, then try and determine if * the router belongs to this network, or an adjacent network. */ if(y->flags & SC_ROUTER_FLAG_FIRST) { if(y->adj != NULL && slist_count(zas_set->list) > 0) { if((zas2_set = sc_stree_alloc((splaytree_cmp_t)sc_asmapc_as_cmp)) == NULL || (tp_set=sc_stree_alloc((splaytree_cmp_t)sc_asc_as_cmp)) == NULL) goto done; for(dn=dlist_head_node(y->adj); dn != NULL; dn=dlist_node_next(dn)) { z = dlist_node_item(dn); if(owner_1_thirdparty(z, &dst_asn, &y_asn) == 1) { if((asc = sc_asc_get(tp_set, y_asn)) == NULL) goto done; asc->c++; } else if(owner_1_asmap(z, &zas) == 1) { if((asmapc = sc_asmapc_get(zas2_set, zas)) == NULL) goto done; asmapc->c++; } } slist_qsort(tp_set->list, (slist_cmp_t)sc_asc_c_cmp); slist_qsort(zas2_set->list, (slist_cmp_t)sc_asmapc_c_cmp); if(slist_count(tp_set->list) > 0 && slist_count(zas2_set->list) > 0 && (asc = slist_head_item(tp_set->list)) != NULL && is_vpas(asc->as) == 0 && asc->c >= 2) { asmapc = slist_head_item(zas2_set->list); for(i=0; iasmap->asc; i++) { z_asn = asmapc->asmap->ases[i]; if(asc->as == z_asn) { *owner_as = z_asn; *owner_reason = SC_ROUTER_OWNER_FIRST2; rc = 1; goto done; } } } sc_stree_free(zas2_set, (sc_stree_free_t)sc_asmapc_free); zas2_set = NULL; sc_stree_free(tp_set, (sc_stree_free_t)sc_asc_free); tp_set = NULL; } if(zas_count > 0 && y_dstases_count > 0 && y_dstases_count < 100) { /* * figure out who might own the router, based on the * destination ASes probed */ if(owner_1_graph(y->dstases, &y_dstases_owner) != 0) goto done; zas = ((sc_asmapc_t *)slist_head_item(zas_set->list))->asmap; for(i=0; iasc; i++) if(zas->ases[i] == y_dstases_owner) break; /* * possible first2 candidate. do some extra sanity checks * on adjacent routers: if at least one of them would have * an owner AS inferred, and is a customer of the VP, and * has no known relationship with the candidate AS, then * don't infer the owner as the candidate AS, fall through * and use the first heuristic */ if(i != zas->asc && y->adj != NULL) { for(dn = dlist_head_node(y->adj); dn != NULL; dn = dlist_node_next(dn)) { z = dlist_node_item(dn); if(z->owner_as != 0) z_asn = z->owner_as; else if(owner_1(z, &z_asn, &u8) != 1) continue; if(is_vpas(z_asn) || z_asn == y_dstases_owner || z_asn == 0) continue; if(vp_r(z_asn, &sib, &r) == 0 && r == -1 && sc_asrel_find(y_dstases_owner, z_asn) == NULL) break; } if(dn == NULL) { *owner_as = y_dstases_owner; *owner_reason = SC_ROUTER_OWNER_FIRST2; rc = 1; goto done; } } } *owner_as = vpas[0]; *owner_reason = SC_ROUTER_OWNER_FIRST; rc = 1; goto done; } /* * if we do not observe anything adjacent to this router, but we * have seen other addresses after the gap, then look to see if * we saw an address announced by the VP's network. */ if(vpc == a2r_count && y->adj == NULL && y->gapases != NULL) { sn = slist_head_node(y->gapases->list); while(sn != NULL) { asmapc = slist_node_item(sn); if(sc_asmap_isvp(asmapc->asmap)) { *owner_reason = SC_ROUTER_OWNER_FIRST; *owner_as = vpas[0]; rc = 1; goto done; } sn = slist_node_next(sn); } } /* * if this router only has address space from the VP network, * and there are IXP addresses adjacent suggesting the router is * close to an IXP */ if(vpc == a2r_count && (ixppfxc = slist_head_item(ixp_set->list)) != NULL && ixppfxc->c >= 2) { /* * if there are no routers adjacent with publicly routed address * space, then infer the router is owned by the VP's network * and represents a router colocated at an IXP */ if(zas_count == 0) { *owner_reason = SC_ROUTER_OWNER_IXP; *owner_as = vpas[0]; rc = 1; goto done; } } if(y->dstases != NULL && owner_1_graph(y->dstases, &y_dstases_owner) != 0) goto done; if(vpc+ixpc == a2r_count) { /* * if we do not observe anything after this router, then reason * about who might own the router based on the destination ASes * probed. if we have no inference (y_dstases_owner == 0) then * there is no other source of information that would allow us * to make a better decision so we're done. */ if(y->adj == NULL) { if(y_dstases_owner != 0) { *owner_reason = SC_ROUTER_OWNER_TRACESET; *owner_as = y_dstases_owner; rc = 1; } goto done; } /* * if this router only has IXP addresses, and subsequent routers * are in the same IXP subnet as this router, then infer the router * belongs to the VP. */ if(ixpc == a2r_count) { for(sn=slist_head_node(y->addrs); sn != NULL; sn=slist_node_next(sn)) { a2r = slist_node_item(sn); if(a2r->ttlexp == 0) continue; if((ixppfxc = sc_ixpc_find(ixp_set, a2r->addr)) != NULL) break; } if(sn != NULL) { *owner_reason = SC_ROUTER_OWNER_IXP; *owner_as = vpas[0]; rc = 1; goto done; } } /* * if the adjacent router has no addresses routed in BGP, * then infer who might own that address space. */ if(zas_count == 0 && y_dstases_owner != 0) { *owner_reason = SC_ROUTER_OWNER_NOIP2AS; *owner_as = y_dstases_owner; rc = 1; goto done; } } /* * if the router's addresses are not announced in BGP, then try * and deduce who might operate it. */ if(yas_count == 0 && ixpc == 0) { if((y->adjases != NULL && owner_1_graph(y->adjases, &y_asn) != 0) || (y_asn = y_dstases_owner) != 0) { *owner_reason = SC_ROUTER_OWNER_NOIP2AS; *owner_as = y_asn; rc = 1; } goto done; } if(yas_count == 1) { yas = ((sc_asmapc_t *)slist_head_item(yas_set->list))->asmap; /* * if one of the adjacent routers is also in external address space, * then mark Y as owned by yas. */ if(y->adjases != NULL && (adj_set = asmap_to_asset(y->adjases)) == NULL) goto done; if(adj_set != NULL) { for(i=0; iasc; i++) { y_asn = yas->ases[i]; if(is_vpas(y_asn) == 0 && sc_asc_find(adj_set, y_asn) != NULL) { *owner_reason = SC_ROUTER_OWNER_ONENET; *owner_as = y_asn; rc = 1; goto done; } } sc_stree_free(adj_set, (sc_stree_free_t)sc_asc_free); adj_set = NULL; } /* check for third party addresses */ if(owner_1_thirdparty(y, &dst_asn, &y_asn) == 1) { *owner_reason = SC_ROUTER_OWNER_THIRDPARTY; *owner_as = dst_asn; rc = 1; goto done; } } if(zas_count == 1) { zas = ((sc_asmapc_t *)slist_head_item(zas_set->list))->asmap; /* * go through the adjacent routers (z). if one of the routers adjacent * to z (z', z'', etc) are in the same AS as z, then infer that router * Y is operated by the network announcing z. */ for(dn=dlist_head_node(y->adj); dn != NULL; dn=dlist_node_next(dn)) { z = dlist_node_item(dn); if(z->adjases == NULL) continue; if((adj_set = asmap_to_asset(z->adjases)) == NULL) goto done; for(i=0; iasc; i++) { z_asn = zas->ases[i]; if(is_vpas(z_asn)) continue; if(sc_asc_find(adj_set, z_asn) != NULL) { *owner_reason = SC_ROUTER_OWNER_ONENET2; *owner_as = z_asn; rc = 1; goto done; } } sc_stree_free(adj_set, (sc_stree_free_t)sc_asc_free); adj_set = NULL; } } /* * if router Y was observed on the path to one network, do special * casing to try and avoid bad inferences caused by third party * addresses at a subsequent hop that will otherwise use to infer * Y's ownership. */ if(y_dstases_count == 1 && zas_count == 1) { asmapc = slist_head_item(y->dstases->list); zas = ((sc_asmapc_t *)slist_head_item(zas_set->list))->asmap; for(i=0; iasc; i++) { z_asn = zas->ases[i]; if(is_vpas(z_asn)) continue; for(j=0; jasmap->asc; j++) { dst_asn = asmapc->asmap->ases[j]; if(is_vpas(dst_asn)) continue; if(sc_asrel_r(dst_asn, z_asn, &r) == 0 && r == 1) { *owner_reason = SC_ROUTER_OWNER_THIRDPARTY2; *owner_as = dst_asn; rc = 1; goto done; } } } for(i=0; iasmap->asc; i++) { dst_asn = asmapc->asmap->ases[i]; if(is_vpas(dst_asn)) continue; if(vp_r(dst_asn, &sib, &r) == 0 && r == -1) { *owner_reason = SC_ROUTER_OWNER_CUSTOMER; *owner_as = dst_asn; rc = 1; goto done; } } } /* * if the neighbour router(s) are announced by one AS, * then assign ownership according to that AS. */ if(zas_count == 1) { zas = ((sc_asmapc_t *)slist_head_item(zas_set->list))->asmap; if(asmap_r(zas, &sib, &neigh, &r) == 0 && (r == -1 || r == 0)) { if(r == 0) *owner_reason = SC_ROUTER_OWNER_PEER; else if(r == -1) *owner_reason = SC_ROUTER_OWNER_CUSTOMER; *owner_as = neigh; rc = 1; goto done; } for(i=0; iasc; i++) { if((prov = sc_prov_find(zas->ases[i])) != NULL) { for(i=0; iprovc; i++) { y_asn = prov->provs[i]; if(vp_r(y_asn, &sib, &r) == 0 && r == -1) { *owner_reason = SC_ROUTER_OWNER_MISSING; *owner_as = y_asn; rc = 1; goto done; } } } } *owner_reason = SC_ROUTER_OWNER_HIDDENPEER; *owner_as = zas->ases[0]; rc = 1; goto done; } else if(zas_count >= 2) { sn = slist_head_node(zas_set->list); asmapc = slist_node_item(sn); sn2 = slist_node_next(sn); asmapc2 = slist_node_item(sn2); if(asmapc->c == asmapc2->c) { asmapc3 = NULL; while(sn != NULL) { asmapc2 = slist_node_item(sn); if(asmapc->c != asmapc2->c) break; if(asmap_r(asmapc2->asmap, &sib, &neigh, &r) == 0) { if(asmapc3 != NULL) { asmapc3 = NULL; break; } asmapc3 = asmapc2; } sn = slist_node_next(sn); } if(asmapc3 != NULL) asmapc = asmapc3; else asmapc = NULL; } if(asmapc != NULL) { if(asmap_r(asmapc->asmap, &sib, &neigh, &r) != 0) { if(is_vpas(asmapc->asmap->ases[0]) == 0) { *owner_as = asmapc->asmap->ases[0]; *owner_reason = SC_ROUTER_OWNER_COUNT2; } else { if(owner_1_graph(zas_set, &zas_set_owner) == 0) goto done; if(zas_set_owner != 0) neigh = zas_set_owner; *owner_as = neigh; *owner_reason = SC_ROUTER_OWNER_COUNT3; } } else { *owner_as = asmapc->asmap->ases[0]; *owner_reason = SC_ROUTER_OWNER_COUNT; } rc = 1; goto done; } } if(vpc > 0 && a2r_count != vpc) { for(sn=slist_head_node(yas_set->list); sn != NULL; sn=slist_node_next(sn)) { yas = ((sc_asmapc_t *)slist_node_item(sn))->asmap; for(i=0; iasc; i++) { if(is_vpas(yas->ases[i])) continue; *owner_as = yas->ases[i]; *owner_reason = SC_ROUTER_OWNER_IP2AS; rc = 1; goto done; } } } if(yas_count == 1) { yas = ((sc_asmapc_t *)slist_head_item(yas_set->list))->asmap; for(i=0; iasc; i++) { if(is_vpas(yas->ases[i])) continue; *owner_as = yas->ases[i]; *owner_reason = SC_ROUTER_OWNER_IP2AS; rc = 1; goto done; } } rc = 0; done: if(yas_set != NULL) sc_stree_free(yas_set, (sc_stree_free_t)sc_asmapc_free); if(zas_set != NULL) sc_stree_free(zas_set, (sc_stree_free_t)sc_asmapc_free); if(zas2_set != NULL) sc_stree_free(zas2_set,(sc_stree_free_t)sc_asmapc_free); if(adj_set != NULL) sc_stree_free(adj_set, (sc_stree_free_t)sc_asc_free); if(ixp_set != NULL) sc_stree_free(ixp_set, (sc_stree_free_t)sc_asc_free); if(tp_set != NULL) sc_stree_free(tp_set, (sc_stree_free_t)sc_asc_free); if(a2r_list != NULL) slist_free(a2r_list); return rc; } static void finish_1(void) { scamper_trace_t *trace; sc_stree_t *fars = NULL; sc_stree_t *neighs = NULL; slist_t *list = NULL; sc_addr2router_t *a2r; sc_router_t *x, *y, *z; sc_traceset_t *ts; sc_addr2name_t *a2n; slist_node_t *sn, *sn2; dlist_node_t *dn, *dn2; sc_link_t *link; sc_ally_t *ar; sc_link4_t *link4; sc_asmapc_t *asmapc, *asmapc2; sc_asmap_t *asmap; sc_farrouter_t *fr; sc_prefix_t *pfx; int r, lh, rc, owned, changed; sc_asc_t *asc; uint32_t u32, owner_as; uint8_t owner_reason; char buf[128]; while((trace = slist_head_pop(held)) != NULL) { if((lh = trace_lasthop(trace)) == 0) { scamper_trace_free(trace); continue; } if((rc = process_1_trace_work(trace, lh)) < 0) { scamper_trace_free(trace); goto done; } if(rc == 0) scamper_trace_free(trace); } slist_free(held); held = NULL; if((list = slist_alloc()) == NULL) goto done; splaytree_inorder(allys, tree_to_slist, list); while((ar = slist_head_pop(list)) != NULL) { if(ar->result == SCAMPER_DEALIAS_RESULT_ALIASES && sc_routerset_getpair(rtrset, ar->a, ar->b) == NULL) goto done; } /* * build a simplified graph of routers represented in * the set of links, and begin to annotate routers with ownership. */ splaytree_inorder(links, tree_to_slist, list); while((link = slist_head_pop(list)) != NULL) { /* skip over links not seen in the traceroutes we use */ if((link4 = link->data) == NULL) continue; /* build links between routers */ if((y = sc_routerset_get(rtrset, link->a)) == NULL || (z = sc_routerset_get(rtrset, link->b)) == NULL || sc_router_adj_add(y, z) != 0 || sc_router_prev_add(z, y) != 0) goto done; /* * set the earliest distance in a path each of these routers was * observed */ if(y->ttl == 0 || y->ttl > link4->ttl) y->ttl = link4->ttl; if(z->ttl == 0 || z->ttl > link4->ttl + 1) z->ttl = link4->ttl + 1; /* figure out where the traceroutes for this router end up */ sn = slist_head_node(link4->dstases->list); while(sn != NULL) { asmapc = slist_node_item(sn); if((asmapc2 = sc_router_dstases_get(z, asmapc->asmap)) == NULL) goto done; asmapc2->c += asmapc->c; sn = slist_node_next(sn); } /* * get additional information, if available, on adjacent networks * to this router. */ if(link4->adjases != NULL) { if(z->adjases == NULL) z->adjases = sc_stree_alloc((splaytree_cmp_t)sc_asmapc_as_cmp); if(z->adjases == NULL) goto done; sn = slist_head_node(link4->adjases->list); while(sn != NULL) { asmapc = slist_node_item(sn); if((asmapc2 = sc_asmapc_get(z->adjases, asmapc->asmap)) == NULL) goto done; asmapc2->c += asmapc->c; sn = slist_node_next(sn); } } /* * get additional information, if available, on what is seen after * a gap from this router */ if(link4->gapases != NULL) { if(z->gapases == NULL) z->gapases = sc_stree_alloc((splaytree_cmp_t)sc_asmapc_as_cmp); if(z->gapases == NULL) goto done; sn = slist_head_node(link4->gapases->list); while(sn != NULL) { asmapc = slist_node_item(sn); if((asmapc2 = sc_asmapc_get(z->gapases, asmapc->asmap)) == NULL) goto done; asmapc2->c += asmapc->c; sn = slist_node_next(sn); } } /* mark the interfaces that are ttl-expired */ if((a2r = sc_routerset_a2r_find(rtrset, link->a)) == NULL) goto done; a2r->ttlexp = 1; if((a2r = sc_routerset_a2r_find(rtrset, link->b)) == NULL) goto done; a2r->ttlexp = 1; /* begin to assign ownership */ if(is_vp(link->b) == 1) y->flags |= SC_ROUTER_FLAG_FIRST; } dlist_qsort(rtrset->list, (dlist_cmp_t)sc_router_ttl_cmp); /* assign owners! */ do { for(dn=dlist_head_node(rtrset->list); dn != NULL; dn=dlist_node_next(dn)) { x = dlist_node_item(dn); x->flags &= (~SC_ROUTER_FLAG_VISITED); } /* * we assign owners iteratively, and continue to assign owners * provided we assigned an owner to at least one router in the * set */ changed = 0; for(dn=dlist_head_node(rtrset->list); dn != NULL; dn=dlist_node_next(dn)) { /* * we try and infer border routers involving the VP, so we * look and links adjacent to a router we have inferred to * be owned by the VP. */ x = dlist_node_item(dn); if(x->owner_as != vpas[0]) continue; if(x->adj == NULL) continue; for(dn2=dlist_head_node(x->adj);dn2 != NULL;dn2=dlist_node_next(dn2)) { /* skip over routers that have been assigned an owner */ y = dlist_node_item(dn2); if(y->owner_reason != SC_ROUTER_OWNER_NONE) continue; if(y->flags & SC_ROUTER_FLAG_VISITED) continue; y->flags |= SC_ROUTER_FLAG_VISITED; /* if we have an error, break out */ if((rc = owner_1(y, &owner_as, &owner_reason)) < 0) goto done; /* if we assign an owner, then make a note */ if(rc > 0) { sc_router_setowner(y, owner_as, owner_reason); changed++; } } } /* * if we haven't assigned any owners in the past sequence, then * we try new routers in the set. */ if(changed > 0) continue; for(dn=dlist_head_node(rtrset->list); dn != NULL; dn=dlist_node_next(dn)) { /* * we only focus on routers that have no inferred owner but * could belong to the VP. the router has to have at least one * interface that responded with a TTL-expired message that maps * to the VP's network. */ x = dlist_node_item(dn); if(x->owner_reason != SC_ROUTER_OWNER_NONE || sc_router_isvp(x) == 0) continue; if(x->flags & SC_ROUTER_FLAG_VISITED) continue; x->flags |= SC_ROUTER_FLAG_VISITED; if((rc = owner_1(x, &owner_as, &owner_reason)) < 0) goto done; if(rc > 0) { sc_router_setowner(x, owner_as, owner_reason); changed++; } } } while(changed > 0); /* * the next step is to analytically reduce interfaces to routers * where we observe multiple border links X1-Y, X2-Y, X3-Y, and * the Xes are all single interface routers. */ do { if(no_merge) break; /* * figure out all the far border routers, and relate them back to * observed near border routers. */ changed = 0; if((fars = sc_stree_alloc((splaytree_cmp_t)sc_farrouter_far_cmp)) == NULL) goto done; for(dn=dlist_head_node(rtrset->list); dn != NULL; dn=dlist_node_next(dn)) { /* we are only interested in near routers owned by the VP network */ x = dlist_node_item(dn); if(x->owner_as == 0 || x->owner_as != vpas[0] || sc_router_isborder(x) == 0) continue; for(dn2 = (x->adj != NULL) ? dlist_head_node(x->adj) : NULL; dn2 != NULL; dn2 = dlist_node_next(dn2)) { /* we want the far routers owned by other networks */ y = dlist_node_item(dn2); if(y->owner_as == vpas[0] || y->owner_as == 0) continue; if((fr = sc_farrouter_get(fars, y)) == NULL) goto done; if(sc_farrouter_addnear(fr, x) != 0) goto done; } } if(slist_count(fars->list) == 0) break; slist_qsort(fars->list, (slist_cmp_t)sc_farrouter_nears_cmp); for(sn=slist_head_node(fars->list); sn != NULL; sn = slist_node_next(sn)) { fr = slist_node_item(sn); if(slist_count(fr->nears) <= 1) break; rc = 1; slist_qsort(fr->nears, (slist_cmp_t)sc_router_p_cmp); sn2 = slist_head_node(fr->nears); while(sn2 != NULL) { y = slist_node_item(sn2); sn2 = slist_node_next(sn2); if(sc_router_ttlexp_count(y) != 1 && (y->flags & SC_ROUTER_FLAG_MERGED) == 0) rc = 0; } /* if this node can be merged, process it */ if(rc != 0) { x = slist_head_item(fr->nears); sn2 = slist_node_next(slist_head_node(fr->nears)); while(sn2 != NULL) { sc_routerset_merge(rtrset, x, slist_node_item(sn2)); sn2 = slist_node_next(sn2); } changed = 1; break; } } sc_stree_free(fars, (slist_free_t)sc_farrouter_free); fars = NULL; } while(changed > 0); /* * go through the list of relationships to obtain the ones involving * the VP */ if((neighs = sc_stree_alloc((splaytree_cmp_t)sc_asc_as_cmp)) == NULL) goto done; splaytree_inorder(reltree, (splaytree_inorder_t)sc_asrel_to_vpasc, neighs); for(dn=dlist_head_node(rtrset->list); dn != NULL; dn = dlist_node_next(dn)) { x = dlist_node_item(dn); if(is_vpas(x->owner_as) == 0) continue; for(dn2 = (x->adj != NULL) ? dlist_head_node(x->adj) : NULL; dn2 != NULL; dn2 = dlist_node_next(dn2)) { y = dlist_node_item(dn2); if(y->owner_as == 0 || is_vpas(y->owner_as) != 0) continue; if((asc = sc_asc_find(neighs, y->owner_as)) != NULL) asc->c++; } } splaytree_inorder(tracesets, tree_to_slist, list); splaytree_free(tracesets, NULL); tracesets = NULL; while((ts = slist_head_pop(list)) != NULL) { if((asc = sc_asc_find(neighs, ts->asn)) != NULL && asc->c == 0) { if((rc = owner_1_traceset(rtrset, ts)) < 0) return; if(rc == 0 && dump_tracesets) traceset_dump(ts, rtrset); } sc_traceset_free(ts); } /* enforce a deterministic ordering */ for(dn=dlist_head_node(rtrset->list); dn != NULL; dn = dlist_node_next(dn)) { x = dlist_node_item(dn); slist_qsort(x->addrs, (slist_cmp_t)sc_addr2router_ttlexp_cmp); } for(dn=dlist_head_node(rtrset->list); dn != NULL; dn = dlist_node_next(dn)) { x = dlist_node_item(dn); if(x->adj != NULL) dlist_qsort(x->adj, (dlist_cmp_t)sc_router_owner_cmp); } dlist_qsort(rtrset->list, (dlist_cmp_t)sc_router_owner_cmp); owned = 0; for(dn=dlist_head_node(rtrset->list); dn != NULL; dn = dlist_node_next(dn)) { x = dlist_node_item(dn); if(x->owner_as != 0) owned++; if(x->owner_as != 0 && x->owner_as != vpas[0]) continue; if(dump_borders != 0 && sc_router_isborder(x) == 0) continue; printf("owner %u (%s", x->owner_as, owner_reasonstr[x->owner_reason]); if(x->flags & SC_ROUTER_FLAG_MERGED) printf(",merged"); printf(")\n"); for(sn = slist_head_node(x->addrs); sn != NULL; sn = slist_node_next(sn)) { a2r = slist_node_item(sn); printf("%s", scamper_addr_tostr(a2r->addr, buf, sizeof(buf))); if(a2r->ttlexp != 0) printf("*"); if((a2n = sc_addr2name_find(a2r->addr)) != NULL) printf(" %s", a2n->name); printf("\n"); } for(dn2 = (x->adj != NULL) ? dlist_head_node(x->adj) : NULL; dn2 != NULL; dn2 = dlist_node_next(dn2)) { y = dlist_node_item(dn2); if(y->owner_as == vpas[0] && no_self != 0) continue; printf(" %u", y->owner_as); if(dump_onedsts && y->dstases != NULL && slist_count(y->dstases->list) == 1) { asmapc = slist_head_item(y->dstases->list); asmap = asmapc->asmap; for(u32=0; u32 < asmap->asc; u32++) if(asmap->ases[u32] == y->owner_as) break; if(u32 == asmap->asc) printf(":%s", sc_asmap_tostr(asmap, buf, sizeof(buf))); } if(y->owner_as == vpas[0]) { printf(" self"); } else if(y->owner_as != 0 && vp_r(y->owner_as, &u32, &r) == 0) { if(r == 1) printf(" prov"); else if(r == 0) printf(" peer"); else printf(" cust"); } else { printf(" ????"); } printf(" %s", owner_reasonstr[y->owner_reason]); slist_qsort(y->addrs, (slist_cmp_t)sc_addr2router_ttlexp_cmp); for(sn2 = slist_head_node(y->addrs); sn2 != NULL; sn2 = slist_node_next(sn2)) { a2r = slist_node_item(sn2); printf(" %s", scamper_addr_tostr(a2r->addr, buf, sizeof(buf))); if(a2r->ttlexp != 0) { printf("*"); if(x->owner_as == 0 && (pfx = sc_prefix_find(a2r->addr)) != NULL) printf(" %s", sc_asmap_tostr(pfx->asmap,buf,sizeof(buf))); } if((a2n = sc_addr2name_find(a2r->addr)) != NULL) printf(" %s", a2n->name); } printf("\n"); } printf("\n"); } printf("%d/%d owned\n", owned, dlist_count(rtrset->list)); done: if(list != NULL) slist_free(list); if(tracesets != NULL) { splaytree_free(tracesets, (splaytree_free_t)sc_traceset_free); tracesets = NULL; } if(links != NULL) { splaytree_free(links, (splaytree_free_t)sc_link_free_link4); links = NULL; } return; } static int process_2_trace(scamper_trace_t *trace) { trace_dump(trace, NULL); printf("\n"); scamper_trace_free(trace); return 0; } static int bdrmap_dump(void) { scamper_file_t *in; char *filename; uint16_t type; void *data; int i, stdin_used=0; if(ip2name_fn != NULL) { ip2name_tree = splaytree_alloc((splaytree_cmp_t)sc_addr2name_cmp); if(ip2name_tree == NULL) return -1; if(file_lines(ip2name_fn, ip2name_line, NULL) != 0) return -1; } if(delegated_fn != NULL) { if((delegated = slist_alloc()) == NULL) return -1; if(file_lines(delegated_fn, delegated_line, NULL) != 0) return -1; if(slist_qsort(delegated, (slist_cmp_t)sc_delegated_cmp) != 0) return -1; } if(dump_funcs[dump_id].init != NULL) dump_funcs[dump_id].init(); for(i=0; i&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_bdrmap$(EXEEXT) subdir = utils/sc_bdrmap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_bdrmap_OBJECTS = sc_bdrmap.$(OBJEXT) ../../utils.$(OBJEXT) \ ../../mjl_heap.$(OBJEXT) ../../mjl_list.$(OBJEXT) \ ../../mjl_splaytree.$(OBJEXT) ../../mjl_prefixtree.$(OBJEXT) sc_bdrmap_OBJECTS = $(am_sc_bdrmap_OBJECTS) sc_bdrmap_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_bdrmap_SOURCES) DIST_SOURCES = $(sc_bdrmap_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_bdrmap_SOURCES = \ sc_bdrmap.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c \ ../../mjl_prefixtree.c sc_bdrmap_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_bdrmap.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_bdrmap/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_bdrmap/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_heap.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_splaytree.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_prefixtree.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_bdrmap$(EXEEXT): $(sc_bdrmap_OBJECTS) $(sc_bdrmap_DEPENDENCIES) $(EXTRA_sc_bdrmap_DEPENDENCIES) @rm -f sc_bdrmap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_bdrmap_OBJECTS) $(sc_bdrmap_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_heap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_prefixtree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_splaytree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_bdrmap.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_attach/.cvsignore000644 001751 000000 00000000053 11525063774 021214 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_attach scamper-cvs-20171204/utils/sc_attach/Makefile.am000644 001751 000000 00000000464 12570444301 021244 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_attach sc_attach_SOURCES = \ sc_attach.c \ ../../utils.c \ ../../mjl_list.c \ ../../scamper/scamper_writebuf.c \ ../../scamper/scamper_linepoll.c man_MANS = sc_attach.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_attach/sc_attach.1000644 001751 000000 00000006420 12726235171 021227 0ustar00mjlwheel000000 000000 .\" .\" sc_attach.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2010 University of Waikato .\" 2012 The Regents of the University of California .\" All rights reserved .\" .\" $Id: sc_attach.1,v 1.11 2016/06/09 09:44:25 mjl Exp $ .\" .\" nroff -man sc_attach.1 .\" groff -man -Tascii sc_attach.1 | man2html -title sc_attach.1 .\" .Dd February 2, 2016 .Dt SC_ATTACH 1 .Os .Sh NAME .Nm sc_attach .Nd simple scamper driver. .Sh SYNOPSIS .Nm .Bk -words .Op Fl ?dDv .Op Fl c Ar command .Op Fl i Ar infile .Op Fl o Ar outfile .Op Fl O Ar options .Op Fl p Ar [ip:]port .Op Fl P Ar priority .Op Fl R Ar unix-domain .Op Fl U Ar unix-domain .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility provides the ability to connect to a running .Xr scamper 1 instance, have a set of commands defined in a file be executed, and the output be written into a single file, in warts format. The options are as follows: .Bl -tag -width Ds .It Fl ? prints a list of command line options and a synopsis of each. .It Fl d prints each command sent to .Xr scamper 1 on stderr. .It Fl D causes .Nm to operate as a daemon. .It Fl v prints the current revision of .Nm and exits. .It Fl c Ar command specifies the .Xr scamper 1 command to prepend to each address in the input file. .It Fl i Ar infile specifies the name of the input file which consists of a sequence of .Xr scamper 1 commands or addresses (with the -c option), one per line. If '-' is specified, commands are read from stdin. .It Fl o Ar outfile specifies the name of the output file to be written. The output file will use the warts format. If '-' is specified, output will be sent to stdout. .It Fl O Ar options allows the behavior of .Nm to be further tailored. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy random: shuffle the input commands randomly. .It .Sy impatient: send commands to scamper without waiting for scamper to ask for them. .El .It Fl p Ar [ip:]port specifies the IP address and port where a .Xr scamper 1 is accepting control socket connections. If an IP address is not specified, .Nm connects to the specified port on the local host. .It Fl P Ar priority specifies the mixing priority .Xr scamper 1 should assign to the source. .It Fl R Ar unix-domain specifies the unix domain socket on the local host where a remote .Xr scamper 1 instance is accepting commands. .It Fl U Ar unix-domain specifies the unix domain socket on the local host where a local .Xr scamper 1 isntance is accepting commands. .El .Sh EXAMPLES Given a set of commands in a file named infile.txt: .Pp .in +.3i .nf tbit -M 1280 -u 'http://www.example.com/' 2620:0:2d0:200::10 trace -P udp-paris -M 192.0.2.1 ping -P icmp-echo 192.0.32.10 .fi .in -.3i .Pp and a .Xr scamper 1 daemon listening on port 31337, then these commands can be executed using: .Pp sc_attach -i infile.txt -o outfile.warts -p 31337 .Pp Given a set of addresses in a file named infile2.txt: .Pp .in +.3i .nf 2620:0:2d0:200::10 192.0.2.1 192.0.32.10 .fi .in -.3i .Pp these addresses can be pinged with .Nm operating as a daemon with: .Pp sc_attach -D -c 'ping' -i infile2.txt -o outfile2.warts -p 31337 .Sh SEE ALSO .Xr scamper 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2json 1 .Sh AUTHORS .Nm was written by Matthew Luckie . scamper-cvs-20171204/utils/sc_attach/sc_attach.c000644 001751 000000 00000043510 12726235144 021312 0ustar00mjlwheel000000 000000 /* * sc_attach : scamper driver to collect data by connecting to scamper on * a specified port and supplying it with commands. * * Author : Matthew Luckie. * */ #ifndef lint static const char rcsid[] = "$Id: sc_attach.c,v 1.23 2016/06/09 09:44:04 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_file.h" #include "scamper_writebuf.h" #include "scamper_linepoll.h" #include "mjl_list.h" #include "utils.h" #define OPT_HELP 0x0001 #define OPT_INFILE 0x0002 #define OPT_OUTFILE 0x0004 #define OPT_PORT 0x0008 #define OPT_STDOUT 0x0010 #define OPT_VERSION 0x0020 #define OPT_DEBUG 0x0040 #define OPT_PRIORITY 0x0080 #define OPT_DAEMON 0x0100 #define OPT_COMMAND 0x0200 #define OPT_REMOTE 0x0400 #define OPT_OPTIONS 0x0800 #define OPT_UNIX 0x1000 #define FLAG_RANDOM 0x0001 #define FLAG_IMPATIENT 0x0002 static uint32_t options = 0; static uint8_t flags = 0; static char *infile_name = NULL; static char *dst_addr = NULL; static int dst_port = 0; static char *unix_name = NULL; static uint32_t priority = 1; static int scamper_fd = -1; static scamper_writebuf_t *scamper_wb = NULL; static scamper_linepoll_t *scamper_lp = NULL; static int stdin_fd = -1; static scamper_linepoll_t *stdin_lp = NULL; static int stdout_fd = -1; static scamper_writebuf_t *stdout_wb = NULL; static char *outfile_name = NULL; static int outfile_fd = -1; static int data_left = 0; static int more = 0; static int error = 0; static slist_t *commands = NULL; static char *opt_command = NULL; static int done = 0; static void cleanup(void) { if(dst_addr != NULL) { free(dst_addr); dst_addr = NULL; } if(commands != NULL) { slist_free_cb(commands, free); commands = NULL; } if(outfile_fd != -1) { close(outfile_fd); outfile_fd = -1; } if(scamper_fd != -1) { close(scamper_fd); scamper_fd = -1; } if(scamper_wb != NULL) { scamper_writebuf_free(scamper_wb); scamper_wb = NULL; } if(scamper_lp != NULL) { scamper_linepoll_free(scamper_lp, 0); scamper_lp = NULL; } if(stdin_lp != NULL) { scamper_linepoll_free(stdin_lp, 0); stdin_lp = NULL; } if(stdout_wb != NULL) { scamper_writebuf_free(stdout_wb); stdout_wb = NULL; } return; } static void usage(uint32_t opt_mask) { fprintf(stderr, "usage: sc_attach [-?dDv] [-c command] [-i infile] [-o outfile]\n" " [-O options] [-p [ip:]port] [-P priority] \n" " [-R unix] [-U unix]\n"); if(opt_mask == 0) return; fprintf(stderr, "\n"); if(opt_mask & OPT_HELP) fprintf(stderr, " -? give an overview of the usage of sc_attach\n"); if(opt_mask & OPT_DEBUG) fprintf(stderr, " -d output debugging information to stderr\n"); if(opt_mask & OPT_DAEMON) fprintf(stderr, " -D operate as a daemon\n"); if(opt_mask & OPT_VERSION) fprintf(stderr, " -v give the version string of sc_attach\n"); if(opt_mask & OPT_COMMAND) fprintf(stderr, " -c command to use with addresses in input file\n"); if(opt_mask & OPT_INFILE) fprintf(stderr, " -i input file\n"); if(opt_mask & OPT_OUTFILE) fprintf(stderr, " -o output warts file\n"); if(opt_mask & OPT_OPTIONS) { fprintf(stderr, " -O options\n"); fprintf(stderr, " random: send commands in random order\n"); fprintf(stderr, " impatient: send commands in bulk\n"); } if(opt_mask & OPT_PORT) fprintf(stderr, " -p [ip:]port to find scamper on\n"); if(opt_mask & OPT_PRIORITY) fprintf(stderr, " -P priority\n"); if(opt_mask & OPT_REMOTE) fprintf(stderr, " -R unix domain socket for remote scamper\n"); if(opt_mask & OPT_UNIX) fprintf(stderr, " -U unix domain socket for local scamper\n"); return; } static int check_options(int argc, char *argv[]) { int ch; long lo; char *opts = "c:dDi:o:O:p:P:R:U:v?"; char *opt_port = NULL, *opt_priority = NULL, *opt_unix = NULL; while((ch = getopt(argc, argv, opts)) != -1) { switch(ch) { case 'c': opt_command = optarg; break; case 'd': options |= OPT_DEBUG; break; case 'D': options |= OPT_DAEMON; break; case 'i': if(strcasecmp(optarg, "-") == 0) stdin_fd = STDIN_FILENO; else if((options & OPT_INFILE) == 0) infile_name = optarg; else return -1; options |= OPT_INFILE; break; case 'o': options |= OPT_OUTFILE; if(strcasecmp(optarg, "-") == 0) options |= OPT_STDOUT; else if(outfile_name == NULL) outfile_name = optarg; else return -1; break; case 'O': if(strcasecmp(optarg, "random") == 0) flags |= FLAG_RANDOM; else if(strcasecmp(optarg, "impatient") == 0) flags |= FLAG_IMPATIENT; else return -1; break; case 'p': options |= OPT_PORT; opt_port = optarg; break; case 'P': options |= OPT_PRIORITY; opt_priority = optarg; break; case 'R': options |= OPT_REMOTE; opt_unix = optarg; break; case 'U': options |= OPT_UNIX; opt_unix = optarg; break; case 'v': printf("$Id: sc_attach.c,v 1.23 2016/06/09 09:44:04 mjl Exp $\n"); return -1; case '?': default: usage(0xffffffff); return -1; } } /* these options are mandatory */ if((options & (OPT_INFILE|OPT_OUTFILE)) != (OPT_INFILE|OPT_OUTFILE) || (options & (OPT_PORT|OPT_REMOTE|OPT_UNIX)) == 0 || ((options & (OPT_PORT|OPT_REMOTE|OPT_UNIX)) != OPT_PORT && (options & (OPT_PORT|OPT_REMOTE|OPT_UNIX)) != OPT_REMOTE && (options & (OPT_PORT|OPT_REMOTE|OPT_UNIX)) != OPT_UNIX)) { if(options == 0) usage(0); else usage(OPT_INFILE|OPT_OUTFILE|OPT_PORT|OPT_REMOTE|OPT_UNIX); return -1; } if(options & OPT_PORT) { if(string_addrport(opt_port, &dst_addr, &dst_port) != 0) { usage(OPT_PORT); return -1; } } else if(options & (OPT_REMOTE|OPT_UNIX)) { unix_name = opt_unix; } if((options & OPT_PRIORITY) != 0) { if(string_tolong(opt_priority, &lo) != 0 || lo < 1) { usage(OPT_PRIORITY); return -1; } priority = lo; } if((options & OPT_DAEMON) != 0 && ((options & (OPT_STDOUT|OPT_DEBUG)) != 0 || stdin_fd != -1)) { usage(OPT_DAEMON); return -1; } if(options & OPT_STDOUT) { stdout_fd = STDOUT_FILENO; if(fcntl_set(stdout_fd, O_NONBLOCK) == -1) return -1; if((stdout_wb = scamper_writebuf_alloc()) == NULL) return -1; scamper_writebuf_usewrite(stdout_wb); } return 0; } static int command_new(char *line, void *param) { char *tmp = NULL, buf[65535]; size_t off = 0; if(line[0] == '#' || line[0] == '\0') return 0; if(opt_command != NULL) string_concat(buf, sizeof(buf), &off, "%s %s\n", opt_command, line); else string_concat(buf, sizeof(buf), &off, "%s\n", line); if((tmp=memdup(buf,off+1)) == NULL || slist_tail_push(commands,tmp) == NULL) { fprintf(stderr, "could not push command onto list\n"); if(tmp != NULL) free(tmp); return -1; } return 0; } /* * do_outfile * * open a file to send the binary warts data file to. */ static int do_outfile(void) { mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; int flags = O_WRONLY | O_CREAT | O_TRUNC; if(outfile_name == NULL) return 0; if((outfile_fd = open(outfile_name, flags, mode)) == -1) { fprintf(stderr, "%s: could not open %s: %s\n", __func__, outfile_name, strerror(errno)); return -1; } return 0; } static int do_method(void) { struct timeval tv; char *command; if(slist_count(commands) == 0) { if(stdin_fd == -1 && done == 0) { scamper_writebuf_send(scamper_wb, "done\n", 5); done = 1; more = 0; } return 0; } gettimeofday_wrap(&tv); command = slist_head_pop(commands); scamper_writebuf_send(scamper_wb, command, strlen(command)); if((options & OPT_DEBUG) != 0) fprintf(stderr, "%ld: %s", (long int)tv.tv_sec, command); if((flags & FLAG_IMPATIENT) == 0) more = 0; free(command); return 0; } static int do_stdinread_line(void *param, uint8_t *buf, size_t linelen) { char *cmd; if(buf[0] == '#') return 0; /* make a copy of the command string */ if((cmd = memdup(buf, linelen+2)) == NULL) { fprintf(stderr, "%s: could not memdup command: %s\n", __func__, strerror(errno)); return -1; } cmd[linelen] = '\n'; cmd[linelen+1] = '\0'; /* put the command string on the list of things to do */ if(slist_tail_push(commands, cmd) == NULL) { fprintf(stderr, "%s: could not push command onto list: %s\n", __func__, strerror(errno)); free(cmd); return -1; } return 0; } /* * do_scamperread * * the fd for the scamper process is marked as readable, so do a read * on it. */ static int do_stdinread(void) { ssize_t rc; uint8_t buf[4096]; if((rc = read(stdin_fd, buf, sizeof(buf))) > 0) { scamper_linepoll_handle(stdin_lp, buf, rc); return 0; } else if(rc == 0) { scamper_linepoll_flush(stdin_lp); stdin_fd = -1; return 0; } else if(errno == EINTR || errno == EAGAIN) { return 0; } fprintf(stderr, "%s: could not read: %s\n", __func__, strerror(errno)); return -1; } static int do_scamperread_line(void *param, uint8_t *buf, size_t linelen) { char *head = (char *)buf; uint8_t uu[64]; size_t uus; long l; /* skip empty lines */ if(head[0] == '\0') return 0; /* if currently decoding data, then pass it to uudecode */ if(data_left > 0) { uus = sizeof(uu); if(uudecode_line(head, linelen, uu, &uus) != 0) { fprintf(stderr, "could not uudecode_line\n"); error = 1; return -1; } if(uus != 0) { if(outfile_fd != -1) write_wrap(outfile_fd, uu, NULL, uus); if(stdout_fd != -1) scamper_writebuf_send(stdout_wb, uu, uus); } data_left -= (linelen + 1); return 0; } /* feedback letting us know that the command was accepted */ if(linelen >= 2 && strncasecmp(head, "OK", 2) == 0) return 0; /* if the scamper process is asking for more tasks, give it more */ if(linelen == 4 && strncasecmp(head, "MORE", linelen) == 0) { more = 1; if(do_method() != 0) return -1; return 0; } /* new piece of data */ if(linelen > 5 && strncasecmp(head, "DATA ", 5) == 0) { if(string_isnumber(head+5) == 0 || string_tolong(head+5, &l) != 0) { fprintf(stderr, "could not parse %s\n", head); error = 1; return -1; } data_left = l; return 0; } /* feedback letting us know that the command was not accepted */ if(linelen >= 3 && strncasecmp(head, "ERR", 3) == 0) { fprintf(stderr, "%s: command no accepted\n", __func__); error = 1; return -1; } fprintf(stderr, "unknown response '%s'\n", head); error = 1; return -1; } /* * do_scamperread * * the fd for the scamper process is marked as readable, so do a read * on it. */ static int do_scamperread(void) { ssize_t rc; uint8_t buf[4096]; if((rc = read(scamper_fd, buf, sizeof(buf))) > 0) { scamper_linepoll_handle(scamper_lp, buf, rc); return 0; } else if(rc == 0) { close(scamper_fd); scamper_fd = -1; return 0; } else if(errno == EINTR || errno == EAGAIN) { return 0; } fprintf(stderr, "%s: could not read: %s\n", __func__, strerror(errno)); return -1; } /* * do_scamperwrite * * the fd for the scamper process is marked as writable, so write to it. */ static int do_scamperwrite(void) { if(scamper_writebuf_write(scamper_fd, scamper_wb) != 0) { fprintf(stderr, "%s: could not write: %s\n", __func__, strerror(errno)); return -1; } return 0; } /* * do_scamperconnect * * allocate socket and connect to scamper process listening on the port * specified. */ static int do_scamperconnect(void) { struct sockaddr_un sun; struct sockaddr_storage sas; struct sockaddr *sa = (struct sockaddr *)&sas; struct in_addr in; char buf[256]; size_t off = 0; if(options & OPT_PORT) { if(dst_addr != NULL) { if(sockaddr_compose_str(sa, dst_addr, dst_port) != 0) { fprintf(stderr, "%s: could not compose sockaddr from %s:%d\n", __func__, dst_addr, dst_port); return -1; } } else { in.s_addr = htonl(INADDR_LOOPBACK); sockaddr_compose(sa, AF_INET, &in, dst_port); } if((scamper_fd = socket(sa->sa_family, SOCK_STREAM, IPPROTO_TCP)) < 0) { fprintf(stderr, "%s: could not allocate new socket: %s\n", __func__, strerror(errno)); return -1; } if(connect(scamper_fd, sa, sockaddr_len(sa)) != 0) { fprintf(stderr, "%s: could not connect to scamper process: %s\n", __func__, strerror(errno)); return -1; } } else { if(sockaddr_compose_un((struct sockaddr *)&sun, unix_name) != 0) { fprintf(stderr, "%s: could not build sockaddr_un: %s\n", __func__, strerror(errno)); return -1; } if((scamper_fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { fprintf(stderr, "%s: could not allocate unix domain socket: %s\n", __func__, strerror(errno)); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sun, sizeof(sun)) != 0) { fprintf(stderr, "%s: could not connect to scamper process: %s\n", __func__, strerror(errno)); return -1; } } if(fcntl_set(scamper_fd, O_NONBLOCK) == -1) { fprintf(stderr, "%s: could not set nonblock: %s\n", __func__, strerror(errno)); return -1; } if((scamper_lp = scamper_linepoll_alloc(do_scamperread_line,NULL)) == NULL || (scamper_wb = scamper_writebuf_alloc()) == NULL) { fprintf(stderr, "%s: could not alloc wb/lp: %s\n", __func__, strerror(errno)); return -1; } if(options & (OPT_PORT|OPT_UNIX)) { string_concat(buf, sizeof(buf), &off, "attach"); if((options & OPT_PRIORITY) != 0) string_concat(buf, sizeof(buf), &off, " priority %d", priority); string_concat(buf, sizeof(buf), &off, "\n"); if(scamper_writebuf_send(scamper_wb, buf, off) != 0) { fprintf(stderr, "%s: could not attach to scamper process: %s\n", __func__, strerror(errno)); return -1; } } return 0; } /* * do_stdoutwrite * * the fd for stdout is marked as writable, so write to it. */ static int do_stdoutwrite(void) { if(scamper_writebuf_write(stdout_fd, stdout_wb) != 0) { fprintf(stderr, "%s: could not write to stdout: %s\n", __func__, strerror(errno)); return -1; } if(scamper_writebuf_len(stdout_wb) == 0 && scamper_fd == -1) stdout_fd = -1; return 0; } /* * do_infile * * read the contents of the infile in one hit. */ static int do_infile(void) { if(infile_name != NULL) { if(file_lines(infile_name, command_new, NULL) != 0) { fprintf(stderr, "%s: could not read input file %s: %s\n", __func__, infile_name, strerror(errno)); return -1; } if((flags & FLAG_RANDOM) && slist_shuffle(commands) != 0) { fprintf(stderr, "%s: could not shuffle commands: %s\n", __func__, strerror(errno)); return -1; } } else if(stdin_fd != -1) { if((stdin_lp = scamper_linepoll_alloc(do_stdinread_line, NULL)) == NULL) { fprintf(stderr, "%s: could not alloc linepoll: %s\n", __func__, strerror(errno)); return -1; } } return 0; } int main(int argc, char *argv[]) { fd_set rfds, wfds, *rfdsp, *wfdsp; int nfds; #if defined(DMALLOC) free(malloc(1)); #endif atexit(cleanup); random_seed(); if(check_options(argc, argv) != 0) return -1; #ifdef HAVE_DAEMON if((options & OPT_DAEMON) != 0 && daemon(1, 0) != 0) return -1; #endif /* connect to the scamper process */ if(do_scamperconnect() != 0) return -1; if((commands = slist_alloc()) == NULL) { fprintf(stderr, "could not alloc commands list\n"); return -1; } if(do_infile() != 0) return -1; if(do_outfile() != 0) return -1; while(error == 0) { nfds = 0; FD_ZERO(&rfds); rfdsp = NULL; FD_ZERO(&wfds); wfdsp = NULL; if(more != 0) do_method(); /* interactions with the scamper process */ if(scamper_fd != -1) { FD_SET(scamper_fd, &rfds); rfdsp = &rfds; if(nfds < scamper_fd) nfds = scamper_fd; if(scamper_writebuf_len(scamper_wb) > 0) { FD_SET(scamper_fd, &wfds); wfdsp = &wfds; } } /* might read commands from stdin */ if(stdin_fd != -1) { FD_SET(stdin_fd, &rfds); rfdsp = &rfds; if(nfds < stdin_fd) nfds = stdin_fd; } /* might send output to stdout */ if(stdout_fd != -1 && scamper_writebuf_len(stdout_wb) > 0) { FD_SET(stdout_fd, &wfds); wfdsp = &wfds; if(nfds < stdout_fd) nfds = stdout_fd; } if(nfds == 0) break; if(select(nfds+1, rfdsp, wfdsp, NULL, NULL) < 0) { if(errno == EINTR) continue; fprintf(stderr, "%s: could not select: %s\n", __func__, strerror(errno)); break; } if(stdin_fd != -1 && rfdsp != NULL && FD_ISSET(stdin_fd, rfdsp) && do_stdinread() != 0) return -1; if(scamper_fd != -1 && rfdsp != NULL && FD_ISSET(scamper_fd, rfdsp) && do_scamperread() != 0) return -1; if(scamper_fd != -1 && wfdsp != NULL && FD_ISSET(scamper_fd, wfdsp) && do_scamperwrite() != 0) return -1; if(stdout_fd != -1 && wfdsp != NULL && FD_ISSET(stdout_fd, wfdsp) && do_stdoutwrite() != 0) return -1; } return 0; } scamper-cvs-20171204/utils/sc_attach/Makefile.in000644 001751 000000 00000060212 13211200062 021235 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_attach$(EXEEXT) subdir = utils/sc_attach ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_attach_OBJECTS = sc_attach.$(OBJEXT) ../../utils.$(OBJEXT) \ ../../mjl_list.$(OBJEXT) \ ../../scamper/scamper_writebuf.$(OBJEXT) \ ../../scamper/scamper_linepoll.$(OBJEXT) sc_attach_OBJECTS = $(am_sc_attach_OBJECTS) sc_attach_LDADD = $(LDADD) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_attach_SOURCES) DIST_SOURCES = $(sc_attach_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_attach_SOURCES = \ sc_attach.c \ ../../utils.c \ ../../mjl_list.c \ ../../scamper/scamper_writebuf.c \ ../../scamper/scamper_linepoll.c man_MANS = sc_attach.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_attach/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_attach/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../scamper/$(am__dirstamp): @$(MKDIR_P) ../../scamper @: > ../../scamper/$(am__dirstamp) ../../scamper/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../scamper/$(DEPDIR) @: > ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_writebuf.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_linepoll.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) sc_attach$(EXEEXT): $(sc_attach_OBJECTS) $(sc_attach_DEPENDENCIES) $(EXTRA_sc_attach_DEPENDENCIES) @rm -f sc_attach$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_attach_OBJECTS) $(sc_attach_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) -rm -f ../../scamper/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_linepoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_writebuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_attach.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) -rm -f ../../scamper/$(DEPDIR)/$(am__dirstamp) -rm -f ../../scamper/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_analysis_dump/.cvsignore000644 001751 000000 00000000062 11525063774 022620 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_analysis_dump scamper-cvs-20171204/utils/sc_analysis_dump/Makefile.am000644 001751 000000 00000000367 12055003625 022650 0ustar00mjlwheel000000 000000 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_analysis_dump sc_analysis_dump_SOURCES = sc_analysis_dump.c sc_analysis_dump_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_analysis_dump.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_analysis_dump/sc_analysis_dump.1000644 001751 000000 00000017141 13051671631 024236 0ustar00mjlwheel000000 000000 .\" .\" sc_analysis_dump.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (C) 2010 University of Waikato .\" Copyright (C) 2013-2014 The Regents of the University of California .\" All rights reserved .\" .\" $Id: sc_analysis_dump.1,v 1.10 2017/02/17 22:05:13 mjl Exp $ .\" .\" nroff -man sc_analysis_dump.1 .\" groff -man -Tascii sc_analysis_dump.1 | man2html -title sc_analysis_dump.1 .\" .Dd February 18, 2017 .Dt SC_ANALYSIS_DUMP 1 .Os .Sh NAME .Nm sc_analysis_dump .Nd dump of traceroute data in a format that is easily parsed. .Sh SYNOPSIS .Nm .Bk -words .Op Fl cCdeghHilMopQrstT .Op Fl D Ar debug-count .Op Fl G Ar geo-server .Op Fl S Ar skip-count .Op Ar .Sh DESCRIPTION The .Nm utility provides a dump of traceroute data in a format that is easily parsed by scripts. Each line output contains a summary of a single trace, and includes the interfaces visited and the delay of each response. The output format is identical to that of sk_analysis_dump from CAIDA, except that it uses the scamper file API to read both arts++ files produced by skitter and warts files produced by scamper. The .Nm utility only outputs traceroute data; for parsing other types of measurement, use .Xr sc_warts2json 1 instead. The options are as follows: .Bl -tag -width Ds .It Fl c disables printing the cycle number in each line of output. .It Fl C disables printing the comments about the output at the top of the output. .It Fl d disables printing the destination address in each line of output. .It Fl D Ar debug-count for each input file stop reading after the specified number of traces. .It Fl e adds the response from the destination to each line of output. Please read the bugs section below. .It Fl g use geographical data from netacuity. Not all builds of .Nm support this option. .It Fl G Ar geo-server specifies the name of the netacuity server to use. .It Fl h prints a help message and then exits. .It Fl H disables printing the halt fields: why traceroute halted and data for that reason. .It Fl i disables printing the RTT to each hop, and how many tries were required. .It Fl l disables printing the list id in each line of output. .It Fl M prints any MPLS label stack objects embedded in ICMP responses. .It Fl o prints each line of output using the old format from sk_analysis_dump 1.0. .It Fl p disables print path data in each line of output. .It Fl Q prints the IP-TTL from inside the ICMP quotation. .It Fl r disables printing the data associated the response from a destination: the RTT, the TTL of the probe, and the TTL of the response. .It Fl s disables printing the source IP address in each line of output. .It Fl S Ar skip-count skips the defined number of traces from each input file. .It Fl t disables printing the timestamp of when the traceroute began. .It Fl T prints the IP-TTL of the response packet. .El .Sh OUTPUT There is one trace per line. Fields are separated by a tab character. The output is structured into header fields (2 to 6), reply fields (7 to 10) corresponding to the response received from the destination, halt fields (11 and 12), and hop fields (beginning at index 13). .Bl -enum -width 2n -offset indent .It .Tn "Key" .Pp Indicates the type of line and determines the meaning of the remaining fields. This will always be 'T' for an IP trace. .It .Tn "Source" .Pp Source IP of skitter/scamper monitor performing the trace. .It .Tn "Destination" .Pp Destination IP being traced. .It .Tn "ListId" .Pp ID of the destination list containing this destination address. This value will be zero if no list ID was provided. A ListId is a 32 bit unsigned integer. .It .Tn "CycleId" .Pp ID of current probing cycle. A cycle is a single run through a given list. A CycleId is a 32 bit unsigned integer. For skitter traces, cycle IDs will be equal to or slightly earlier than the timestamp of the first trace in each cycle. There is no standard interpretation for scamper cycle IDs. This value will be zero if no cycle ID was provided. .It .Tn "Timestamp" .Pp Timestamp when trace began to this destination. .It .Tn "DestReplied" .Pp Whether a response from the destination was received. The character R is printed if a reply was received. The character N is printed if no reply was received. Since skitter sends a packet with a TTL of 255 when it halts probing, it is still possible for the final destination to send a reply and for the HaltReasonData (see below) to not equal no_halt. Note: scamper does not perform this last-ditch probing at TTL 255 by default. .It .Tn "DestRTT" .Pp The RTT (ms) of first response packet from destination. This value is zero if DestReplied is N. .It .Tn "RequestTTL" .Pp TTL set in request packet which elicited a response (echo reply) from the destination. This value is zero if DestReplied is N. .It .Tn "ReplyTTL" .Pp TTL found in reply packet from destination. This value is zero if DestReplied is N. .It .Tn "HaltReason" .Pp A single character corresponding to the reason, if any, why incremental probing stopped. S is printed if the destination was reached or there is no halt data. U is printed if an ICMP unreachable message was received. L is printed if a loop was detected. G is printed if the gaplimit was reached. .It .Tn "HaltReasonData" .Pp Extra data about why probing halted. If HaltReason is S, the zero is output. If HaltReason is U, the ICMP code of the unreachable message is printed. If HaltReason is L, the length of the loop is printed. If HaltReason is G, the length of the gap is printed. .It .Tn "PathComplete" .Pp Whether all hops to destination were found. C is printed if the trace is complete, all hops are found. I is printed if the trace is incomplete, at least one hop is missing (i.e., did not respond). .It .Tn "PerHopData" .Pp Response data for each hop. If multiple IP addresses respond at the same hop, response data for each IP address are separated by semicolons: .Pp IP,RTT,numTries (for only one responding IP) IP,RTT,numTries;IP,RTT,numTries;... (for multiple responding IPs) .Pp where IP is the IP address which sent a TTL expired packet, RTT is the RTT of the TTL expired packet, and numTries is the number of tries before a response was received from the TTL. .Pp This field has the value 'q' if there was no response at a hop. .Pp If the .Fl M option is specified, any MPLS label stack objects embedded in the ICMP response will be included in the following format, and the four fields correspond to each of the fields in a MPLS header. .Pp .in +.3i M|ttl|label|exp|s .in -.3i .Pp If the ICMP response embeds more than one MPLS header, they are given one at a time, each starting with an M. .Pp If the .Fl Q option is specified, the TTL value found in a quoted IP packet is included with the following format: .Pp .in +.3i Q|ttl .in -.3i .Pp If the .Fl T option is specified, the TTL value of the response packet is included with the following format: .Pp .in +.3i T|ttl .in -.3i .El .Sh EXAMPLES The command: .Pp .in +.3i sc_analysis_dump file1.warts file2.warts .in -.3i .Pp will decode and print the traceroute objects in file1.warts, followed by the traceroute objects in file2.warts. .Pp The command: .Pp .in +.3i gzcat file1.warts.gz | sc_analysis_dump .in -.3i .Pp will decode and print the traceroute objects in the uncompressed file supplied on stdin. .Sh BUGS When the .Fl e option is used, any unresponsive hops between the last responding router and the destination are not printed, which could imply an IP link where none exists. Use .Xr sc_warts2json 1 instead. .Sh SEE ALSO .Xr scamper 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2json 1 .Sh AUTHORS .Nm was written by Matthew Luckie . It was derived from CAIDA's sk_analysis_dump program and should behave in an identical manner. scamper-cvs-20171204/utils/sc_analysis_dump/sc_analysis_dump.c000644 001751 000000 00000056504 12210232401 024306 0ustar00mjlwheel000000 000000 /* * sc_analysis_dump * * $Id: sc_analysis_dump.c,v 1.59 2013/08/31 00:12:49 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2013 The Regents of the University of California * Copyright (C) 2012 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_analysis_dump.c,v 1.59 2013/08/31 00:12:49 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_list.h" #include "scamper_addr.h" #include "scamper_file.h" #include "scamper_icmpext.h" #include "trace/scamper_trace.h" #include "mjl_splaytree.h" #include "utils.h" #define OPT_SKIP 0x00001 #define OPT_DEBUG 0x00002 #define OPT_DSTEND 0x00004 #define OPT_OLDFORMAT 0x00008 #define OPT_HIDECOMMENTS 0x00010 #define OPT_HIDESRC 0x00020 #define OPT_HIDEDST 0x00040 #define OPT_HIDELIST 0x00080 #define OPT_HIDECYCLE 0x00100 #define OPT_HIDETIME 0x00200 #define OPT_HIDEREPLY 0x00400 #define OPT_HIDEHALT 0x00800 #define OPT_HIDEPATH 0x01000 #define OPT_HIDEIRTT 0x02000 #define OPT_HELP 0x04000 #define OPT_SHOWUSERID 0x08000 #define OPT_SHOWQTTL 0x10000 #define OPT_SHOWMPLS 0x20000 #define OPT_SHOWIPTTL 0x40000 static uint32_t options = 0; static int skip_numlines = 0; static int debug_numlines = 0; /* the input warts files */ static char **filelist = NULL; static int filelist_len = 0; /* where the output goes. stdout by default */ static FILE *out = NULL; #ifdef HAVE_NETACUITY #define OPT_GEO 0x08000 #define OPT_GEOSERV 0x10000 static char *geo_serv = NULL; static struct splaytree_t *geo_seen = NULL; #endif static void usage(void) { fprintf(stderr, "usage: sc_analysis_dump [-oeCsdlctrHpighUQMT]\n" " [-S skip count] [-D debug count]\n" " [-G geo server] [file1 file2 ... fileN]\n"); return; } static int check_options(int argc, char *argv[]) { int i, ch; char opts[48]; snprintf(opts, sizeof(opts), "oeCsdlctrHpiS:D:?UQMT"); #ifdef HAVE_NETACUITY strcat(opts, "gG:"); #endif while((i = getopt(argc, argv, opts)) != -1) { ch = (char)i; switch(ch) { case 'S': options |= OPT_SKIP; skip_numlines = atoi(optarg); break; case 'D': options |= OPT_DEBUG; debug_numlines = atoi(optarg); break; case 'e': options |= OPT_DSTEND; break; case 'o': options |= OPT_OLDFORMAT; break; case 'C': options |= OPT_HIDECOMMENTS; break; case 's': options |= OPT_HIDESRC; break; case 'd': options |= OPT_HIDEDST; break; case 'l': options |= OPT_HIDELIST; break; case 'c': options |= OPT_HIDECYCLE; break; case 't': options |= OPT_HIDETIME; break; case 'r': options |= OPT_HIDEREPLY; break; case 'H': options |= OPT_HIDEHALT; break; case 'p': options |= OPT_HIDEPATH; break; case 'i': options |= OPT_HIDEIRTT; break; case 'U': options |= OPT_SHOWUSERID; break; case 'Q': options |= OPT_SHOWQTTL; break; case 'M': options |= OPT_SHOWMPLS; break; case 'T': options |= OPT_SHOWIPTTL; break; #ifdef HAVE_NETACUITY case 'g': options |= OPT_GEO; break; case 'G': options |= OPT_GEOSERV; geo_serv = optarg; break; #endif case '?': options |= OPT_HELP; break; default: usage(); return -1; } } filelist = argv + optind; filelist_len = argc - optind; return 0; } static char *rtt_tostr(char *str, const size_t len, const struct timeval *rtt) { if(rtt != NULL) { snprintf(str, len, "%ld.%03d", (long)((rtt->tv_sec * 1000) + (rtt->tv_usec / 1000)), (int)(rtt->tv_usec % 1000)); } else { str[0] = '\0'; } return str; } static void print_help() { usage(); fprintf(stderr, " This program prints out scamper warts and skitter arts traces.\n" " C - hide comments\n" " o - old format version 1.0\n" " s - hide Source \n" " d - hide Destination \n" " l - hide list number\n" " c - hide cycle number\n" " U - show userid number\n" " t - hide Timestamp \n" " r - hide Reply Fields\n" " DestReplied, DestRTT, RequestTTL, ReplyTTL \n" " H - hide Halt Fields \n" " HaltReason, HaltReasonData\n" " p - hide Path Fields \n" " PathComplete, PerHopData\n" " i - hides hop non IP data\n" " HopRTT, HopNumTries\n" " M - show MPLS headers recorded in ICMP extension headers\n" " Q - show quoted IP-TTL in response\n" " T - show IP-TTL in response\n" "\n" " e - add Destination to Ending\n" "\n" " D numline - debug mode that only reads the first numline objects\n" " S numline - skips first numline objects in the file\n" "\n" #ifdef HAVE_NETACUITY " g - print out geographical information\n" " assuming that environmental variable NETACUITY_SERVER is set\n" " to the NETACUITY server\n" " G servername - the same as g except it uses the servername\n" " given on the command line.\n" " \n" #endif " ? - prints this message\n" " \n" ); return; } static void print_header_comments(void) { uint32_t u32; int i = 1; char buf[64], buf2[64], buf3[64]; size_t off; printf( "# =======================================================================\n" "# This file contains an ASCII representation of the IP paths stored in\n" "# the binary skitter arts++ and scamper warts file formats.\n" "#\n" "# This ASCII file format is in the sk_analysis_dump text output\n" "# format: imdc.datcat.org/format/1-003W-7\n" "#\n" "# =======================================================================\n" "# There is one trace per line, with the following tab-separated fields:\n" "#\n" "#\n"); if((options & OPT_OLDFORMAT) == 0) { printf( "# %2d. Key -- Indicates the type of line and determines the meaning of the\n" "# remaining fields. This will always be 'T' for an IP trace.\n" "#\n", i++); u32 = (OPT_HIDESRC|OPT_HIDEDST|OPT_HIDELIST|OPT_HIDECYCLE|OPT_HIDETIME); if((options & u32) != u32 || (options & OPT_SHOWUSERID) != 0) printf( "# -------------------- Header Fields ------------------\n" "#\n"); if((options & OPT_HIDESRC) == 0) printf( "# %2d. Source -- Source IP of skitter/scamper monitor performing the trace.\n" "#\n", i++); if((options & OPT_HIDEDST) == 0) printf( "# %2d. Destination -- Destination IP being traced.\n" "#\n", i++); if((options & OPT_HIDELIST) == 0) printf( "# %2d. ListId -- ID of the list containing this destination address.\n" "#\n" "# This value will be zero if no list ID was provided. (uint32_t)\n" "#\n", i++); if((options & OPT_HIDECYCLE) == 0) printf( "# %2d. CycleId -- ID of current probing cycle (a cycle is a single run\n" "# through a given list). For skitter traces, cycle IDs\n" "# will be equal to or slightly earlier than the timestamp\n" "# of the first trace in each cycle. There is no standard\n" "# interpretation for scamper cycle IDs.\n" "#\n" "# This value will be zero if no cycle ID was provided. (uint32_t)\n" "#\n", i++); if((options & OPT_SHOWUSERID) != 0) printf( "# %2d. UserId -- ID provided by the user for this trace.\n" "#\n" "# This value will be zero if no user ID was provided. (uint32_t)\n" "#\n", i++); if((options & OPT_HIDETIME) == 0) printf( "# %2d. Timestamp -- Timestamp when trace began to this destination.\n" "#\n", i++); if((options & OPT_HIDEREPLY) == 0) { printf( "# -------------------- Reply Fields ------------------\n" "#\n" "# %2d. DestReplied -- Whether a response from the destination was received.\n" "#\n" "# R - Replied, reply was received\n" "# N - Not-replied, no reply was received;\n" "# Since skitter sends a packet with a TTL of 255 when it halts\n" "# probing, it is still possible for the final destination to\n" "# send a reply and for the HaltReasonData (see below) to not\n" "# equal no_halt. Note: scamper does not perform last-ditch\n" "# probing at TTL 255 by default.\n" "#\n", i++); printf( "# %2d. DestRTT -- RTT (ms) of first response packet from destination.\n" "# 0 if DestReplied is N.\n" "#\n", i++); printf( "# %2d. RequestTTL -- TTL set in request packet which elicited a response\n" "# (echo reply) from the destination.\n" "# 0 if DestReplied is N.\n" "#\n", i++); printf( "# %2d. ReplyTTL -- TTL found in reply packet from destination;\n" "# 0 if DestReplied is N.\n" "#\n", i++); } if((options & OPT_HIDEHALT) == 0) { printf( "# -------------------- Halt Fields ------------------\n" "#\n" "# %2d. HaltReason -- The reason, if any, why incremental probing stopped.\n" "#\n", i++); printf( "# %2d. HaltReasonData -- Extra data about why probing halted.\n" "#\n" "# HaltReason HaltReasonData\n" "# ------------------------------------\n" "# S (success/no_halt) 0\n" "# U (icmp_unreachable) icmp_code\n" "# L (loop_detected) loop_length\n" "# G (gap_detected) gap_limit\n" "#\n", i++); } } if((options & OPT_HIDEPATH) == 0) { printf( "# -------------------- Path Fields ------------------\n" "#\n" "# %2d. PathComplete -- Whether all hops to destination were found.\n" "#\n" "# C - Complete, all hops found\n" "# I - Incomplete, at least one hop is missing (i.e., did not\n" "# respond)\n" "#\n", i++); printf( "# %2d. PerHopData -- Response data for the first hop.\n" "#\n" "# If multiple IP addresses respond at the same hop, response data\n" "# for each IP address are separated by semicolons:\n" "#\n", i++); off = 0; string_concat(buf, sizeof(buf), &off, "IP"); if((options & OPT_HIDEIRTT) == 0) string_concat(buf, sizeof(buf), &off, ",RTT,nTries"); if((options & OPT_SHOWQTTL) != 0) string_concat(buf, sizeof(buf), &off, ",Q|quoted-TTL"); if((options & OPT_SHOWMPLS) != 0) string_concat(buf, sizeof(buf), &off, ",M|ttl|label|exp|s"); if((options & OPT_SHOWIPTTL) != 0) string_concat(buf, sizeof(buf), &off, ",T|IP-TTL"); snprintf(buf2, sizeof(buf2), "# %%-%ds %%s\n", (int)((off*2) + 5)); printf(buf2, buf, "(for only one responding IP)"); snprintf(buf3, sizeof(buf3), "%s;%s;...", buf, buf); printf(buf2, buf3, "(for multiple responding IPs)"); printf( "#\n" "# where\n" "#\n" "# IP -- IP address which sent a TTL expired packet\n"); if((options & OPT_HIDEIRTT) == 0) { printf( "# RTT -- RTT of the TTL expired packet\n" "# nTries -- number of tries before response received from hop\n"); } if((options & OPT_SHOWQTTL) != 0) { printf( "# qTTL -- the IP-TTL in the quoted packet ('-' if not present)\n"); } if((options & OPT_SHOWMPLS) != 0) { printf( "# ttl -- the TTL in the MPLS header\n" "# label -- the label in the MPLS header\n" "# exp -- the value of the 3 Exp bits in the MPLS header\n" "# s -- the value of the 'S' bit in the MPLS header\n"); } printf( "#\n" "# This field will have the value 'q' if there was no response at\n" "# this hop.\n" "#\n"); printf( "# %2d. PerHopData -- Response data for the second hop in the same format\n" "# as field %d.\n", i, i-1); printf( "#\n" "# ...\n" "#\n"); if(options & OPT_DSTEND) { printf( "# N. PerHopData -- Response data for the destination\n" "# (if destination replied).\n" "#\n" ); } } return; } static void print_header_fields(const scamper_trace_t *trace) { char buf[256]; if((options & OPT_HIDESRC) == 0) fprintf(out, "\t%s", scamper_addr_tostr(trace->src, buf, sizeof(buf))); if((options & OPT_HIDEDST) == 0) fprintf(out, "\t%s", scamper_addr_tostr(trace->dst, buf, sizeof(buf))); if((options & OPT_HIDELIST) == 0) fprintf(out, "\t%d", (trace->list != NULL) ? trace->list->id : 0); if((options & OPT_HIDECYCLE) == 0) fprintf(out, "\t%d", (trace->cycle != NULL) ? trace->cycle->id : 0); if((options & OPT_SHOWUSERID) != 0) fprintf(out, "\t%d", trace->userid); if((options & OPT_HIDETIME) == 0) fprintf(out, "\t%ld", (long)trace->start.tv_sec); return; } static void print_reply_fields(const scamper_trace_hop_t *dst) { char rtt[64]; if(dst != NULL) { rtt_tostr(rtt, sizeof(rtt), &dst->hop_rtt); fprintf(out, "\tR\t%s\t%d\t%d", rtt, dst->hop_probe_ttl, dst->hop_reply_ttl); } else { fprintf(out, "\tN\t0\t0\t0"); } return; } static void print_halt_fields(const scamper_trace_t *trace) { int l; switch(trace->stop_reason) { case SCAMPER_TRACE_STOP_COMPLETED: case SCAMPER_TRACE_STOP_NONE: fprintf(out, "\tS\t0"); break; case SCAMPER_TRACE_STOP_UNREACH: fprintf(out, "\tU\t%d", trace->stop_data); break; case SCAMPER_TRACE_STOP_LOOP: if((l = trace->stop_data) == 0) { l = scamper_trace_loop(trace, 1, NULL, NULL); } fprintf(out, "\tL\t%d", l); break; case SCAMPER_TRACE_STOP_GAPLIMIT: fprintf(out, "\tG\t%d", trace->stop_data); break; default: fprintf(out, "\t?\t0"); break; } return; } static void print_old_fields(const scamper_trace_t *trace, const scamper_trace_hop_t *hop) { char src[256], dst[256], rtt[256]; fprintf(out, " %s %s %ld %s %d", scamper_addr_tostr(trace->src, src, sizeof(src)), scamper_addr_tostr(trace->dst, dst, sizeof(dst)), (long)trace->start.tv_sec, rtt_tostr(rtt, sizeof(rtt), (hop != NULL) ? &hop->hop_rtt : NULL), trace->hop_count); return; } static char *hop_tostr(const scamper_trace_hop_t *hop, char *buf, size_t len) { const scamper_icmpext_t *ie; char rtt[128], addr[128]; size_t off = 0; int i; string_concat(buf, len, &off, "%s", scamper_addr_tostr(hop->hop_addr, addr, sizeof(addr))); if((options & OPT_HIDEIRTT) == 0) string_concat(buf, len, &off, ",%s,%d", rtt_tostr(rtt, sizeof(rtt), &hop->hop_rtt), hop->hop_probe_id); if((options & OPT_SHOWQTTL) != 0 && SCAMPER_TRACE_HOP_IS_ICMP_Q(hop)) string_concat(buf, len, &off, ",Q|%d", hop->hop_icmp_q_ttl); if((options & OPT_SHOWIPTTL) != 0) string_concat(buf, len, &off, ",T|%d", hop->hop_reply_ttl); if((options & OPT_SHOWMPLS) != 0) { for(ie=hop->hop_icmpext; ie != NULL; ie = ie->ie_next) { if(SCAMPER_ICMPEXT_IS_MPLS(ie)) { for(i=0; ihop_count != 0) { for(i=0; ihop_count; i++) { for(hop = trace->hops[i]; hop != NULL; hop = hop->hop_next) print_geo_info(hop->hop_addr); } } #endif /* * decide what the path_complete flag should be set to. if we reached * the destination then the path_complete flag == 'C' (for complete). * otherwise the path_complete flag == 'I' (incomplete) or 'N' if * using the old sk_analysis_dump output format. */ path_complete = 'I'; if(dst != NULL) { for(i=0; ihop_probe_ttl; i++) if(trace->hops[i] == NULL) break; if(i == dst->hop_probe_ttl && (options & OPT_OLDFORMAT) == 0) path_complete = 'C'; } else if(options & OPT_OLDFORMAT) { path_complete = 'N'; } /* * actually output the path complete flag, and some extra old fields * if requested */ if((options & OPT_OLDFORMAT) == 0) { fprintf(out, "\t%c", path_complete); } else { fprintf(out, "%c", path_complete); print_old_fields(trace, dst); } for(i=0; ihop_count; i++) { if((hop = trace->hops[i]) != NULL) { /* don't print out the hop corresponding to the destination */ if(hop == dst) { if(hop->hop_next == NULL) break; else hop = hop->hop_next; } while(unresponsive > 0) { fprintf(out, "%c", options & OPT_OLDFORMAT ? ' ' : '\t'); fprintf(out, "q"); unresponsive--; } fprintf(out, "%c", options & OPT_OLDFORMAT ? ' ' : '\t'); for(;;) { if((options & OPT_OLDFORMAT) == 0) fprintf(out, "%s", hop_tostr(hop, buf, sizeof(buf))); if((hop = hop->hop_next) != NULL && hop != dst) { if((options & OPT_OLDFORMAT) == 0) fprintf(out, ";"); else fprintf(out, ","); } else break; } } else { unresponsive++; } } if(dst != NULL && options & OPT_DSTEND) { while (i < dst->hop_probe_ttl-1) { i++; fprintf(out, "\tq"); } fprintf(out, "\t%s", hop_tostr(dst, buf, sizeof(buf))); } return; } #ifdef HAVE_NETACUITY static int print_geo_info(scamper_addr_t *addr) { na_geo_struct answer; char buf[256]; if(splaytree_find(geo_seen, addr) != NULL) { return 0; } if(splaytree_insert(geo_seen, scamper_addr_use(addr)) != 1) { return -1; } if(scamper_addr_tostr(addr, buf, sizeof(buf)) == NULL) { return -1; } if(na_query_geo(buf, &answer)) { fprintf(out, "G\t%s\t%s=%d\t%s=%d\t%s=%d\t%s\t%d\t%.3f\t%.3f\n", buf, answer.country, answer.country_c, answer.region, answer.region_c, answer.city, answer.city_c, answer.speed, answer.metro_code, answer.latitude, answer.longitude); } else { fprintf(stderr, "Error in na_query_geo(%s)\n", buf); } return 0; } static void print_path_geo_info(const scamper_trace_t *trace) { scamper_trace_hop_t *hop; int i; for(i=0; ihop_count; i++) { for(hop = trace->hops[i]; hop != NULL; hop = hop->hop_next) { print_geo_info(hop->hop_addr); } } return; } static int setup_netacuity_server(char *server) { struct addrinfo hints, *res, *res0; char buf[256]; int set = 0; memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = IPPROTO_UDP; hints.ai_family = AF_INET; if((error = getaddrinfo(ipstr, NULL, &hints, &res0)) != 0 || res0 == NULL) { fprintf(stderr, "could not resolve %s: %s", server, gai_strerror(error)); return -1; } for(res = res0; res != NULL; res = res->ai_next) { if(res->ai_family == PF_INET) { inet_ntop(res->ai_family, &((struct sockaddr_in *)ai_list->ai_addr)->sin_addr, buf, sizeof(buf)); if(na_api_set_server_addr(buf)) { set = 1; break; } else { fprintf(stderr, "Error in setting server addr %s", buf); } } } freeaddrinfo(res0); if(set == 1) { geo_seen = splaytree_alloc((splaytree_cmp_t)scamper_addr_cmp); if(geo_seen == NULL) { return -1; } return 0; } return -1; } #endif /* HAVE_NETACUITY */ static void print_trace(const scamper_trace_t *trace) { scamper_trace_hop_t *dst = NULL, *hop; int i; if(trace->hop_count == 0 && trace->stop_reason == SCAMPER_TRACE_STOP_ERROR) { return; } /* try and determine the hop that corresponds to the destination */ if(trace->hop_count > 0 && trace->stop_reason != SCAMPER_TRACE_STOP_ERROR) { for(i=trace->hop_count-1; i>=0 && dst == NULL; i--) { for(hop = trace->hops[i]; hop != NULL; hop = hop->hop_next) { if(SCAMPER_TRACE_HOP_IS_ICMP_UNREACH_PORT(hop)) { if(SCAMPER_TRACE_TYPE_IS_UDP(trace) || SCAMPER_TRACE_TYPE_IS_TCP(trace)) { dst = hop; break; } } if(SCAMPER_TRACE_HOP_IS_ICMP_ECHO_REPLY(hop)) { if(SCAMPER_TRACE_TYPE_IS_ICMP(trace)) { dst = hop; break; } } if((hop->hop_flags & SCAMPER_TRACE_HOP_FLAG_TCP) != 0 && SCAMPER_TRACE_TYPE_IS_TCP(trace)) { dst = hop; break; } } } } #ifdef HAVE_NETACUITY if(options & OPT_GEO) { if((options & OPT_HIDESRC) == 0) { print_geo_info(trace->src); } if((options & OPT_HIDEDST) == 0) { print_geo_info(trace->dst); } if((options & OPT_HIDEPATH) == 0) { print_path_geo_info(trace); } } #endif if((options & OPT_OLDFORMAT) == 0) { fprintf(out, "T"); print_header_fields(trace); if((options & OPT_HIDEREPLY) == 0) { print_reply_fields(dst); } if((options & OPT_HIDEHALT) == 0) { print_halt_fields(trace); } } if((options & OPT_HIDEPATH) == 0 || (options & OPT_OLDFORMAT)) { print_path_fields(trace, dst); } fprintf(out, "\n"); fflush(out); return; } static void process(scamper_file_t *file, scamper_file_filter_t *filter) { scamper_trace_t *trace; uint16_t type; int n = 0; while(scamper_file_read(file, filter, &type, (void *)&trace) == 0) { if(trace == NULL) break; /* EOF */ if((options & OPT_DEBUG) && n == debug_numlines) { scamper_trace_free(trace); break; } n++; if(n > skip_numlines) { print_trace(trace); } scamper_trace_free(trace); } scamper_file_close(file); return; } int main(int argc, char *argv[]) { scamper_file_t *file; scamper_file_filter_t *filter; uint16_t type = SCAMPER_FILE_OBJ_TRACE; int i; #ifdef _WIN32 WSADATA wsaData; WSAStartup(MAKEWORD(2,2), &wsaData); #endif out = stdout; if(check_options(argc, argv) == -1) { return -1; } if(options & OPT_HELP) { print_help(); return 0; } if((filter = scamper_file_filter_alloc(&type, 1)) == NULL) { return -1; } if((options & OPT_HIDECOMMENTS) == 0) { print_header_comments(); } if(filelist_len != 0) { for(i=0; i&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_analysis_dump$(EXEEXT) subdir = utils/sc_analysis_dump ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_sc_analysis_dump_OBJECTS = sc_analysis_dump.$(OBJEXT) sc_analysis_dump_OBJECTS = $(am_sc_analysis_dump_OBJECTS) sc_analysis_dump_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_analysis_dump_SOURCES) DIST_SOURCES = $(sc_analysis_dump_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_analysis_dump_SOURCES = sc_analysis_dump.c sc_analysis_dump_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_analysis_dump.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_analysis_dump/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_analysis_dump/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list sc_analysis_dump$(EXEEXT): $(sc_analysis_dump_OBJECTS) $(sc_analysis_dump_DEPENDENCIES) $(EXTRA_sc_analysis_dump_DEPENDENCIES) @rm -f sc_analysis_dump$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_analysis_dump_OBJECTS) $(sc_analysis_dump_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_analysis_dump.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/utils/sc_ally/.cvsignore000644 001751 000000 00000000051 11533061766 020705 0ustar00mjlwheel000000 000000 .deps .libs Makefile Makefile.in sc_ally scamper-cvs-20171204/utils/sc_ally/Makefile.am000644 001751 000000 00000000612 12474143172 020741 0ustar00mjlwheel000000 000000 AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = sc_ally sc_ally_SOURCES = \ sc_ally.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c sc_ally_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_ally.1 CLEANFILES = *~ *.core scamper-cvs-20171204/utils/sc_ally/sc_ally.1000644 001751 000000 00000011244 13026714710 020414 0ustar00mjlwheel000000 000000 .\" .\" sc_ally.1 .\" .\" Author: Matthew Luckie .\" .\" Copyright (c) 2011 University of Waikato .\" Copyright (c) 2016 Matthew Luckie .\" All rights reserved .\" .\" $Id: sc_ally.1,v 1.6 2016/12/22 09:15:52 mjl Exp $ .\" .Dd December 22, 2016 .Dt SC_ALLY 1 .Os .Sh NAME .Nm sc_ally .Nd scamper driver to run Ally on a list of candidate aliases. .Sh SYNOPSIS .Nm .Bk -words .Op Fl ?D .Op Fl a Ar infile .Op Fl o Ar outfile .Op Fl p Ar port .Op Fl U Ar unix-socket .Op Fl f Ar fudge .Op Fl i Ar probe-wait .Op Fl O Ar options .Op Fl q Ar attempts .Op Fl t Ar logfile .Op Fl w Ar waittime .Ek .Pp .Nm .Bk -words .Op Fl d Ar dump-id .Op Fl O Ar options .Op Ar .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility provides the ability to connect to a running .Xr scamper 1 instance and have a set of IPv4 address-pairs tested for aliases using the Ally technique. For each address pair in the file, .Nm establishes which probe methods (UDP, TCP-ack, ICMP-echo) solicit an incrementing IP-ID value, and then uses the Ally technique on pairs where a probe method is able to obtain an incrementing IP-ID for both addresses. .Nm can also infer which IP addresses are aliases using the Mercator common source address technique as a byproduct of the UDP probing that .Nm does. The output of .Nm is written to a .Xr warts 5 file, which can then be processed to extract aliases. The options are as follows: .Bl -tag -width Ds .It Fl ? prints a list of command line options and a synopsis of each. .It Fl D causes .Nm to detach and become a daemon. .It Fl a Ar infile specifies the name of the input file which consists of a sequence of IPv4 address-pairs, one pair per line. .It Fl o Ar outfile specifies the name of the output file to be written. The output file will use the warts format. .It Fl p Ar port specifies the port on the local host where .Xr scamper 1 is accepting control socket connections. .It Fl U Ar unix-socket specifies the name of a unix domain socket where .Xr scamper 1 is accepting control socket connections. .It Fl d Ar dump-id specifies the number identifying an analysis to conduct. The current choices for are 1-3, and are: .Bl -dash -offset 2n -compact -width 1n .It .Sy 1: dump aliases inferred using the Ally (IPID-based) technique. .It .Sy 2: dump aliases inferred using the Mercator (common source address based) technique. .It .Sy 3: dump aliases inferred using both Ally and Mercator techniques. .El .It Fl f Ar fudge specifies the fudge factor to use when (1) inferring if IPIDs are assigned from a counter, and (2) inferring if two addresses share the same counter. .It Fl i Ar probe-wait specifies the inter-probe gap for both ping and Ally measurements, in milliseconds. The default is 1000ms (1 second); the minimum is 200ms, and the maximum is 2000ms. .It Fl O Ar options allows the behavior of .Nm to be further tailored. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy nobs: do not consider byte swapped IPID values when inferring if IPID values are assigned from a counter. .It .Sy tc: dump transitive closure when reporting aliases. .El .It Fl q Ar attempts specifies the number of times to try Ally when one of the addresses is unresponsive. .It Fl t Ar logfile specifies the name of a file to log output from .Nm generated at run time. .It Fl w Ar waittime specifies the minimum length of time, in seconds, to wait between completing a measurement to a particular IP address and issuing the next. .El .\"""""""""""" .Sh EXAMPLES Given a set of IPv4-address pairs in a file named infile.txt: .Pp .in +.3i .nf 192.0.2.1 192.0.32.10 192.0.2.2 192.0.31.8 192.0.2.3 192.0.30.64 .fi .in -.3i .Pp and a .Xr scamper 1 daemon listening on port 31337, then these address-pairs can be tested for aliases using .Pp sc_ally -i infile.txt -o outfile.warts -p 31337 .Pp To obtain a list of inferred alias pairs using the Ally technique from a .Xr warts 5 file: .Pp sc_ally -d 1 outfile.warts .Pp To obtain a list of inferred routers using a transitive closure of alias pairs inferred using the Ally and Mercator techniques: .Pp sc_ally -d 3 -O tc outfile.warts .\"""""""""""" .Sh SEE ALSO .Xr scamper 1 , .Xr sc_radargun 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2text 1 , .Rs .%A "N. Spring" .%A "R. Mahajan" .%A "D. Wetherall" .%T "Measuring ISP topologies with Rocketfuel" .%O "Proc. ACM SIGCOMM 2002" .Re .Rs .%A "R. Govindan" .%A "H. Tangmunarunkit" .%T "Heuristics for Internet Map Discovery" .%O "Proc. IEEE INFOCOM 2000" .Re .Rs .%A "A. Bender" .%A "R. Sherwood" .%A "N. Spring" .%T "Fixing Ally's growing pains with velocity modeling" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2008" .Re .Sh AUTHORS .Nm was written by Matthew Luckie . scamper-cvs-20171204/utils/sc_ally/sc_ally.c000644 001751 000000 00000142737 13026714710 020512 0ustar00mjlwheel000000 000000 /* * sc_ally : scamper driver to collect data on candidate aliases using the * Ally method. * * $Id: sc_ally.c,v 1.34 2016/12/22 09:15:52 mjl Exp $ * * Copyright (C) 2009-2011 The University of Waikato * Copyright (C) 2013-2015 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: sc_ally.c,v 1.34 2016/12/22 09:15:52 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "ping/scamper_ping.h" #include "dealias/scamper_dealias.h" #include "scamper_file.h" #include "scamper_writebuf.h" #include "scamper_linepoll.h" #include "mjl_list.h" #include "mjl_heap.h" #include "mjl_splaytree.h" #include "utils.h" #define TEST_PING 1 #define TEST_ALLY 2 #define IPID_NONE 0 #define IPID_INCR 1 #define IPID_RAND 2 #define IPID_ECHO 3 #define IPID_CONST 4 #define IPID_UNRESP 5 #define METHOD_ICMP 1 #define METHOD_TCP 2 #define METHOD_UDP 3 typedef struct sc_ipidseq { scamper_addr_t *addr; uint8_t udp; uint8_t icmp; uint8_t tcp; } sc_ipidseq_t; /* * sc_router_t * * collect a set of interfaces mapped to a router */ typedef struct sc_router { slist_t *addrs; dlist_node_t *node; } sc_router_t; /* * sc_addr2router_t * * map an address to a router. */ typedef struct sc_addr2router { scamper_addr_t *addr; sc_router_t *router; } sc_addr2router_t; /* * sc_pair_t * * associate pair of IP addresses */ typedef struct sc_pair { scamper_addr_t *a; scamper_addr_t *b; } sc_pair_t; typedef struct sc_test { int type; void *data; } sc_test_t; /* * sc_target * */ typedef struct sc_target { scamper_addr_t *addr; sc_test_t *test; splaytree_node_t *node; slist_t *blocked; } sc_target_t; /* * sc_allytest * * keep state about the pair-wise ally tests being conducted on a set * of candidate aliases, where the set contains more than two * addresses and we try to resolve the aliases efficiently. */ typedef struct sc_allytest { sc_target_t *a; sc_target_t *b; int attempt; int method; slist_t *addr_list; slist_node_t *s1, *s2; splaytree_t *router_tree; dlist_t *router_list; } sc_allytest_t; /* * sc_pingtest * * keep state about the ping tests being used to find probe methods that * solicit packets with incrementing IPID values */ typedef struct sc_pingtest { sc_target_t *target; int step; } sc_pingtest_t; /* * sc_waittest * * wait for the prescribed length of time before doing the prescribed * test. */ typedef struct sc_waittest { struct timeval tv; sc_test_t *test; } sc_waittest_t; typedef struct sc_dump { char *descr; int (*proc_ping)(const scamper_ping_t *ping); int (*proc_ally)(const scamper_dealias_t *dealias); void (*finish)(void); } sc_dump_t; /* declare dump functions used for dump_funcs[] below */ static int process_1_ally(const scamper_dealias_t *); static void finish_1(void); static int process_2_ping(const scamper_ping_t *); static void finish_2(void); static int process_3_ping(const scamper_ping_t *); static int process_3_ally(const scamper_dealias_t *); static void finish_3(void); static uint32_t options = 0; static uint32_t flags = 0; static int scamper_fd = -1; static scamper_linepoll_t *scamper_lp = NULL; static scamper_writebuf_t *scamper_wb = NULL; static int port = 0; static char *unix_name = NULL; static char *addressfile = NULL; static char *outfile_name = NULL; static int outfile_fd = -1; static scamper_file_filter_t *ffilter = NULL; static scamper_file_t *decode_in = NULL; static int decode_in_fd = -1; static int decode_out_fd = -1; static scamper_writebuf_t *decode_wb = NULL; static int data_left = 0; static int more = 0; static int probing = 0; static int waittime = 5; static int attempts = 5; static int error = 0; static int probe_wait = 1000; static int fudge = 5000; static struct timeval now; static FILE *text = NULL; static splaytree_t *targets = NULL; static splaytree_t *ipidseqs = NULL; static slist_t *virgin = NULL; static heap_t *waiting = NULL; static int dump_id = 0; static char **dump_files; static int dump_filec = 0; static const sc_dump_t dump_funcs[] = { {NULL, NULL, NULL, NULL}, {"dump aliases inferred with Ally (IPID-based)", NULL, process_1_ally, finish_1}, {"dump aliases inferred with Mercator (CSA-based)", process_2_ping, NULL, finish_2}, {"dump aliases inferred with both Ally and Mercator", process_3_ping, process_3_ally, finish_3}, }; static int dump_funcc = sizeof(dump_funcs) / sizeof(sc_dump_t); #define OPT_HELP 0x0001 #define OPT_ADDRFILE 0x0002 #define OPT_OUTFILE 0x0004 #define OPT_PORT 0x0008 #define OPT_UNIX 0x0010 #define OPT_TEXT 0x0020 #define OPT_DAEMON 0x0040 #define OPT_ATTEMPTS 0x0080 #define OPT_WAIT 0x0100 #define OPT_PROBEWAIT 0x0200 #define OPT_FUDGE 0x0400 #define OPT_OPTIONS 0x0800 #define OPT_DUMP 0x1000 #define FLAG_NOBS 0x0001 #define FLAG_TC 0x0002 static void usage(uint32_t opt_mask) { int i; fprintf(stderr, "usage: sc_ally [-D?] [-a infile] [-o outfile] [-p port] [-U unix]\n" " [-f fudge] [-i waitprobe] [-O options]\n" " [-q attempts] [-t log] [-w waittime]\n" "\n" " sc_ally [-d dump-id] [-O options] \n" "\n"); if(opt_mask == 0) { fprintf(stderr, " sc_ally -?\n\n"); return; } if(opt_mask & OPT_HELP) fprintf(stderr, " -? give an overview of the usage of sc_ally\n"); if(opt_mask & OPT_ADDRFILE) fprintf(stderr, " -a input addressfile\n"); if(opt_mask & OPT_OUTFILE) fprintf(stderr, " -o output warts file\n"); if(opt_mask & OPT_PORT) fprintf(stderr, " -p port to find scamper on\n"); if(opt_mask & OPT_UNIX) fprintf(stderr, " -U unix domain to find scamper on\n"); if(opt_mask & OPT_DUMP) { fprintf(stderr, " -d dump-id\n"); for(i=1; i 0) { usage(OPT_ADDRFILE|OPT_OUTFILE|OPT_PORT|OPT_UNIX); return -1; } if(options & OPT_PORT) { if(string_tolong(opt_port, &lo) != 0 || lo < 1 || lo > 65535) { usage(OPT_PORT); return -1; } port = lo; } if(options & OPT_ATTEMPTS) { if(string_tolong(opt_attempts, &lo) != 0 || lo < 1 || lo > 10) { usage(OPT_ATTEMPTS); return -1; } attempts = lo; } if(options & OPT_WAIT) { if(string_tolong(opt_wait, &lo) != 0 || lo < 1 || lo > 60) { usage(OPT_WAIT); return -1; } waittime = lo; } if(options & OPT_PROBEWAIT) { /* probe gap between 200 and 2000ms */ if(string_tolong(opt_probewait, &lo) != 0 || lo < 200 || lo > 2000) { usage(OPT_PROBEWAIT); return -1; } probe_wait = lo; } if(opt_text != NULL) { if((text = fopen(opt_text, "w")) == NULL) { usage(OPT_TEXT); fprintf(stderr, "could not open %s\n", opt_text); return -1; } } } else { if(argc - optind < 1) { usage(0); return -1; } if(string_tolong(opt_dump, &lo) != 0 || lo < 1 || lo > dump_funcc) { usage(OPT_DUMP); return -1; } dump_id = lo; dump_files = argv + optind; dump_filec = argc - optind; } return 0; } static void print(char *format, ...) { va_list ap; char msg[512]; va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); printf("%ld: %s", (long int)now.tv_sec, msg); if(text != NULL) { fprintf(text, "%ld: %s", (long int)now.tv_sec, msg); fflush(text); } return; } static void status(char *format, ...) { va_list ap; char pref[32]; char msg[512]; snprintf(pref, sizeof(pref), "p %d, w %d, v %d", probing, heap_count(waiting), slist_count(virgin)); va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); print("%s : %s\n", pref, msg); return; } static sc_test_t *sc_test_alloc(int type, void *data) { sc_test_t *test; if((test = malloc_zero(sizeof(sc_test_t))) == NULL) { fprintf(stderr, "could not malloc test\n"); return NULL; } test->type = type; test->data = data; return test; } static void sc_test_free(sc_test_t *test) { if(test != NULL) free(test); return; } static int sc_waittest_cmp(const sc_waittest_t *a, const sc_waittest_t *b) { return timeval_cmp(&b->tv, &a->tv); } static int sc_waittest(sc_test_t *test) { sc_waittest_t *wt; if((wt = malloc_zero(sizeof(sc_waittest_t))) == NULL) return -1; timeval_add_s(&wt->tv, &now, waittime); wt->test = test; if(heap_insert(waiting, wt) == NULL) return -1; return 0; } static void sc_target_detach(sc_target_t *tg) { sc_test_t *test; if(tg == NULL) return; if(tg->node != NULL) { splaytree_remove_node(targets, tg->node); tg->node = NULL; } if(tg->blocked != NULL) { while((test = slist_head_pop(tg->blocked)) != NULL) sc_waittest(test); slist_free(tg->blocked); tg->blocked = NULL; } return; } static void sc_target_free(sc_target_t *tg) { if(tg == NULL) return; sc_target_detach(tg); if(tg->addr != NULL) scamper_addr_free(tg->addr); free(tg); return; } static int sc_target_cmp(const sc_target_t *a, const sc_target_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static sc_target_t *sc_target_alloc(scamper_addr_t *sa) { sc_target_t *tg; if((tg = malloc_zero(sizeof(sc_target_t))) == NULL) { fprintf(stderr, "could not malloc target\n"); return NULL; } tg->addr = scamper_addr_use(sa); return tg; } static int sc_target_block(sc_target_t *target, sc_test_t *block) { if(target->blocked == NULL && (target->blocked = slist_alloc()) == NULL) { fprintf(stderr, "could not alloc target->blocked list\n"); return -1; } if(slist_tail_push(target->blocked, block) == NULL) { fprintf(stderr, "could not add test to blocked list\n"); return -1; } return 0; } static sc_target_t *sc_target_find(sc_target_t *target) { return splaytree_find(targets, target); } static sc_target_t *sc_target_findaddr(scamper_addr_t *addr) { sc_target_t findme; findme.addr = addr; return sc_target_find(&findme); } static int sc_target_add(sc_target_t *target) { assert(target->node == NULL); assert(target->test != NULL); if((target->node = splaytree_insert(targets, target)) == NULL) { fprintf(stderr, "could not add target to tree\n"); return -1; } return 0; } static void sc_pair_free(sc_pair_t *pair) { if(pair->a != NULL) scamper_addr_free(pair->a); if(pair->b != NULL) scamper_addr_free(pair->b); free(pair); return; } static int sc_pair_cmp(const sc_pair_t *a, const sc_pair_t *b) { int rc; if((rc = scamper_addr_cmp(a->a, b->a)) != 0) return rc; return scamper_addr_cmp(a->b, b->b); } static void sc_addr2router_free(sc_addr2router_t *a2r) { if(a2r == NULL) return; if(a2r->addr != NULL) scamper_addr_free(a2r->addr); free(a2r); return; } static sc_addr2router_t *sc_addr2router_add(splaytree_t *tree, sc_router_t *r, scamper_addr_t *a) { sc_addr2router_t *a2r; if((a2r = malloc_zero(sizeof(sc_addr2router_t))) == NULL) return NULL; a2r->router = r; a2r->addr = scamper_addr_use(a); if(splaytree_insert(tree, a2r) == NULL) { sc_addr2router_free(a2r); return NULL; } if(slist_tail_push(r->addrs, a2r) == NULL) return NULL; return a2r; } static sc_addr2router_t *sc_addr2router_find(splaytree_t *t, scamper_addr_t *a) { sc_addr2router_t fm; fm.addr = a; return splaytree_find(t, &fm); } static int sc_addr2router_cmp(const sc_addr2router_t *a, const sc_addr2router_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static void sc_router_free(sc_router_t *r) { if(r == NULL) return; if(r->addrs != NULL) slist_free(r->addrs); free(r); return; } static sc_router_t *sc_router_alloc(dlist_t *list) { sc_router_t *r; if((r = malloc_zero(sizeof(sc_router_t))) == NULL || (r->addrs = slist_alloc()) == NULL || (r->node = dlist_tail_push(list, r)) == NULL) { sc_router_free(r); return NULL; } return r; } static char *class_tostr(char *str, size_t len, uint8_t class) { char *ptr; switch(class) { case IPID_NONE: ptr = "none"; break; case IPID_INCR: ptr = "incr"; break; case IPID_RAND: ptr = "rand"; break; case IPID_ECHO: ptr = "echo"; break; case IPID_CONST: ptr = "const"; break; case IPID_UNRESP: ptr = "unresp"; break; default: snprintf(str, len, "class %d", class); return str; } snprintf(str, len, "%s", ptr); return str; } static void sc_ipidseq_free(sc_ipidseq_t *seq) { if(seq == NULL) return; if(seq->addr != NULL) scamper_addr_free(seq->addr); free(seq); return; } static int sc_ipidseq_cmp(const sc_ipidseq_t *a, const sc_ipidseq_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static sc_ipidseq_t *sc_ipidseq_alloc(scamper_addr_t *addr) { sc_ipidseq_t *seq; if((seq = malloc_zero(sizeof(sc_ipidseq_t))) == NULL) return NULL; seq->addr = scamper_addr_use(addr); if(splaytree_insert(ipidseqs, seq) == NULL) { scamper_addr_free(seq->addr); free(seq); return NULL; } return seq; } static sc_ipidseq_t *sc_ipidseq_find(scamper_addr_t *addr) { sc_ipidseq_t fm; fm.addr = addr; return splaytree_find(ipidseqs, &fm); } /* * sc_ipidseq_method * * prefer icmp echo because it is benign. * prefer tcp to udp because it returns fewer false negatives --shared * counter held centrally (TCP) vs held on line card (UDP) on some routers. */ static int sc_ipidseq_method(sc_ipidseq_t *a, sc_ipidseq_t *b) { if(a->icmp == IPID_INCR && a->icmp == b->icmp) return METHOD_ICMP; if(a->tcp == IPID_INCR && a->tcp == b->tcp) return METHOD_TCP; if(a->udp == IPID_INCR && a->udp == b->udp) return METHOD_UDP; return 0; } /* * sc_allytest_router * * add a new router to the set and return a pointer to it. */ static sc_router_t *sc_allytest_router(sc_allytest_t *at) { sc_router_t *r = NULL; if((at->router_list == NULL && (at->router_list=dlist_alloc()) == NULL) || (r = sc_router_alloc(at->router_list)) == NULL) { print("could not add new router: %s\n", strerror(errno)); return NULL; } return r; } static sc_addr2router_t *sc_allytest_find(sc_allytest_t *at, scamper_addr_t *a) { if(at->router_tree == NULL) return NULL; return sc_addr2router_find(at->router_tree, a); } static sc_addr2router_t *sc_allytest_addr2router(sc_allytest_t *at, sc_router_t *rtr, scamper_addr_t *addr) { sc_addr2router_t *a2r; if(at->router_tree == NULL && (at->router_tree = splaytree_alloc((splaytree_cmp_t)sc_addr2router_cmp)) == NULL) { print("could not alloc at->router_tree: %s\n", strerror(errno)); return NULL; } if((a2r = sc_addr2router_add(at->router_tree, rtr, addr)) == NULL) { print("could not add a2r to rtr->addrs\n"); return NULL; } return a2r; } static int sc_allytest_pair(sc_allytest_t *at, scamper_addr_t *a, scamper_addr_t *b) { sc_addr2router_t *a2r_a = sc_allytest_find(at, a); sc_addr2router_t *a2r_b = sc_allytest_find(at, b); sc_router_t *r; if(a2r_a == NULL && a2r_b == NULL) { if((r = sc_allytest_router(at)) == NULL || sc_allytest_addr2router(at, r, a) == NULL || sc_allytest_addr2router(at, r, b) == NULL) return -1; } else if(a2r_a != NULL && a2r_b != NULL) { if(a2r_a->router != a2r_b->router) { r = a2r_a->router; while((a2r_a = slist_head_pop(r->addrs)) != NULL) { a2r_a->router = a2r_b->router; if(slist_tail_push(a2r_b->router->addrs, a2r_a) == NULL) return -1; } dlist_node_pop(at->router_list, r->node); sc_router_free(r); } } else if(a2r_a != NULL) { if(sc_allytest_addr2router(at, a2r_a->router, b) == NULL) return -1; } else { if(sc_allytest_addr2router(at, a2r_b->router, a) == NULL) return -1; } return 0; } /* * sc_allytest_next * * figure out the next pair of IP addresses that should be tested. the * function works by iterating through the addresses in the list, * only testing the addresses that do not belong to the same router */ static void sc_allytest_next(sc_allytest_t *at) { scamper_addr_t *a, *b; sc_ipidseq_t *aseq, *bseq; if(at->a != NULL) { sc_target_free(at->a); at->a = NULL; } if(at->b != NULL) { sc_target_free(at->b); at->b = NULL; } at->method = 0; at->attempt = 0; for(;;) { if((at->s2 = slist_node_next(at->s2)) == NULL && ((at->s1 = slist_node_next(at->s1)) == NULL || (at->s2 = slist_node_next(at->s1)) == NULL)) { at->s1 = at->s2 = NULL; break; } a = slist_node_item(at->s1); b = slist_node_item(at->s2); /* * if these addresses have been assigned to routers already, we * don't need to probe them */ if(sc_allytest_find(at, a) != NULL && sc_allytest_find(at, b) != NULL) continue; /* * if we cannot probe them because they do not have a common * probe method to use, then skip them, though this could be * relaxed in the future to use different probe methods if we * assume a single shared counter. */ if((aseq = sc_ipidseq_find(a)) != NULL && (bseq = sc_ipidseq_find(b)) != NULL && sc_ipidseq_method(aseq, bseq) == 0) continue; break; } return; } static void sc_pingtest_free(sc_pingtest_t *pt) { if(pt == NULL) return; if(pt->target != NULL) sc_target_free(pt->target); free(pt); return; } static sc_test_t *sc_pingtest_new(scamper_addr_t *addr) { sc_pingtest_t *pt; sc_target_t *tg; assert(addr != NULL); if((pt = malloc_zero(sizeof(sc_pingtest_t))) == NULL) { fprintf(stderr, "could not malloc pingtest\n"); goto err; } if((tg = malloc_zero(sizeof(sc_target_t))) == NULL) { fprintf(stderr, "could not malloc target\n"); goto err; } tg->addr = scamper_addr_use(addr); pt->target = tg; /* create a generic test structure which we put in a list of tests */ if((pt->target->test = sc_test_alloc(TEST_PING, pt)) == NULL) goto err; return pt->target->test; err: if(pt != NULL) sc_pingtest_free(pt); return NULL; } static void sc_allytest_free(sc_allytest_t *at) { if(at == NULL) return; if(at->addr_list != NULL) slist_free_cb(at->addr_list, (slist_free_t)scamper_addr_free); if(at->router_tree != NULL) splaytree_free(at->router_tree, (splaytree_free_t)sc_addr2router_free); if(at->router_list != NULL) dlist_free_cb(at->router_list, (dlist_free_t)sc_router_free); if(at->a != NULL) sc_target_free(at->a); if(at->b != NULL) sc_target_free(at->b); free(at); return; } static int sc_allytest_new(slist_t *list) { sc_allytest_t *at = NULL; sc_test_t *test = NULL; if((at = malloc_zero(sizeof(sc_allytest_t))) == NULL || (test = sc_test_alloc(TEST_ALLY, at)) == NULL) goto err; at->s1 = slist_head_node(list); at->s2 = slist_node_next(at->s1); at->addr_list = list; slist_tail_push(virgin, test); return 0; err: print("could not alloc sc_allytest_t: %s\n", strerror(errno)); if(at != NULL) sc_allytest_free(at); return -1; } static int addressfile_line(char *buf, void *param) { slist_t *list = NULL; scamper_addr_t *sa; char *a, *b; int last = 0, rc; if(buf[0] == '#') return 0; if((list = slist_alloc()) == NULL) return -1; a = b = buf; for(;;) { for(;;) { if(*b == '\0') { last = 1; break; } if(*b == ' ') { *b = '\0'; break; } b++; } if((sa = scamper_addr_resolve(AF_INET, a)) == NULL) { fprintf(stderr, "could not resolve '%s'\n", a); goto err; } if(slist_tail_push(list, sa) == NULL) { scamper_addr_free(sa); goto err; } if(last != 0) break; b++; a = b; } if((rc = slist_count(list)) < 2) goto err; return sc_allytest_new(list); err: if(list != NULL) slist_free_cb(list, (slist_free_t)scamper_addr_free); return -1; } static int ping_classify(scamper_ping_t *ping) { scamper_ping_reply_t *rx; int rc = -1, echo = 0, bs = 0, nobs = 0; int i, samples[65536]; uint32_t u32, f, n0, n1; slist_t *list = NULL; slist_node_t *ln0, *ln1; if(ping->stop_reason == SCAMPER_PING_STOP_NONE || ping->stop_reason == SCAMPER_PING_STOP_ERROR) return IPID_UNRESP; if((list = slist_alloc()) == NULL) goto done; memset(samples, 0, sizeof(samples)); for(i=0; iping_sent; i++) { if((rx = ping->ping_replies[i]) != NULL && SCAMPER_PING_REPLY_FROM_TARGET(ping, rx)) { /* * if at least two of four samples have the same ipid as what was * sent, then declare it echos. this handles the observed case * where some responses echo but others increment. */ if(rx->probe_ipid == rx->reply_ipid && ++echo > 1) { rc = IPID_ECHO; goto done; } /* * if two responses have the same IPID value, declare that it * replies with a constant IPID */ if(++samples[rx->reply_ipid] > 1) { rc = IPID_CONST; goto done; } if(slist_tail_push(list, rx) == NULL) goto done; } } if(slist_count(list) < attempts) { rc = IPID_UNRESP; goto done; } f = (fudge == 0) ? 5000 : fudge; ln0 = slist_head_node(list); ln1 = slist_node_next(ln0); while(ln1 != NULL) { rx = slist_node_item(ln0); n0 = rx->reply_ipid; rx = slist_node_item(ln1); n1 = rx->reply_ipid; if(n0 < n1) u32 = n1 - n0; else u32 = (n1 + 0x10000) - n0; if(u32 <= f) nobs++; if((flags & FLAG_NOBS) == 0) { n0 = byteswap16(n0); n1 = byteswap16(n1); if(n0 < n1) u32 = n1 - n0; else u32 = (n1 + 0x10000) - n0; if(u32 <= f) bs++; } ln0 = ln1; ln1 = slist_node_next(ln0); } if(nobs != attempts-1 && bs != attempts-1) rc = IPID_RAND; else rc = IPID_INCR; done: if(list != NULL) slist_free(list); return rc; } static int process_ping(sc_test_t *test, scamper_ping_t *ping) { sc_pingtest_t *pt = test->data; sc_ipidseq_t *seq; char addr[64], icmp[10], tcp[10], udp[10]; int class; assert(ping != NULL); if((seq = sc_ipidseq_find(pt->target->addr)) == NULL && (seq = sc_ipidseq_alloc(pt->target->addr)) == NULL) goto err; class = ping_classify(ping); if(SCAMPER_PING_METHOD_IS_UDP(ping)) seq->udp = class; else if(SCAMPER_PING_METHOD_IS_TCP(ping)) seq->tcp = class; else if(SCAMPER_PING_METHOD_IS_ICMP(ping)) seq->icmp = class; scamper_addr_tostr(pt->target->addr, addr, sizeof(addr)); scamper_ping_free(ping); ping = NULL; pt->step++; if(pt->step < 3) { if(sc_waittest(test) != 0) goto err; status("wait ping %s step %d", addr, pt->step); return 0; } status("done ping %s icmp %s udp %s tcp %s", addr, class_tostr(icmp, sizeof(icmp), seq->icmp), class_tostr(udp, sizeof(udp), seq->udp), class_tostr(tcp, sizeof(tcp), seq->tcp)); sc_pingtest_free(pt); sc_test_free(test); return 0; err: if(ping != NULL) scamper_ping_free(ping); return -1; } static int process_ally(sc_test_t *test, scamper_dealias_t *dealias) { scamper_dealias_ally_t *ally; scamper_addr_t *a; scamper_addr_t *b; sc_allytest_t *at = test->data; size_t off = 0; char msg[512]; char buf[64]; int rc = 0; assert(dealias != NULL); ally = dealias->data; a = ally->probedefs[0].dst; b = ally->probedefs[1].dst; string_concat(msg, sizeof(msg), &off, "set ally %s:", scamper_addr_tostr(a, buf, sizeof(buf))); string_concat(msg, sizeof(msg), &off, "%s ", scamper_addr_tostr(b, buf, sizeof(buf))); at->attempt++; if(dealias->result == SCAMPER_DEALIAS_RESULT_NONE && at->attempt <= 4) { string_concat(msg, sizeof(msg), &off, "wait %d", at->attempt); if(sc_waittest(test) != 0) rc = -1; } else { if(dealias->result == SCAMPER_DEALIAS_RESULT_ALIASES) { string_concat(msg, sizeof(msg), &off, "aliases"); if(sc_allytest_pair(at, a, b) != 0) rc = -1; } else if(dealias->result == SCAMPER_DEALIAS_RESULT_NOTALIASES) string_concat(msg, sizeof(msg), &off, "not aliases"); else string_concat(msg, sizeof(msg), &off, "no result"); sc_allytest_next(at); if(at->s1 == NULL) { sc_allytest_free(at); sc_test_free(test); } else if(sc_waittest(test) != 0) rc = -1; } status("%s", msg); scamper_dealias_free(dealias); return rc; } static int do_decoderead(void) { sc_target_t *target, findme; sc_test_t *test; void *data; uint16_t type; char buf[64]; scamper_ping_t *ping = NULL; scamper_dealias_t *dealias = NULL; scamper_dealias_ally_t *ally; int rc; /* try and read a traceroute from the warts decoder */ if(scamper_file_read(decode_in, ffilter, &type, &data) != 0) { fprintf(stderr, "do_decoderead: scamper_file_read errno %d\n", errno); goto err; } if(data == NULL) return 0; probing--; if(type == SCAMPER_FILE_OBJ_PING) { ping = (scamper_ping_t *)data; findme.addr = ping->dst; } else if(type == SCAMPER_FILE_OBJ_DEALIAS) { dealias = (scamper_dealias_t *)data; ally = (scamper_dealias_ally_t *)dealias->data; findme.addr = ally->probedefs[0].dst; } else return -1; if((target = splaytree_find(targets, &findme)) == NULL) { fprintf(stderr, "do_decoderead: could not find dst %s\n", scamper_addr_tostr(findme.addr, buf, sizeof(buf))); goto err; } test = target->test; if(test->type == TEST_PING) rc = process_ping(test, ping); else if(test->type == TEST_ALLY) rc = process_ally(test, dealias); else rc = -1; return rc; err: if(dealias != NULL) scamper_dealias_free(dealias); if(ping != NULL) scamper_ping_free(ping); return -1; } static int sc_test_ping(sc_test_t *test, char *cmd, size_t len) { sc_pingtest_t *pt = test->data; scamper_addr_t *dst = pt->target->addr; sc_target_t *found; size_t off = 0; char buf[64]; assert(pt->step >= 0); assert(pt->step < 3); /* first, check to see if the test is runnable. if not block */ if((found = sc_target_find(pt->target)) != NULL && found->test != test) { if(sc_target_block(found, test) != 0) return -1; return 0; } else if(found == NULL) { /* add the test to the blocked list */ if(sc_target_add(pt->target) != 0) return -1; } string_concat(cmd, len, &off, "ping -P "); if(pt->step == 0) string_concat(cmd, len, &off, "udp-dport"); else if(pt->step == 1) string_concat(cmd, len, &off, "icmp-echo"); else if(pt->step == 2) string_concat(cmd, len, &off, "tcp-ack-sport"); else return -1; string_concat(cmd, len, &off, " -i %d", probe_wait / 1000); if((probe_wait % 1000) != 0) string_concat(cmd, len, &off, ".%03d", probe_wait % 1000); string_concat(cmd, len, &off, " -c %d -o %d %s\n", attempts + 2, attempts, scamper_addr_tostr(dst, buf, sizeof(buf))); return off; } static int sc_test_ipidseq(sc_test_t *test, scamper_addr_t *addr, char *cmd, size_t len) { sc_pingtest_t *pt; sc_target_t *found; sc_test_t *tt; if((found = sc_target_findaddr(addr)) != NULL) { if(sc_target_block(found, test) != 0) return -1; return 0; } if((tt = sc_pingtest_new(addr)) == NULL) return -1; pt = tt->data; if(sc_target_block(pt->target, test) != 0) return -1; if(sc_target_add(pt->target) != 0) return -1; return sc_test_ping(tt, cmd, len); } static int sc_test_ally(sc_test_t *test, char *cmd, size_t len) { static const char *method[] = {"icmp-echo", "tcp-ack-sport", "udp-dport"}; sc_allytest_t *at = test->data; scamper_addr_t *a, *b; sc_ipidseq_t *aseq; sc_ipidseq_t *bseq; sc_target_t *found; char ab[64], bb[64]; size_t off = 0; for(;;) { a = slist_node_item(at->s1); b = slist_node_item(at->s2); if(at->method != 0) break; if((aseq = sc_ipidseq_find(a)) == NULL) return sc_test_ipidseq(test, a, cmd, len); if((bseq = sc_ipidseq_find(b)) == NULL) return sc_test_ipidseq(test, b, cmd, len); if((at->method = sc_ipidseq_method(aseq, bseq)) == 0) { sc_allytest_next(at); if(at->s1 == NULL) { sc_allytest_free(at); sc_test_free(test); return 0; } continue; } break; } if(at->a == NULL) { if((at->a = sc_target_alloc(a)) == NULL) return -1; at->a->test = test; } if(at->b == NULL) { if((at->b = sc_target_alloc(b)) == NULL) return -1; at->b->test = test; } if(((found = sc_target_find(at->a)) != NULL && found->test != test) || ((found = sc_target_find(at->b)) != NULL && found->test != test)) { if(sc_target_block(found, test) != 0) return -1; return 0; } if((sc_target_find(at->a) == NULL && sc_target_add(at->a) != 0) || (sc_target_find(at->b) == NULL && sc_target_add(at->b) != 0)) return -1; string_concat(cmd, len, &off, "dealias -m ally"); if(fudge == 0) string_concat(cmd, len, &off, " -O inseq"); else string_concat(cmd, len, &off, " -f %d", fudge); if(flags & FLAG_NOBS) string_concat(cmd, len, &off, " -O nobs"); string_concat(cmd, len, &off, " -W %d -q %d -p '-P %s' %s %s\n", probe_wait, attempts, method[at->method-1], scamper_addr_tostr(at->a->addr, ab, sizeof(ab)), scamper_addr_tostr(at->b->addr, bb, sizeof(bb))); return off; } static int do_method(void) { static int (*const func[])(sc_test_t *, char *, size_t) = { sc_test_ping, /* TEST_PING */ sc_test_ally, /* TEST_ALLY */ }; sc_waittest_t *wt; sc_test_t *test; char cmd[512]; int off; if(more < 1) return 0; for(;;) { if((wt = heap_head_item(waiting)) != NULL && timeval_cmp(&now, &wt->tv) >= 0) { test = wt->test; heap_remove(waiting); free(wt); } else if((test = slist_head_pop(virgin)) == NULL) { return 0; } /* something went wrong */ if((off = func[test->type-1](test, cmd, sizeof(cmd))) == -1) { fprintf(stderr, "something went wrong\n"); error = 1; return -1; } /* got a command, send it */ if(off != 0) { if(scamper_writebuf_send(scamper_wb, cmd, off) != 0) { fprintf(stderr, "could not send %s\n", cmd); return -1; } probing++; more--; print("p %d, w %d, v %d : %s", probing, heap_count(waiting), slist_count(virgin), cmd); break; } } return 0; } /* * do_files * * open a socketpair that can be used to feed warts data into one end and * have the scamper_file routines decode it via the other end. * * also open a file to send the binary warts data file to. */ static int do_files(void) { mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; int flags = O_WRONLY | O_CREAT | O_TRUNC; int pair[2]; if((outfile_fd = open(outfile_name, flags, mode)) == -1) return -1; /* * setup a socketpair that is used to decode warts from a binary input. * pair[0] is used to write to the file, while pair[1] is used by * the scamper_file_t routines to parse the warts data. */ if(socketpair(AF_UNIX, SOCK_STREAM, 0, pair) != 0) return -1; decode_in_fd = pair[0]; decode_out_fd = pair[1]; decode_in = scamper_file_openfd(decode_in_fd, NULL, 'r', "warts"); if(decode_in == NULL) return -1; if(fcntl_set(decode_in_fd, O_NONBLOCK) == -1 || fcntl_set(decode_out_fd, O_NONBLOCK) == -1 || (decode_wb = scamper_writebuf_alloc()) == NULL) return -1; return 0; } /* * do_scamperconnect * * allocate socket and connect to scamper process listening on the port * specified. */ static int do_scamperconnect(void) { #ifdef HAVE_SOCKADDR_UN struct sockaddr_un sn; #endif struct sockaddr_in sin; struct in_addr in; if(options & OPT_PORT) { inet_aton("127.0.0.1", &in); sockaddr_compose((struct sockaddr *)&sin, AF_INET, &in, port); if((scamper_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { fprintf(stderr, "could not allocate new socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sin, sizeof(sin)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } return 0; } #ifdef HAVE_SOCKADDR_UN else if(options & OPT_UNIX) { if(sockaddr_compose_un((struct sockaddr *)&sn, unix_name) != 0) { fprintf(stderr, "could not build sockaddr_un\n"); return -1; } if((scamper_fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { fprintf(stderr, "could not allocate unix domain socket\n"); return -1; } if(connect(scamper_fd, (const struct sockaddr *)&sn, sizeof(sn)) != 0) { fprintf(stderr, "could not connect to scamper process\n"); return -1; } return 0; } #endif return -1; } static int do_scamperread_line(void *param, uint8_t *buf, size_t linelen) { char *head = (char *)buf; uint8_t uu[64]; size_t uus; long l; /* skip empty lines */ if(head[0] == '\0') return 0; /* if currently decoding data, then pass it to uudecode */ if(data_left > 0) { uus = sizeof(uu); if(uudecode_line(head, linelen, uu, &uus) != 0) { fprintf(stderr, "could not uudecode_line\n"); error = 1; return -1; } if(uus != 0) { scamper_writebuf_send(decode_wb, uu, uus); write_wrap(outfile_fd, uu, NULL, uus); } data_left -= (linelen + 1); return 0; } /* feedback letting us know that the command was accepted */ if(linelen >= 2 && strncasecmp(head, "OK", 2) == 0) return 0; /* if the scamper process is asking for more tasks, give it more */ if(linelen == 4 && strncasecmp(head, "MORE", linelen) == 0) { more++; if(do_method() != 0) return -1; return 0; } /* new piece of data */ if(linelen > 5 && strncasecmp(head, "DATA ", 5) == 0) { if(string_isnumber(head+5) == 0 || string_tolong(head+5, &l) != 0) { fprintf(stderr, "could not parse %s\n", head); error = 1; return -1; } data_left = l; return 0; } /* feedback letting us know that the command was not accepted */ if(linelen >= 3 && strncasecmp(head, "ERR", 3) == 0) { error = 1; return -1; } fprintf(stderr, "unknown response '%s'\n", head); error = 1; return -1; } static int do_scamperread(void) { ssize_t rc; uint8_t buf[512]; if((rc = read(scamper_fd, buf, sizeof(buf))) > 0) { scamper_linepoll_handle(scamper_lp, buf, rc); return 0; } else if(rc == 0) { close(scamper_fd); scamper_fd = -1; return 0; } else if(errno == EINTR || errno == EAGAIN) { return 0; } fprintf(stderr, "could not read: errno %d\n", errno); return -1; } static splaytree_t *dump_t = NULL; static dlist_t *dump_l = NULL; static sc_pair_t *pair_find(scamper_addr_t *a, scamper_addr_t *b) { sc_pair_t fm; if(scamper_addr_cmp(a, b) < 0) { fm.a = a; fm.b = b; } else { fm.a = b; fm.b = a; } return splaytree_find(dump_t, &fm); } static int pair_add(scamper_addr_t *a, scamper_addr_t *b) { sc_pair_t *pair; if(dump_t == NULL && (dump_t = splaytree_alloc((splaytree_cmp_t)sc_pair_cmp)) == NULL) return -1; if((pair = malloc(sizeof(sc_pair_t))) == NULL) return -1; if(scamper_addr_cmp(a, b) < 0) { pair->a = scamper_addr_use(a); pair->b = scamper_addr_use(b); } else { pair->a = scamper_addr_use(b); pair->b = scamper_addr_use(a); } if(splaytree_insert(dump_t, pair) == NULL) { sc_pair_free(pair); return -1; } return 0; } static int tc_add(scamper_addr_t *a, scamper_addr_t *b) { sc_addr2router_t *a2r_a, *a2r_b, *a2r_x; sc_router_t *r_a, *r_b, *r_x; if(dump_t == NULL && ((dump_t = splaytree_alloc((splaytree_cmp_t)sc_addr2router_cmp))== NULL || (dump_l = dlist_alloc()) == NULL)) return -1; a2r_a = sc_addr2router_find(dump_t, a); a2r_b = sc_addr2router_find(dump_t, b); if(a2r_a != NULL && a2r_b != NULL) { r_a = a2r_a->router; r_b = a2r_b->router; if(r_a == r_b) return 0; while((a2r_x = slist_head_pop(r_b->addrs)) != NULL) { if(slist_tail_push(r_a->addrs, a2r_x) == NULL) goto err; a2r_x->router = r_a; } sc_router_free(r_b); } else if(a2r_a != NULL) { r_a = a2r_a->router; if(sc_addr2router_add(dump_t, r_a, b) == NULL) goto err; } else if(a2r_b != NULL) { r_b = a2r_b->router; if(sc_addr2router_add(dump_t, r_b, a) == NULL) goto err; } else { if((r_x = sc_router_alloc(dump_l)) == NULL || sc_addr2router_add(dump_t, r_x, a) == NULL || sc_addr2router_add(dump_t, r_x, b) == NULL) goto err; } return 0; err: return -1; } static void tc_dump(void) { sc_addr2router_t *a2r; slist_node_t *sn; dlist_node_t *dn; sc_router_t *r; char buf[64]; int x; for(dn=dlist_head_node(dump_l); dn != NULL; dn = dlist_node_next(dn)) { r = dlist_node_item(dn); x = 0; for(sn=slist_head_node(r->addrs); sn != NULL; sn = slist_node_next(sn)) { a2r = slist_node_item(sn); if(x > 0) printf(" "); printf("%s", scamper_addr_tostr(a2r->addr, buf, sizeof(buf))); x++; } printf("\n"); } return; } static int dump_process_ally(const scamper_dealias_t *dealias) { const scamper_dealias_ally_t *ally = dealias->data; scamper_addr_t *a, *b; char ab[64], bb[64]; if(dealias->method != SCAMPER_DEALIAS_METHOD_ALLY || dealias->result != SCAMPER_DEALIAS_RESULT_ALIASES) return 0; a = ally->probedefs[0].dst; b = ally->probedefs[1].dst; if((flags & FLAG_TC) == 0) { if(pair_find(a, b) == NULL) { if(pair_add(a, b) != 0) return -1; printf("%s %s\n", scamper_addr_tostr(a, ab, sizeof(ab)), scamper_addr_tostr(b, bb, sizeof(bb))); } return 0; } return tc_add(ally->probedefs[0].dst, ally->probedefs[1].dst); } static int dump_process_ping(const scamper_ping_t *ping) { scamper_ping_reply_t *r; char a[64], b[64]; uint16_t i; if(SCAMPER_PING_METHOD_IS_UDP(ping) == 0) return 0; for(i=0; iping_sent; i++) { r = ping->ping_replies[i]; while(r != NULL) { if(SCAMPER_PING_REPLY_IS_ICMP_UNREACH_PORT(r) == 0 && scamper_addr_cmp(r->addr, ping->dst) != 0) { if((flags & FLAG_TC) == 0) { if(pair_find(r->addr, ping->dst) == NULL) { if(pair_add(r->addr, ping->dst) != 0) return -1; printf("%s %s\n", scamper_addr_tostr(r->addr, a, sizeof(a)), scamper_addr_tostr(ping->dst, b, sizeof(b))); } } else { if(tc_add(r->addr, ping->dst) != 0) return -1; } } r = r->next; } } return 0; } static void dump_finish(void) { if((flags & FLAG_TC) == 0) { splaytree_free(dump_t, (splaytree_free_t)sc_pair_free); } else { tc_dump(); splaytree_free(dump_t, (splaytree_free_t)sc_addr2router_free); dlist_free_cb(dump_l, (dlist_free_t)sc_router_free); } return; } static int process_1_ally(const scamper_dealias_t *dealias) { return dump_process_ally(dealias); } static void finish_1(void) { dump_finish(); return; } static int process_2_ping(const scamper_ping_t *ping) { return dump_process_ping(ping); } static void finish_2(void) { dump_finish(); return; } static int process_3_ally(const scamper_dealias_t *dealias) { return dump_process_ally(dealias); } static int process_3_ping(const scamper_ping_t *ping) { return dump_process_ping(ping); } static void finish_3(void) { dump_finish(); return; } static void cleanup(void) { if(virgin != NULL) { slist_free(virgin); virgin = NULL; } if(waiting != NULL) { heap_free(waiting, NULL); waiting = NULL; } if(targets != NULL) { splaytree_free(targets, NULL); targets = NULL; } if(ipidseqs != NULL) { splaytree_free(ipidseqs, (splaytree_free_t)sc_ipidseq_free); ipidseqs = NULL; } if(decode_in != NULL) { scamper_file_close(decode_in); decode_in = NULL; } if(ffilter != NULL) { scamper_file_filter_free(ffilter); ffilter = NULL; } if(decode_wb != NULL) { scamper_writebuf_free(decode_wb); decode_wb = NULL; } if(scamper_wb != NULL) { scamper_writebuf_free(scamper_wb); scamper_wb = NULL; } if(scamper_lp != NULL) { scamper_linepoll_free(scamper_lp, 0); scamper_lp = NULL; } if(text != NULL) { fclose(text); text = NULL; } return; } static int ally_init(void) { uint16_t types[] = {SCAMPER_FILE_OBJ_PING, SCAMPER_FILE_OBJ_DEALIAS}; int typec = sizeof(types) / sizeof(uint16_t); if((ffilter = scamper_file_filter_alloc(types, typec)) == NULL) return -1; return 0; } static int ally_read(void) { scamper_file_t *in; char *filename; uint16_t type; void *data; int i, stdin_used=0; for(i=0; i 0) { gettimeofday_wrap(&now); /* * if there is something ready to probe now, then try and * do it. */ wait = heap_head_item(waiting); if(slist_count(virgin) > 0 || (wait != NULL && timeval_cmp(&wait->tv, &now) <= 0)) { if(do_method() != 0) return -1; } /* * if we could not send a new command just yet, but scamper * wants one, then wait for an appropriate length of time. */ wait = heap_head_item(waiting); if(more > 0 && tv_ptr == NULL && wait != NULL) { tv_ptr = &tv; if(timeval_cmp(&wait->tv, &now) > 0) timeval_diff_tv(&tv, &now, &wait->tv); else memset(&tv, 0, sizeof(tv)); } } nfds = 0; FD_ZERO(&rfds); FD_ZERO(&wfds); wfdsp = NULL; if(scamper_fd < 0 && decode_in_fd < 0) break; if(scamper_fd >= 0) { FD_SET(scamper_fd, &rfds); if(nfds < scamper_fd) nfds = scamper_fd; if(scamper_writebuf_len(scamper_wb) > 0) { FD_SET(scamper_fd, &wfds); wfdsp = &wfds; } } if(decode_in_fd >= 0) { FD_SET(decode_in_fd, &rfds); if(nfds < decode_in_fd) nfds = decode_in_fd; } if(decode_out_fd >= 0 && scamper_writebuf_len(decode_wb) > 0) { FD_SET(decode_out_fd, &wfds); wfdsp = &wfds; if(nfds < decode_out_fd) nfds = decode_out_fd; } if(splaytree_count(targets) == 0 && slist_count(virgin) == 0 && heap_count(waiting) == 0) { break; } if(select(nfds+1, &rfds, wfdsp, NULL, tv_ptr) < 0) { if(errno == EINTR) continue; fprintf(stderr, "select error\n"); break; } gettimeofday_wrap(&now); if(more > 0) { if(do_method() != 0) return -1; } if(scamper_fd >= 0) { if(FD_ISSET(scamper_fd, &rfds) && do_scamperread() != 0) return -1; if(wfdsp != NULL && FD_ISSET(scamper_fd, wfdsp) && scamper_writebuf_write(scamper_fd, scamper_wb) != 0) return -1; } if(decode_in_fd >= 0) { if(FD_ISSET(decode_in_fd, &rfds) && do_decoderead() != 0) return -1; } if(decode_out_fd >= 0) { if(wfdsp != NULL && FD_ISSET(decode_out_fd, wfdsp) && scamper_writebuf_write(decode_out_fd, decode_wb) != 0) return -1; } } return 0; } int main(int argc, char *argv[]) { #if defined(DMALLOC) free(malloc(1)); #endif atexit(cleanup); if(check_options(argc, argv) != 0) return -1; if(ally_init() != 0) return -1; if(options & OPT_DUMP) return ally_read(); return ally_data(); } scamper-cvs-20171204/utils/sc_ally/Makefile.in000644 001751 000000 00000061133 13211200061 020734 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sc_ally$(EXEEXT) subdir = utils/sc_ally ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_sc_ally_OBJECTS = sc_ally.$(OBJEXT) \ ../../scamper/scamper_linepoll.$(OBJEXT) \ ../../scamper/scamper_writebuf.$(OBJEXT) ../../utils.$(OBJEXT) \ ../../mjl_heap.$(OBJEXT) ../../mjl_list.$(OBJEXT) \ ../../mjl_splaytree.$(OBJEXT) sc_ally_OBJECTS = $(am_sc_ally_OBJECTS) sc_ally_DEPENDENCIES = ../../scamper/libscamperfile.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(sc_ally_SOURCES) DIST_SOURCES = $(sc_ally_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper sc_ally_SOURCES = \ sc_ally.c \ ../../scamper/scamper_linepoll.c \ ../../scamper/scamper_writebuf.c \ ../../utils.c \ ../../mjl_heap.c \ ../../mjl_list.c \ ../../mjl_splaytree.c sc_ally_LDADD = ../../scamper/libscamperfile.la man_MANS = sc_ally.1 CLEANFILES = *~ *.core all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/sc_ally/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign utils/sc_ally/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../../scamper/$(am__dirstamp): @$(MKDIR_P) ../../scamper @: > ../../scamper/$(am__dirstamp) ../../scamper/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../scamper/$(DEPDIR) @: > ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_linepoll.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../scamper/scamper_writebuf.$(OBJEXT): \ ../../scamper/$(am__dirstamp) \ ../../scamper/$(DEPDIR)/$(am__dirstamp) ../../$(am__dirstamp): @$(MKDIR_P) ../.. @: > ../../$(am__dirstamp) ../../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../../$(DEPDIR) @: > ../../$(DEPDIR)/$(am__dirstamp) ../../utils.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_heap.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_list.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) ../../mjl_splaytree.$(OBJEXT): ../../$(am__dirstamp) \ ../../$(DEPDIR)/$(am__dirstamp) sc_ally$(EXEEXT): $(sc_ally_OBJECTS) $(sc_ally_DEPENDENCIES) $(EXTRA_sc_ally_DEPENDENCIES) @rm -f sc_ally$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sc_ally_OBJECTS) $(sc_ally_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../../*.$(OBJEXT) -rm -f ../../scamper/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_heap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/mjl_splaytree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../$(DEPDIR)/utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_linepoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../../scamper/$(DEPDIR)/scamper_writebuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sc_ally.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../../$(DEPDIR)/$(am__dirstamp) -rm -f ../../$(am__dirstamp) -rm -f ../../scamper/$(DEPDIR)/$(am__dirstamp) -rm -f ../../scamper/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../../$(DEPDIR) ../../scamper/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/scamper/.cvsignore000644 001751 000000 00000000112 13146643601 017543 0ustar00mjlwheel000000 000000 .deps .dirstamp .libs Makefile Makefile.in *.lo libscamperfile.la scamper scamper-cvs-20171204/scamper/Makefile.am000644 001751 000000 00000007476 13130370712 017614 0ustar00mjlwheel000000 000000 # $Id: Makefile.am,v 1.27 2017/07/09 09:05:14 mjl Exp $ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper bin_PROGRAMS = scamper lib_LTLIBRARIES = libscamperfile.la libscamperfile_la_LDFLAGS = -version-info 0:0:0 libscamperfile_la_SOURCES = \ ../mjl_splaytree.c \ ../mjl_patricia.c \ ../utils.c \ scamper_file.c \ scamper_file_arts.c \ scamper_file_warts.c \ scamper_file_text.c \ scamper_file_json.c \ scamper_addr.c \ scamper_list.c \ scamper_icmpext.c \ trace/scamper_trace.c \ trace/scamper_trace_warts.c \ trace/scamper_trace_text.c \ trace/scamper_trace_json.c \ ping/scamper_ping.c \ ping/scamper_ping_warts.c \ ping/scamper_ping_text.c \ ping/scamper_ping_json.c \ tracelb/scamper_tracelb.c \ tracelb/scamper_tracelb_warts.c \ tracelb/scamper_tracelb_text.c \ dealias/scamper_dealias.c \ dealias/scamper_dealias_warts.c \ dealias/scamper_dealias_text.c \ dealias/scamper_dealias_json.c \ sting/scamper_sting.c \ sting/scamper_sting_warts.c \ sting/scamper_sting_text.c \ neighbourdisc/scamper_neighbourdisc.c \ neighbourdisc/scamper_neighbourdisc_warts.c \ tbit/scamper_tbit.c \ tbit/scamper_tbit_warts.c \ tbit/scamper_tbit_text.c \ tbit/scamper_tbit_json.c \ sniff/scamper_sniff.c \ sniff/scamper_sniff_warts.c scamper_SOURCES = \ ../mjl_list.c \ ../mjl_heap.c \ ../mjl_splaytree.c \ ../mjl_patricia.c \ ../utils.c \ scamper.c \ scamper_osinfo.c \ scamper_addr.c \ scamper_list.c \ scamper_debug.c \ scamper_udp4.c \ scamper_udp6.c \ scamper_icmp4.c \ scamper_icmp6.c \ scamper_icmp_resp.c \ scamper_icmpext.c \ scamper_tcp4.c \ scamper_tcp6.c \ scamper_ip6.c \ scamper_ip4.c \ scamper_if.c \ scamper_rtsock.c \ scamper_dl.c \ scamper_addr2mac.c \ scamper_fds.c \ scamper_linepoll.c \ scamper_writebuf.c \ scamper_dlhdr.c \ scamper_privsep.c \ scamper_getsrc.c \ scamper_control.c \ scamper_firewall.c \ scamper_outfiles.c \ scamper_probe.c \ scamper_task.c \ scamper_queue.c \ scamper_cyclemon.c \ scamper_options.c \ scamper_file.c \ scamper_file_arts.c \ scamper_file_warts.c \ scamper_file_text.c \ scamper_file_json.c \ scamper_sources.c \ scamper_source_cmdline.c \ scamper_source_control.c \ scamper_source_file.c \ scamper_source_tsps.c \ trace/scamper_trace.c \ trace/scamper_trace_warts.c \ trace/scamper_trace_text.c \ trace/scamper_trace_json.c \ trace/scamper_trace_do.c \ ping/scamper_ping.c \ ping/scamper_ping_warts.c \ ping/scamper_ping_text.c \ ping/scamper_ping_json.c \ ping/scamper_ping_do.c \ tracelb/scamper_tracelb.c \ tracelb/scamper_tracelb_warts.c \ tracelb/scamper_tracelb_text.c \ tracelb/scamper_tracelb_do.c \ dealias/scamper_dealias.c \ dealias/scamper_dealias_warts.c \ dealias/scamper_dealias_text.c \ dealias/scamper_dealias_json.c \ dealias/scamper_dealias_do.c \ sting/scamper_sting.c \ sting/scamper_sting_warts.c \ sting/scamper_sting_text.c \ sting/scamper_sting_do.c \ neighbourdisc/scamper_neighbourdisc.c \ neighbourdisc/scamper_neighbourdisc_warts.c \ neighbourdisc/scamper_neighbourdisc_do.c \ tbit/scamper_tbit.c \ tbit/scamper_tbit_warts.c \ tbit/scamper_tbit_text.c \ tbit/scamper_tbit_json.c \ tbit/scamper_tbit_do.c \ sniff/scamper_sniff.c \ sniff/scamper_sniff_warts.c \ sniff/scamper_sniff_do.c scamper_CFLAGS = $(AM_CFLAGS) scamper_LDADD = @OPENSSL_LIBS@ scamper_LDFLAGS = @OPENSSL_LDFLAGS@ include_HEADERS = \ scamper_file.h \ scamper_addr.h \ scamper_list.h \ scamper_icmpext.h \ trace/scamper_trace.h \ ping/scamper_ping.h \ tracelb/scamper_tracelb.h \ dealias/scamper_dealias.h \ sting/scamper_sting.h \ neighbourdisc/scamper_neighbourdisc.h \ tbit/scamper_tbit.h \ sniff/scamper_sniff.h man_MANS = \ scamper.1 \ libscamperfile.3 \ warts.5 CLEANFILES = *~ *.core \ trace/*~ ping/*~ tracelb/*~ dealias/*~ sting/*~ \ neighbourdisc/*~ tbit/*~ sniff/*~ scamper-cvs-20171204/scamper/libscamperfile.3000644 001751 000000 00000015711 12577420002 020616 0ustar00mjlwheel000000 000000 .\" .\" libscamperfile.3 .\" .\" Author: Matthew Luckie .\" Copyright (c) 2011 University of Waikato .\" All rights reserved .\" .\" $Id: libscamperfile.3,v 1.7 2015/09/20 02:54:58 mjl Exp $ .\" .Dd May 12, 2011 .Dt LIBSCAMPERFILE 3 .Os .Sh NAME .Nm libscamperfile .Nd scamper warts file library .Sh LIBRARY scamper warts file library (libscamperfile -lscamperfile) .Sh SYNOPSIS .In scamper_file.h .In scamper_addr.h .In scamper_list.h .In scamper_icmpext.h .In scamper_trace.h .In scamper_ping.h .In scamper_tracelb.h .In scamper_dealias.h .In scamper_neighbourdisc.h .In scamper_tbit.h .In scamper_sting.h .In scamper_sniff.h .Sh DESCRIPTION The .Nm library provides the ability to read and write warts files produced by scamper, read arts files produced by CAIDA's Skitter, and write simple text representations of these data. A program that uses libscamperfile to read a warts file (1) allocates a filter defining the types of data contained in the file the program is interested in, (2) opens the file, (3) reads each object from the file until end of file is reached, (4) closes the file and frees the filter. A program that uses libscamperfile is responsible for freeing the data returned. .Sh ROUTINES .Ft scamper_file_t * .Fn scamper_file_filter_alloc "uint16_t *types" "uint16_t num" .br Allocate a filter to use with .Fn scamper_file_read that specifies the types of data the program is interested in with the types parameter, and the number of types in the num parameter. When the filter is no longer required, the caller should use .Fn scamper_file_filter_free to free the filter. For each data type specified the caller is subsequently responsible for freeing the data object when it is no longer required. Valid data type values to specify in the types array are: .Bl -dash -offset 2n -compact -width 1n .It .Sy SCAMPER_FILE_OBJ_LIST .It .Sy SCAMPER_FILE_OBJ_CYCLE_START .It .Sy SCAMPER_FILE_OBJ_CYCLE_DEF .It .Sy SCAMPER_FILE_OBJ_CYCLE_STOP .It .Sy SCAMPER_FILE_OBJ_ADDR .It .Sy SCAMPER_FILE_OBJ_TRACE .It .Sy SCAMPER_FILE_OBJ_PING .It .Sy SCAMPER_FILE_OBJ_TRACELB .It .Sy SCAMPER_FILE_OBJ_DEALIAS .It .Sy SCAMPER_FILE_OBJ_NEIGHBOURDISC .It .Sy SCAMPER_FILE_OBJ_TBIT .It .Sy SCAMPER_FILE_OBJ_STING .It .Sy SCAMPER_FILE_OBJ_SNIFF .El .Pp .Ft void .Fn scamper_file_filter_free "scamper_file_filter_t *filter" .br Free a file filter structure. .Pp .Ft int .Fn scamper_file_filter_isset "scamper_file_filter_t *filter" "uint16_t type" .br Determine if a particular data type will be passed by the filter. It returns zero if the type is not set in the filter, and one if it is. .Pp .Ft scamper_file_t * .Fn scamper_file_open "char *name" "char mode" "char *type" .br Open the file specified by the name parameter. The mode parameter specifies how the file should be opened. If the mode character `r' is specified the file is opened read-only. If the mode character `w' is specified the file is truncated and opened for writing. If the mode character `a' is specified the file is open for writing, but without truncating any existing file. When opening a file for reading, the type parameter is optional as the type of file will be automatically determined. When writing a file, the type parameter allows the caller to define whether the file should be written in "warts" or "text". Note that only "warts" and "arts" can be read by .Nm so use of "warts" is highly recommended. .Pp .Ft scamper_file_t * .Fn scamper_file_openfd "int fd" "char *name" "char mode" "char *type" .br Allocate a new scamper_file_t structure with the file descriptor passed. The name parameter is an optional parameter giving the scamper_file_t a name. The mode parameter has the same meaning as in the .Fn scamper_file_open function. The type paramater is used to define the type of file to be read. If the file descriptor is a socket and the file is to be read, this parameter is useful as .Nm is currently unable to automatically determine the type of file in this scenario. Valid types are "warts", "arts", and "text". .Pp .Ft scamper_file_t * .Fn scamper_file_opennull "void" .br Allocate a new scamper_file_t that does not write to a file. Use in conjection with .Fn scamper_file_setwritefunc to do your own I/O. .Pp .Ft void .Fn scamper_file_close "scamper_file_t *sf" .br Close the file and free the scamper_file_t. .Pp .Ft void .Fn scamper_file_free "scamper_file_t *sf" .br Free the scamper_file_t but do not close the underlying file descriptor. This function is useful if the scamper_file_t was created using a file descriptor and .Fn scamper_file_openfd . .Pp .Ft int .Fn scamper_file_read "scamper_file_t *sf" "scamper_file_filter_t *filter" "uint16_t *obj_type" "void **obj_data" .br Read the next data object from the file according to the filter passed in. Returns zero on success, -1 if an error occured. When the end of file is reached, zero is returned and obj_data is set to NULL. The next data object is returned in obj_data, and the type of that object is returned in obj_type. The caller is responsible for freeing the data after it is no longer required; for example, call .Fn scamper_trace_free for trace objects, and .Fn scamper_ping_free for ping objects. .Pp .Ft void .Fn scamper_file_setwritefunc "scamper_file_t *sf" "void *param" "scamper_file_writefunc_t writefunc" .br Override the function used to write warts data. The writefunc takes three parameters: the first is the param variable passed to .Fn scamper_file_setwritefunc , the second is a pointer to the data to write, and the third is the length of the data, in bytes. This function is used in conjunction with .Fn scamper_file_opennull . .Pp .Sh EXAMPLE The following opens the file specified by name, reads all traceroute and ping data until end of file, processes the data, calls the appropriate methods to free the data, and then closes the file. .Bd -literal -offset indent uint16_t types[] = { SCAMPER_FILE_OBJ_TRACE, SCAMPER_FILE_OBJ_PING, }; scamper_file_t *in; scamper_file_filter_t *filter; scamper_trace_t *trace; scamper_ping_t *ping; uint16_t type; void *data; if((filter = scamper_file_filter_alloc(types, 2)) == NULL) { fprintf(stderr, "could not allocate filter\\n"); return -1; } if((in = scamper_file_open(name, 'r', NULL)) == NULL) { fprintf(stderr, "could not open %s: %s\\n", name, strerror(errno)); return -1; } while(scamper_file_read(in, filter, &type, (void *)&data) == 0) { if(data == NULL) break; /* EOF */ switch(type) { case SCAMPER_FILE_OBJ_TRACE: trace = data; process_trace(trace); scamper_trace_free(trace); break; case SCAMPER_FILE_OBJ_PING: ping = data; process_ping(ping); scamper_ping_free(ping); break; } } scamper_file_close(in); scamper_file_filter_free(filter); .Ed .Sh SEE ALSO .Xr scamper 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2text 1 , .Rs .%A "M. Luckie" .%T "Scamper: a Scalable and Extensible Packet Prober for Active Measurement of the Internet" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2010" .Re .Sh AUTHORS .Nm was written by Matthew Luckie . scamper-cvs-20171204/scamper/scamper.1000644 001751 000000 00000127003 13146652672 017300 0ustar00mjlwheel000000 000000 .\" .\" scamper.1 .\" .\" Authors: Matthew Luckie .\" Boris Pfahringer .\" .\" Copyright (c) 2007-2011 University of Waikato .\" Copyright (c) 2012-2015 The Regents of the University of California .\" Copyright (c) 2015 Matthew Luckie .\" All rights reserved .\" .\" $Id: scamper.1,v 1.74 2017/08/21 21:50:50 mjl Exp $ .\" .\" nroff -man scamper.1 .\" groff -man -Tascii scamper.1 | man2html -title scamper.1 .\" .Dd July 2, 2017 .Dt SCAMPER 1 .Os .\"""""""""""" .Sh NAME .Nm scamper .Nd parallel Internet measurement utility .Sh SYNOPSIS .Nm .Bk -words .Op Fl ?Dv .Op Fl c Ar command .Op Fl p Ar pps .Op Fl w Ar window .Op Fl M Ar monitorname .Op Fl l Ar listname .Op Fl L Ar listid .Op Fl C Ar cycleid .Op Fl o Ar outfile .Op Fl F Ar firewall .Op Fl d Ar debugfile .Op Fl e Ar pidfile .Op Fl O Ar options .Op Fl i Ar IPs | Fl I Ar cmds | Fl f Ar file | Fl P Ar [ip:]port | Fl R Ar name:port | Fl U Ar unix-dom .Ek .\"""""""""""" .Sh DESCRIPTION The .Nm utility provides the ability to execute Internet measurement techniques to IPv4 and IPv6 addresses, in parallel, to fill a specified packets-per-second rate. Currently, .Nm supports the well-known traceroute and ping techniques, as well as MDA traceroute, alias resolution, some parts of tbit, sting, and neighbour discovery. .Pp .Nm has five modes of operation. First, .Nm can be supplied a list of addresses on the command line with the .Fl i option. .Nm will then execute a command with each of the supplied addresses, in parallel, and output the results as each task completes. Second, .Nm can be supplied a list of addresses in a listfile, one address per line, using the .Fl f option. Third, .Nm can be supplied a list of complete commands on the command line with the .Fl I option. Fourth, .Nm can be instructed to listen on an IP address and port specified with the .Fl P option, or on a unix domain socket specified with the .Fl U option, where it can take commands dynamically. Finally, .Nm can be instructed to connect to a remote host and port specified with the .Fl R option, where it will be supplied with commands dynamically. .Pp The options are as follows: .Bl -tag -width Ds .It Fl ? prints a list of command line options and a synopsis of each. .It Fl v causes .Nm to output version information and exit. .It Fl D With this option set, .Nm will detach and become a daemon. Use with the .Fl P or .Fl U options. .It Fl c Ar command specifies the command for .Nm to use by default. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy dealias .It .Sy neighbourdisc .It .Sy ping .It .Sy trace .It .Sy tracelb .It .Sy sniff .It .Sy sting .It .Sy tbit .El .Nm uses trace by default. The available commands and their options are documented below. .It Fl p Ar pps specifies the target packets-per-second rate for .Nm to reach. By default, this value is 20. .It Fl w Ar window specifies the maximum number of tasks that may be probed in parallel. A value of zero places no upper limit. By default, zero is used. .It Fl M Ar monitorname specifies the canonical name of machine where .Nm is run. This value is used when recording the output in a warts output file. .It Fl l Ar listname specifies the name of the list when run from the command line. This value is used when recording the output in a warts output file. .It Fl L Ar listid specifies the numerical id of the list when run from the command line. This value is used when recording the output in a warts output file. .It Fl C Ar cycleid specifies the numerical cycle id to begin with when run from the command line. This value is used when recording the output in a warts output file. .It Fl o Ar outfile specifies the default output file to write measurement results to. By default, stdout is used. .It Fl F Ar firewall specifies that .Nm may use the firewall in measurements that require it (tbit and sting). .Nm supports two firewall types: IPFW, and PF. To use the IPFW firewall, pass ipfw:-, where is the first rule .Nm can use, and is the last. To use the PF firewall, pass pf::, where is the anchor for .Nm to use, and specifies the number of rules .Nm is allowed to use. .It Fl d Ar debugfile specifies a filename to write debugging messages to. By default, no debugfile is used, though debugging output is sent to stderr if scamper is built for debugging. .It Fl e Ar pidfile specifies a file to write scamper's process ID to. If scamper is built with privilege separation, the ID of the unprivileged process is written. .It Fl O Ar options allows scamper's behaviour to be further tailored. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy text: output results in plain text. Suitable for interactive use. .It .Sy warts: output results in warts format. Suitable for archiving measurement results and for use by researchers as it records details that cannot be easily represented with the text option. .It .Sy json: output results in json format. Suitable for processing measurement results with a scripting language. A better approach is to output results in warts format, and to use .Xr sc_warts2json 1 . .It .Sy planetlab: tell scamper it is running on a planetlab system. Necessary to use planetlab's safe raw sockets. .It .Sy rawtcp: tell scamper to use IPPROTO_RAW socket to send IPv4 TCP probes, rather than a datalink socket. .It .Sy select: tell scamper to use .Xr select 2 rather than .Xr poll 2 .It .Sy kqueue: tell scamper to use .Xr kqueue 2 rather than .Xr poll 2 on systems where .Xr kqueue 2 is available. .It .Sy epoll: tell scamper to use .Xr epoll 7 rather than .Xr poll 2 on systems where .Xr epoll 7 is available. .It .Sy tsps: the input file consists of a sequence of IP addresses for pre-specified IP timestamps. .It .Sy cmdfile: the input file consists of complete commands. .It .Sy noinitndc: do not initialise the neighbour discovery cache. .It .Sy outcopy: write a copy of all data written by scamper with the default output method. .It .Sy debugfileappend: append to the debugfile specified with the .Fl d option. The default is to truncate the debugfile. .It .Sy tls: require the use of TLS with the remove controller specified with the .Fl R option. .It .Sy notls: do not use TLS anywhere in scamper, including tbit. .El .It Fl i Ar IP 1..N specifies the addresses to probe, on the command line, using the command specified with the .Fl c option. .It Fl f Ar listfile specifies the input file to read for target addresses, one per line, and uses the command specified with the .Fl c option on each. .It Fl I Ar cmds. specifies complete commands, including target addresses, for scamper to execute. .It Fl P Ar [ip:]port specifies that .Nm provide a control socket listening on the specified IP address and port on the local host. If an IP address is not specified, .Nm will bind to the port specified on the loopback address. .It Fl R Ar name:port specifies that .Nm connects to a specified remote host and port to receive commands. .It Fl U Ar unix domain socket specifies that .Nm provide a control socket listening on the specified socket in the unix domain. .El .\"""""""""""" .Sh TRACE OPTIONS The trace command is used for conducting traceroute. The following variations of the .Xr traceroute 8 options are available: .Pp trace .Bk -words .Op Fl MQT .Op Fl c Ar confidence .Op Fl d Ar dport .Op Fl f Ar firsthop .Op Fl g Ar gaplimit .Op Fl G Ar gapaction .Op Fl l Ar loops .Op Fl m Ar maxttl .Op Fl o Ar offset .Op Fl O Ar option .Op Fl p Ar payload .Op Fl P Ar method .Op Fl q Ar attempts .Op Fl s Ar sport .Op Fl S Ar srcaddr .Op Fl t Ar tos .Op Fl U Ar userid .Op Fl w Ar wait .Op Fl W Ar wait-probe .Op Fl z Ar gss-entry .Op Fl Z Ar lss-name .Ek .Bl -tag -width Ds .It Fl c Ar confidence specifies that a hop should be probed to a specified confidence level (95% or 99%) to be sure the trace has seen all interfaces that will reply for that hop. .It Fl d Ar dport specifies the base destination port value to use for UDP-based and TCP-based traceroute methods. For ICMP-paris, this option sets the ICMP checksum value. .It Fl f Ar firsthop specifies the TTL or HLIM value to begin probing with. By default, a first hop of one is used. .It Fl g Ar gaplimit specifies the number of unresponsive hops permitted until a check is made to see if the destination will respond. By default, a gap limit of 5 hops is used. Setting the gap limit to 0 disables the gap limit, but doing this is not recommended. .It Fl G Ar gapaction specifies what should happen if the gaplimit condition is met. A value of 1 (default) means halt probing, while a value of 2 means send last-ditch probes. .It Fl m Ar maxttl specifies the maximum TTL or HLIM value that will be probed. By default, there is no restriction, apart from the 255 hops that the Internet protocols allow. .It Fl M specifies that path MTU discovery (PMTUD) should be attempted for the path when the initial traceroute completes. .Nm will not conduct PMTUD unless it is probing a responsive destination, as otherwise there is no way to distinguish all packets being lost from just big packets (larger than MTU) being lost. .It Fl l Ar loops specifies the maximum number of loops permitted until probing stops. By default, a value of one is used. A value of zero disables loop checking. .It Fl o Ar offset specifies the fragmentation offset to use in probes. By default, no offset is used. .It Fl O Ar option specifies optional arguments to use. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy dl specifies that the datalink socket should be used to timestamp packets, and to receive certain packets. .It .Sy dtree-noback specifies that the traceroute should not do backwards probing when using doubletree. .El .It Fl p Ar payload specifies the payload of the probe to use as a base. The payload is specified in hexadecimal. Note that the payload supplied is merely a base; the first 2 bytes may be modified to accomplish ICMP-Paris and UDP-Paris traceroute. .It Fl P Ar method specifies the traceroute method to use. .Nm currently supports five different probe methods: UDP, ICMP, UDP-paris, ICMP-paris, TCP, and TCP-ACK. By default, UDP-paris is used. .It Fl q Ar attempts specifies the maximum number of attempts to obtain a response per hop. By default, a value of two is used. .It Fl Q specifies that all allocated probes are sent, regardless of how many responses have been received. .It Fl s Ar sport specifies the source port value to use. For ICMP-based methods, this option specifies the ICMP identifier to use. .It Fl S Ar srcaddr specifies the source address to use in probes. The address cannot be spoofed. .It Fl t Ar tos specifies the value to set in the IP ToS/DSCP + ECN byte. By default, this byte is set to zero. .It Fl T specifies that time exceeded messages from the destination do not cause the trace to be defined as reaching the destination. .It Fl U Ar userid specifies an unsigned integer to include with the data collected; the meaning of the user-id is entirely up to the user and has no effect on the behaviour of traceroute. .It Fl w Ar wait specifies how long to wait, in seconds, for a reply. By default, a value of 5 is used. .It Fl W Ar wait-probe specifies the minimum time to wait, in 10s of milliseconds, between sending consecutive probes. By default the next probe is sent as soon as possible. .It Fl z Ar gss-entry specifies an IP address to halt probing when encountered; used with the double-tree algorithm. .It Fl Z Ar lss-name specifies the name of the local stop set to use when determining when to halt probing backwards; used with the double-tree algorithm. .El .\"""""""""""" .Sh PING OPTIONS The ping command is used for conducting ping. The following variations of the .Xr ping 8 options are available: .Pp ping .Bk -words .Op Fl R .Op Fl B Ar payload .Op Fl c Ar probecount .Op Fl C Ar icmp-sum .Op Fl d Ar dport .Op Fl F Ar sport .Op Fl i Ar wait .Op Fl m Ar ttl .Op Fl M Ar MTU .Op Fl o Ar replycount .Op Fl O Ar options .Op Fl p Ar pattern .Op Fl P Ar method .Op Fl s Ar size .Op Fl S Ar srcaddr .Op Fl T Ar timestamp .Op Fl U Ar userid .Op Fl W Ar timeout .Op Fl z Ar tos .Ek .Bl -tag -width Ds .It Fl B Ar payload specifies, in a hexadecimal string, the payload to include in each probe. .It Fl c Ar probecount specifies the number of probes to send before exiting. By default, a value of 4 is used. .It Fl C Ar icmp-sum specifies the ICMP checksum to use when sending a probe. The payload of each probe will be manipulated so that the checksum is valid. .It Fl d Ar dport specifies the destination port to use in each TCP/UDP probe, and the first ICMP sequence number to use in ICMP probes. .It Fl F Ar sport specifies the source port to use in each TCP/UDP probe, and the ICMP ID to use in ICMP probes. .It Fl i Ar wait specifies the length of time to wait, in seconds, between probes. By default, a value of 1 is used. .It Fl m Ar ttl specifies the TTL value to use for outgoing packets. By default, a value of 64 is used. .It Fl M Ar MTU specifies a pseudo MTU value. If the response packet is larger than the pseudo MTU, an ICMP packet too big (PTB) message is sent. .It Fl o Ar replycount specifies the number of replies required at which time probing may cease. By default, all probes are sent. .It Fl O Ar options The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy dl specifies that the ping should use datalink sockets, rather than raw sockets. .It .Sy spoof specifies that the source address is to be spoofed according to the address specified with the .Fl S option. The address scamper would otherwise use as the source address is embedded in the payload of the probe. .It .Sy tbt specifies that the goal of the ping is to obtain fragmented responses, so that the .Fl c option specifies how many packets to send, and the .Fl o option specifies how many fragmented responses are desired. .El .It Fl p Ar pattern specifies the pattern, in hex, to use in probes. Up to 16 bytes may be specified. By default, each probe's bytes are zeroed. .It Fl P Ar method specifies the type of ping packets to send. By default, ICMP echo requests are sent. Choices are: icmp-echo, icmp-time, tcp-syn, tcp-ack, tcp-ack-sport, udp, and udp-dport. .It Fl R specifies that the record route IP option should be used. .It Fl s Ar size specifies the size of the probes to send. The probe size includes the length of the IP and ICMP headers. By default, a probe size of 84 bytes is used for IPv4 pings, and 56 bytes for IPv6 pings. .It Fl S Ar srcaddr specifies the source address to use in probes. The address can be spoofed if -O spoof is included. .It Fl T Ar timestamp specifies that an IP timestamp option be included. The timestamp option can either be: tsprespec where IP addresses of devices of interest can be specified; tsonly, where timestamps are embedded by devices but no IP addresses are included; and tsandaddr, where timestamps and IP addresses are included by devices in the path. See the examples section for more information. .It Fl U Ar userid specifies an unsigned integer to include with the data collected; the meaning of the user-id is entirely up to the user and has no effect on the behaviour of ping. .It Fl W Ar timeout specifies how long to wait for responses after the last ping is sent. By default this is one second. .It Fl z Ar tos specifies the value to use in the IPv4 ToS/DSCP + ECN byte. By default, this byte is set to zero. .El .\"""""""""""" .Sh DEALIAS OPTIONS The dealias command is used to send probes for the purpose of alias resolution. It supports the mercator technique, where aliases are inferred if a router uses a different address when sending an ICMP response; the ally technique, where aliases are inferred if a sequence of probes sent to alternating IP addresses yields responses with incrementing, interleaved IP-ID values; radargun, where probes are sent to a set of IP addresses in multiple rounds and aliases are inferred by post-processing the results; prefixscan, where an alias is searched in a prefix for a specified IP address; and bump, where two addresses believed to be aliases are probed in an effort to force their IP-ID values out of sequence. The following options are available for the .Nm dealias command: .Pp dealias .\"dealias [-d dport] [-f fudge] [-m method] [-o replyc] [-O option]\n" .\" [-p '[-c sum] [-d dp] [-F sp] [-i ip] [-M mtu] [-P meth] [-s size] [-t ttl]']\n" .\" [-q attempts] [-r wait-round] [-s sport] [-t ttl]\n" .\" [-U userid] [-w wait-timeout] [-W wait-probe] [-x exclude]\n" .Bk -words .Op Fl d Ar dport .Op Fl f Ar fudge .Op Fl m Ar method .Op Fl o Ar replyc .Op Fl O Ar option .Op Fl p Ar probe-options .Op Fl q Ar attempts .Op Fl r Ar wait-round .Op Fl s Ar sport .Op Fl t Ar ttl .Op Fl U Ar userid .Op Fl w Ar wait-timeout .Op Fl W Ar wait-probe .Op Fl x Ar exclude .Ek .Bl -tag -width Ds .It Fl d Ar dport specifies the destination port to use when sending probes. Only valid for the mercator technique; destination ports can be specified in probedefs defined with .Fl p for other alias resolution methods. .It Fl f Ar fudge specifies a fudge factor for alias matching. Defaults to 200. Only valid for ally and bump. .It Fl m Ar method specifies which method to use for alias resolution. Valid options are: ally, bump, mercator, prefixscan, and radargun. .It Fl o Ar replyc specifies how many replies to wait for. Only valid for prefixscan. .It Fl O Ar option allows alias resolution behaviour to be further tailored. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy inseq where IP-ID values are required to be strictly in sequence (with no tolerance for packet reordering) .It .Sy shuffle randomise the order of probes sent each round; only valid for radargun probing. .It .Sy nobs do not allow for byte swapped IP-ID values in responses. Valid for ally and prefixscan. .El .It Fl p Ar probedef specifies a definition for a probe. Possible options are: .Bl -tag -width Ds .It Fl c Ar sum specifies what ICMP checksum to use for ICMP probes. The payload of the probe will be altered appropriately. .It Fl d Ar dst-port specifies the destination port of the probe. Defaults to 33435. .It Fl F Ar src-port specifies the source port of the probe. Defaults to (pid & 0x7fff) + 0x8000. .It Fl i Ar IP specifies the destination IP address of the probe. .It Fl M Ar mtu specifies the pseudo MTU to use when soliciting fragmented responses. .It Fl P Ar method specifies which method to use for the probe. Valid options are: udp, udp-dport, tcp-ack, tcp-ack-sport, tcp-syn-sport, and icmp-echo. .It Fl s Ar size specifies the size of the probes to send. .It Fl t Ar ttl specifies the IP time to live of the probe. .El The ally method accepts up to two probe definitions; the prefixscan method expects one probe definition; radargun expects at least one probe definition; bump expects two probe definitions. .It Fl q Ar attempts specifies how many times a probe should be retried if it does not obtain a useful response. .It Fl r Ar wait-round specifies how many milliseconds to wait between probing rounds with radargun. .It Fl s Ar sport specifies the source port to use when sending probes. Only valid for mercator. .It Fl t Ar ttl specifies the time-to-live of probes sent. Only valid for mercator. .It Fl U Ar userid specifies an unsigned integer to include with the data collected; the meaning of the user-id is entirely up to the user and has no effect on the behaviour of dealias. .It Fl w Ar wait-timeout specifies how long to wait in seconds for a reply from the remote host. .It Fl W Ar wait-probe specifies how long to wait in milliseconds between probes. .It Fl x Ar exclude specifies an IP address to exclude when using the prefixscan method. May be specified multiple times to exclude multiple addresses. .El .\"""""""""""" .Sh NEIGHBOUR DISCOVERY OPTIONS The neighbourdisc command attempts to find the layer-2 address of a given IP address using IPv4 ARP or IPv6 Neighbour Discovery. The following options are available for the .Nm neighbourdisc command: .Pp neighbourdisc .Bk -words .Op Fl FQ .Op Fl i Ar interface .Op Fl o Ar reply-count .Op Fl q Ar attempts .Op Fl w Ar wait .Ek .Bl -tag -width Ds .It Fl F specifies that we only want the first response. .It Fl Q specifies that we want to send all attempts. .It Fl i Ar interface specifies the name of the interface to use for neighbour discovery. .It Fl o Ar reply-count specifies how many replies we wait for. .It Fl q Ar attempts specifies how many probes we send out. .It Fl w Ar wait specifies how long to wait between probes in milliseconds. Defaults to 1000. .El .\"""""""""""" .Sh TBIT OPTIONS The tbit command can be used to infer TCP behaviour of a specified host. At present, it implements tests to check the ability of the host to respond to ICMP Packet Too Big messages, respond to Explicit Congestion Notification, test Selective Acknowledgement behaviour, the Initial Congestion Window, and resilience to Blind Attacks. The following options are available for the .Nm tbit command: .Pp tbit .\"tbit [-t type] [-p app] [-d dport] [-s sport] [-b asn] [-f cookie]\n" .\" [-i icw] [-L abclimit] [-m mss] [-M mtu] [-o offset] [-O option]\n" .\" [-P ptbsrc] [-q attempts] [-S srcaddr] [-T ttl] [-u url]"; .Bk -words .Op Fl t Ar type .Op Fl p Ar app .Op Fl d Ar dport .Op Fl s Ar sport .Op Fl a Ar acks .Op Fl b Ar ASN .Op Fl i Ar ICW .Op Fl f Ar cookie .Op Fl L Ar limit .Op Fl m Ar mss .Op Fl M Ar mtu .Op Fl o Ar offset .Op Fl O Ar option .Op Fl P Ar ptbsrc .Op Fl q Ar attempts .Op Fl S Ar srcaddr .Op Fl T Ar ttl .Op Fl u Ar url .Op Fl U Ar userid .Op Fl w Ar wscale .Ek .Bl -tag -width Es .It Fl t Ar type specifies which type of testing to use. Valid options are: pmtud, ecn, null, sack-rcvr, icw, abc, blind-rst, blind-syn, blind-data. .It Fl p Ar app specifies what kind of traffic to generate for testing. Destination port defaults the application standard port. Valid applications are: http, bgp. .It Fl d Ar dport specifies the destination port for the packets being sent. Defaults are application-specific. .It Fl s Ar sport specifies the source port for the packets being sent. Default is based of the .Nm process id. .It Fl a Ar acks specifies the sequence of packets that should be acknowledged as part of the ABC test. .It Fl b Ar ASN specifies the autonomous system number (ASN) that should be used when establishing a BGP session. .It Fl i Ar ICW specifies the initial congestion window (ICW) that we expect from the peer when conducting the ABC test. .It Fl f Ar cookie specifies the TCP fast open cookie that should be used when establishing a TCP connection. .It Fl L Ar limit test the response to a theoretical limit (L) value with ABC. .It Fl m Ar mss specifies the maximum segment size to advertise to the remote host. .It Fl M Ar mtu specifies the MTU to use in a Packet Too Big message. .It Fl o Ar offset specifies the sequence number offset to use when conducting blind-syn and blind-rst tests, and the acknowledgement number offset to use when conducting a blind-data test. .It Fl O Ar option allows tbit behaviour to be further tailored. The current choices for this option are: .Bl -dash -offset 2n -compact -width 1n .It .Sy blackhole: for PMTUD testing, do not send Packet Too Big messages; this tests to ability of a host to infer a PMTUD blackhole and work around it. .It .Sy tcpts: advertise support for TCP timestamps when establishing a TCP connection. If the peer supports TCP timestamps, embed timestamps in data packets. .It .Sy ipts-syn: use the timestamp IP option in a SYN packet when attempting to establish a TCP connection. .It .Sy iprr-syn: use the record-route IP option in a SYN packet when attempting to establish a TCP connection. .It .Sy ipqs-syn: use the quick-start IP option in a SYN packet when attempting to establish a TCP connection. .It .Sy sack: advertise support for TCP selective acknowledgements (SACK) when establishing a TCP connection. .It .Sy fo: advertise support for TCP fast open using the official IANA number assigned for fast open. .It .Sy fo-exp: advertise support for TCP fast open using the testing number assigned by IANA for fast open. .El .It Fl P Ar ptbsrc specifies the source address that should be used to send Packet Too Big messages in the pmtud test. .It Fl q Ar attempts specifies the number of attempts to make with each packet to reduce false inferences caused by packet loss. .It Fl S Ar srcaddr specifies the source address that should be used in TCP packets sent by the tbit test. .It Fl T Ar ttl specifies the IP time-to-live value that should be used in TCP packets sent by the tbit test. .It Fl u Ar url specifies a url to use when using the http application method. If the url starts with https, the tbit test begins with a TLS handshake. .It Fl U Ar userid specifies an unsigned integer to include with the data collected; the meaning of the user-id is entirely up to the user and has no effect on the behaviour of tbit. .It Fl w Ar wscale specifies the window scale option to use when establishing the TCP connection. .El .\"""""""""""" .Sh TRACELB OPTIONS The tracelb command is used to infer all per-flow load-balanced paths between a source and destination. The following options are available for the .Nm tracelb command: .Pp tracelb .\"tracelb [-c confidence] [-d dport] [-f firsthop] [-g gaplimit]\n" .\" [-P method] [-q attempts] [-Q maxprobec] [-s sport]\n" .\" [-t tos] [-U userid] [-w wait-timeout] [-W wait-probe]"; .Bk -words .Op Fl c Ar confidence .Op Fl d Ar dport .Op Fl f Ar firsthop .Op Fl g Ar gaplimit .Op Fl P Ar method .Op Fl q Ar attempts .Op Fl Q Ar maxprobec .Op Fl s Ar sport .Op Fl t Ar tos .Op Fl U Ar userid .Op Fl w Ar wait-timeout .Op Fl W Ar wait-probe .Ek .Bl -tag -width Es .It Fl c Ar confidence specifies the level of confidence we want to attain that there are no more parallel load balanced paths at a given hop. Valid values are 95 (default) and 99, for 95% confidence and 99% confidence respectively. .It Fl d Ar dport specifies the base destination port to use. Defaults to 33435, the default used by traceroute(8). .It Fl f Ar firsthop specifies how many hops away we should start probing. .It Fl g Ar gaplimit specifies how many consecutive unresponsive hops are permitted before probing down a branch halts. Defaults to three. .It Fl P Ar method specifies which method we should use to do the probing. Valid options are: "udp-dport", "icmp-echo", "udp-sport", "tcp-sport", and "tcp-ack-sport". Defaults to "udp-dport". .It Fl q Ar attempts specifies how many probes we should send in an attempt to receive a reply. Defaults to 2. .It Fl Q Ar maxprobec specifies the maximum number of probes we ever want to send. Defaults to 3000. .It Fl s Ar sport specifies to the source port to use when sending probes. Default based on process ID. .It Fl t Ar tos specifies the value for the IP Type-of-service field for outgoing probes. Defaults to 0. .It Fl U Ar userid specifies an unsigned integer to include with the data collected; the meaning of the user-id is entirely up to the user and has no effect on the behaviour of tracelb. .It Fl w Ar wait-timeout specifies in seconds how long to wait for a reply to a probe. Defaults to 5. .It Fl W Ar wait-probe specifies in 1/100ths of seconds how long to wait between probes. Defaults to 25 (i.e. 250ms). .El .\"""""""""""" .Sh STING OPTIONS The sting command is used to infer one-way loss using an algorithm with TCP probes. It requires the firewall be enabled in scamper using the .Fl F option. The following options are available for the .Nm sting command: .Pp sting .\"sting [-c count] [-d dport] [-f distribution] [-h request]\n" .\" [-H hole] [-i inter] [-m mean] [-s sport]"; .Bk -words .Op Fl c Ar count .Op Fl d Ar dport .Op Fl f Ar distribution .Op Fl h Ar request .Op Fl H Ar hole .Op Fl i Ar inter .Op Fl m Ar mean .Op Fl s Ar sport .Ek .Bl -tag -width Es .It Fl c Ar count specifies the number of samples to make. By default 48 samples are sent, as this value is the current default of the FreeBSD TCP reassembly queue length. Sting 0.7 uses 100 samples. .It Fl d Ar dport specifies the base destination port to use. Defaults to 80, the default port used by the HTTP protocol. .It Fl f Ar distribution specifies the delay distribution of samples. By default a uniform distribution is constructed. Other distributions are currently not implemented in scamper's implementation of sting. .It Fl h Ar request specifies the default request to make. Currently not implemented. .It Fl H Ar hole specifies the size of the initial hole left in the request. The default is 3 bytes, the same as sting-0.7. .It Fl i Ar inter specifies the inter-phase delay between data seeding and hole filling, in milliseconds. By default, sting waits 2000ms between phases. .It Fl m Ar mean specifies the mean rate to send packets in the data phase, in milliseconds. By default, sting waits 100ms between probes. .It Fl s Ar sport specifies to the source port to use when sending probes. Default is based on the process ID. .El .\"""""""""""" .Sh SNIFF OPTIONS The sniff command is used to capture packets matching a specific signature. At present, the only supported signature is ICMP echo packets with a specific ID value, or packets containing such a quote. The following options are available for the .Nm sniff command: .Pp sting .Bk -words .Op Fl c Ar limit-pktc .Op Fl G Ar limit-time .Op Fl S Ar ipaddr .Op Fl U Ar userid .Ek .Bl -tag -width Es .It Fl c Ar limit-pktc specifies the maximum number of packets to capture. .It Fl G Ar limit-time specifies the maximum time, in seconds, to capture packets. .It Fl S Ar ipaddr specifies the IP address that packets must arrive using. scamper uses the IP address to identify the appropriate interface to listen for packets. .It Fl U Ar userid specifies an unsigned integer to include with the data collected; the meaning of the user-id is entirely up to the user and has no effect on the behaviour of sniff. .El .Pp The sole supported expression is icmp[icmpid] == X, where X is the ICMP-ID to select. .\"""""""""""" .Sh DATA COLLECTION FEATURES .Nm has two data output formats. The first is a human-readable format suitable for one-off data collection and measurement. The second, known as .Ic warts , is a binary format that records much more meta-data and is more precise than the human-readable format. .Pp .Nm is designed for Internet-scale measurement, where large lists of targets are supplied for probing. .Nm has the ability to probe multiple lists simultaneously, with each having a mix rate that specifies the priority of the list. .Nm can also make multiple cycles over a list of addresses. .Pp When writing output to a .Ic warts file, .Nm records details of the list and cycle that each measurement task belongs to. .\"""""""""""" .Sh CONTROL SOCKET When started with the .Fl P option, .Nm allows inter-process communication via a TCP socket bound to the supplied port on the local host. This socket is useful for controlling the operation of a long-lived .Nm process. A client may interact with scamper by using .Xr telnet 1 to open a connection to the supplied port. .Pp The following control socket commands are available. .Pp .Bl -tag -width " " .It Ic exit The exit command closes the current control socket connection. .It Ic attach The attach command changes how .Nm accepts and replies to commands, returning results straight over the control socket. See .Sy ATTACH section below for details on which commands are accepted. .It Ic get Ar argument The get command returns the current setting for the supplied argument. Valid argument values are: holdtime, monitorname, pid, pps, sport, version. .It Ic set Ar argument ... The set command sets the current setting for the supplied argument. Valid argument values are: holdtime, monitorname, pps. .It Ic source Ar argument ... .Bl -tag -width " " .It Ic add Ar arguments The .Ic source add command allows a new input source to be added. It accepts the following arguments: .Bl -tag -width " " .It Ic name Ar string The name of the source. This parameter is mandatory. .It Ic descr Ar string An optional string describing the source. .It Ic command Ar string The command to execute for each address supplied. If not supplied, the default command is used. .It Ic list_id Ar uint32_t An optional numeric list identifier, assigned by a human. If not supplied, a value of zero is used. .It Ic cycle_id Ar uint32_t An optional numeric initial cycle identifier to use, assigned by a human. If not supplied, a value of one is used. .It Ic priority Ar uint32_t An optional numeric value that specifies the mix rate of measurements from the source compared to other sources. If not supplied, a mix rate of one is used. A value of zero causes the source to be created, but not actively used. .It Ic outfile Ar string The name of the output file to write results to, previously defined with .Ic outfile open . If not supplied, the default output file is used. .It Ic file Ar string The name of the input file to read target addresses from. This parameter is mandatory if the source is a managed source. .It Ic cycles Ar integer The number of cycles to make over the target address file. If zero, .Nm will loop indefinitely over the file. This parameter is ignored unless a managed source is defined. .It Ic autoreload Xo .Op Cm on | off .Xc This parameter specifies if the target address file should be re-read whenever a cycle is completed, or if the same set of target addresses as the previous cycle should be used. If not specified, the file is not automatically reloaded at cycle time. .El .It Ic update Ar name arguments The .Ic source update command allows some properties of an existing source to be modified. The source to update is specified with the .Ar name parameter. Valid parameters are: autoreload, cycles, and priority. .It Ic list Ar ... The .Ic source list command provides a listing of all currently defined sources. The optional third .Ar name parameter restricts the listing to the source specified. .It Ic cycle Ar name The .Ic source cycle command manually inserts a cycle marker in an adhoc source. .It Ic delete Ar name The .Ic source delete command deletes the named source, if possible. .El .It Ic outfile Ar argument ... The outfile commands provide the ability to manage output files. It accepts the following arguments: .Bl -tag -width " " .It Ic open Ar ... The .Ic outfile open command allows a new output file to be defined. It accepts the following parameters: .Bl -tag -width " " .It Ic name Ar alias The alias of the output file. This parameter is mandatory. .It Ic file Ar string The filename of the output file. This parameter is mandatory. .It Ic mode Xo .Op Cm truncate | append .Xc How the file will be opened. If the append mode is used, any existing file with the specified name will be appended to. If the truncate mode is used, any existing file will be truncated when it is opened. .El .It Ic close Ar alias The .Ic outfile close command allows an existing output file to be closed. The mandatory .Ar alias parameter specifies which output file to close. An output file that is currently referenced is not able to be closed. To close a file that is currently referenced, a new outfile must be opened, and then the .Ic outfile swap command be used. .It Ic swap Ar alias1 alias2 The .Ic outfile swap command swaps the file associated with each output file. .It Ic list The .Ic outfile list command outputs a list of the existing outfiles. .El .It Ic observe sources This command allows for monitoring of source events. When executed, the control socket will then supply event notices whenever a source is added, updated, deleted, finished, or cycled. Each event is prefixed with a count of the number of seconds elapsed since the Unix epoch. The following examples illustrate the event monitoring capabilities: .Pp .Dl EVENT 1169065640 source add name 'foo' list_id 5 priority 1 .Dl EVENT 1169065641 source update 'foo' priority 15 .Dl EVENT 1169065642 source cycle 'bar' id 2 .Dl EVENT 1169065650 source finish 'bar' .Dl EVENT 1169065661 source delete 'foo' .It Ic shutdown Ar argument The shutdown argument allows the .Nm process to be exited cleanly. The following arguments are supported .Bl -tag -width " " .It Ic done The .Ic shutdown done command requests that .Nm shuts down when the current tasks, as well as all remaining cycles, have completed. .It Ic flush The .Ic shutdown flush command requests that .Nm flushes all remaining tasks queued with each list, finishes all current tasks, and then shuts down. .It Ic now The .Ic shutdown now command causes .Nm to shutdown immediately. Unfinished tasks are purged. .It Ic cancel The .Ic shutdown cancel command cancels any pending shutdown. .El .El .\"""""""""" .Sh ATTACH MODE In attach mode, none of the usual interactive mode commands are usable. Instead, commands may be entered directly and results will be sent back directly over the control socket. Commands are specified just as they would be with the -I flag for a command-line invocation of .Nm . Replies are split into lines by single \\n characters and have one of the following formats: .Bl -tag -width " " .It Ic ERR Ar ... A line starting with the 3 characters "ERR" indicates an error has occurred. The rest of the line will contain an error message. .It Ic OK Ar id-num A line with the 2 characters "OK" indicates that scamper has accepted the command. .Nm versions after 20110623 return an id number associated with the command, which allow the task to be halted by subsequently issuing a "halt" instruction. .It Ic MORE A line with just the 4 characters "MORE" indicates that scamper has the capacity to accept more probing commands to run in parallel. .It Ic DATA Ar length A line starting with the 4 characters "DATA" follow by a space then a base-10 number indicates the start of result. .Ar length specifies the number of characters of the data, including newlines. The data is in binary warts format and uuencoded before transmission. .El .Pp To exit attached mode the client must send a single line containing "done". To halt a command that has not yet completed, issue a "halt" instruction with the id number returned when the command was accepted as the sole parameter. .\"""""""""" .Sh EXAMPLES To use the default traceroute command to trace the path to 192.0.2.1: .Pp .in +.5i scamper -i 192.0.2.1 .in -.5i .Pp To infer Path MTU changes in the network and associate them with a traceroute path: .Pp .in +.5i scamper -I "trace -P udp-paris -M 192.0.2.1" .in -.5i .Pp To use paris traceroute with ICMP probes, using 3 probes per hop, sending all probes, writing to a specified warts file: .Pp .in +.5i scamper -O warts -o file.warts -I "trace -P icmp-paris -q 3 -Q 192.0.2.1" .in -.5i .Pp To ping a series of addresses defined in .Ar filename , probing each address 10 times: .Pp .in +.5i scamper -c "ping -c 10" .Ar filename .in -.5i .Pp Care must be taken with shell quoting when using commands with multiple levels of quoting, such as when giving a probe description with a dealias command. The following sends UDP probes to alternating IP addresses, one second apart, and requires the IP-ID values returned to be strictly in sequence. .Pp .in +.5i scamper -O warts -o ally.warts -I "dealias -O inseq -W 1000 -m ally -p '-P udp -i 192.0.2.1' -p '-P udp -i 192.0.2.4'" .in -.5i .Pp Alternatively, the following accomplishes the same, but without specifying the UDP probe method twice. .Pp .in +.5i scamper -O warts -o ally.warts -I "dealias -O inseq -W 1000 -m ally -p '-P udp' 192.0.2.1 192.0.2.4" .in -.5i .Pp The following command scans 198.51.100.0/28 for a matching alias to 192.0.2.4, but skips 198.51.100.3. .Pp .in +.5i scamper -O warts -o prefixscan.warts -I "dealias -O inseq -W 1000 -m prefixscan -p '-P udp' -x 198.51.100.3 192.0.2.4 198.51.100.0/28" .in -.5i .Pp The following uses UDP probes to enumerate all per-flow load-balanced paths towards 192.0.2.6 to 99% confidence; it varies the source port with each probe. .Pp .in +.5i scamper -I "tracelb -P udp-sport -c 99 192.0.2.6" .in -.5i .Sh SEE ALSO .Xr ping 8 , .Xr traceroute 8 , .Xr libscamperfile 3 , .Xr sc_ally 1 , .Xr sc_analysis_dump 1 , .Xr sc_attach 1 , .Xr sc_ipiddump 1 , .Xr sc_filterpolicy 1 , .Xr sc_remoted 1 , .Xr sc_speedtrap 1 , .Xr sc_tbitblind 1 , .Xr sc_tracediff 1 , .Xr sc_uptime 1 , .Xr sc_wartscat 1 , .Xr sc_wartsdump 1 , .Xr sc_warts2json 1 , .Xr sc_warts2pcap 1 , .Xr sc_warts2text 1 , .Rs .%A "S. Savage" .%T "Sting: a TCP-based Network Measurement Tool" .%O "1999 USENIX Symposium on Internet Technologies and Systems" .Re .Rs .%A "R. Govindan" .%A "H. Tangmunarunkit" .%T "Heuristics for Internet Map Discovery" .%O "Proc. IEEE INFOCOM 2000" .Re .Rs .%A "N. Spring" .%A "R. Mahajan" .%A "D. Wetherall" .%T "Measuring ISP topologies with Rocketfuel" .%O "Proc. ACM SIGCOMM 2002" .Re .Rs .%A "A. Medina" .%A "M. Allman" .%A "S. Floyd" .%T "Measuring the evolution of transport protocols in the Internet" .%O "ACM/SIGCOMM Computer Communication Review" .Re .Rs .%A "M. Luckie" .%A "K. Cho" .%A "B. Owens" .%T "Inferring and Debugging Path MTU Discovery Failures" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2005" .Re .Rs .%A "B. Donnet" .%A "P. Raoult" .%A "T. Friedman" .%A "M. Crovella" .%T "Efficient algorithms for large-scale topology discovery" .%O "Proc. ACM SIGMETRICS 2005" .Re .Rs .%A "B. Augustin" .%A "X. Cuvellier" .%A "B. Orgogozo" .%A "F. Viger" .%A "T. Friedman" .%A "M. Latapy" .%A "C. Magnien" .%A "R. Teixeira" .%T "Avoiding traceroute anomalies with Paris traceroute" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2006" .Re .Rs .%A "B. Augustin" .%A "T. Friedman" .%A "R. Teixeira" .%T "Measuring Load-balanced Paths in the Internet" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2007" .Re .Rs .%A "A. Bender" .%A "R. Sherwood" .%A "N. Spring" .%T "Fixing Ally's growing pains with velocity modeling" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2008" .Re .Rs .%A "M. Luckie" .%T "Scamper: a Scalable and Extensible Packet Prober for Active Measurement of the Internet" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2010" .Re .Rs .%A "R. Beverly" .%A "W. Brinkmeyer" .%A "M. Luckie" .%A "J.P. Rohrer" .%T "IPv6 Alias Resolution via Induced Fragmentation" .%O "Proc. Passive and Active Measurement Conference 2013" .Re .Rs .%A "M. Luckie" .%A "R. Beverly" .%A "W. Brinkmeyer" .%A "k claffy" .%T "Speedtrap: Internet-scale IPv6 Alias Resolution" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2013" .Re .Rs .%A "M. Luckie" .%A "R. Beverly" .%A "T. Wu" .%A "M. Allman" .%A "k. claffy" .%T "Resilience of Deployed TCP to Blind Attacks" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2015" .Re .Rs .%A "J. Czyz" .%A "M. Luckie" .%A "M. Allman" .%A "M. Bailey" .%T "Don't Forget to Lock the Back Door! A Characterization of IPv6 Network Security Policy" .%O "Proc. Network and Distributed Systems Security (NDSS) Conference 2016" .Re .Rs .%A "M. Luckie" .%A "A. Dhamdhere" .%A "B. Huffaker" .%A "D. Clark" .%A "k. claffy" .%T "bdrmap: Inference of Borders Between IP Networks" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2016" .Re .Rs .%A "M. Luckie" .%A "R. Beverly" .%T "The Impact of Router Outages on the AS-level Internet" .%O "Proc. ACM/SIGCOMM Conference 2017" .Re .\"""""""""""" .Sh AUTHORS .Nm was written by Matthew Luckie . Alistair King contributed an initial implementation of Doubletree; Ben Stasiewicz contributed an initial implementation of TBIT's PMTUD test; Stephen Eichler contributed an initial implementation of TBIT's ECN test; Boris Pfahringer adapted .Nm to use GNU autotools, modularised the tests, and updated this man page. Brian Hammond of Internap Network Services Corporation provided an initial implementation of scamper's json output format. Tiange Wu contributed an initial implementation of the blind in-window TBIT test, and Robert Beverly contributed BGP protocol support for TBIT. .\"""""""""""" .Sh ACKNOWLEDGEMENTS .Nm development was initially funded by the WIDE project in association with CAIDA. Boris' work was funded by the University of Waikato's Centre for Open Source Innovation. scamper-cvs-20171204/scamper/scamper.c000644 001751 000000 00000115635 13210743022 017350 0ustar00mjlwheel000000 000000 /* * scamper * * $Id: scamper.c,v 1.262 2017/12/03 09:38:26 mjl Exp $ * * Matthew Luckie * mjl@luckie.org.nz * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012 Matthew Luckie * Copyright (C) 2014 The Regents of the University of California * Copyright (C) 2014-2016 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper.c,v 1.262 2017/12/03 09:38:26 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_debug.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_file.h" #include "scamper_outfiles.h" #include "scamper_fds.h" #include "scamper_task.h" #include "scamper_sources.h" #include "scamper_source_cmdline.h" #include "scamper_source_file.h" #include "scamper_source_tsps.h" #include "scamper_queue.h" #include "scamper_getsrc.h" #include "scamper_addr2mac.h" #include "scamper_icmp4.h" #include "scamper_icmp6.h" #include "scamper_udp4.h" #include "scamper_udp6.h" #include "scamper_tcp4.h" #include "scamper_rtsock.h" #include "scamper_dl.h" #include "scamper_firewall.h" #include "scamper_probe.h" #include "scamper_privsep.h" #include "scamper_control.h" #include "scamper_osinfo.h" #include "trace/scamper_trace_do.h" #include "ping/scamper_ping_do.h" #include "tracelb/scamper_tracelb_do.h" #include "dealias/scamper_dealias_do.h" #include "sting/scamper_sting_do.h" #include "neighbourdisc/scamper_neighbourdisc_do.h" #include "tbit/scamper_tbit_do.h" #include "sniff/scamper_sniff_do.h" #include "utils.h" #define OPT_PPS 0x00000001 /* p: */ #define OPT_OUTFILE 0x00000002 /* o: */ #define OPT_OPTION 0x00000004 /* O: */ #define OPT_PIDFILE 0x00000010 /* e: */ #define OPT_VERSION 0x00000020 /* v: */ #define OPT_DAEMON 0x00000200 /* D: */ #define OPT_IP 0x00000400 /* i: */ #define OPT_MONITORNAME 0x00002000 /* M: */ #define OPT_COMMAND 0x00004000 /* c: */ #define OPT_HELP 0x00008000 /* ?: */ #define OPT_WINDOW 0x00010000 /* w: */ #define OPT_DEBUGFILE 0x00020000 /* d: */ #define OPT_LISTNAME 0x00040000 /* l: */ #define OPT_LISTID 0x00080000 /* L: */ #define OPT_CYCLEID 0x00100000 /* C: */ #define OPT_FIREWALL 0x00200000 /* F: */ #define OPT_CMDLIST 0x00400000 /* I: */ #define OPT_INFILE 0x00800000 /* f: */ #define OPT_CTRL_INET 0x01000000 /* P: */ #define OPT_CTRL_UNIX 0x02000000 /* U: */ #define OPT_CTRL_REMOTE 0x04000000 /* R: */ #define FLAG_NOINITNDC 0x00000001 #define FLAG_OUTCOPY 0x00000002 #define FLAG_SELECT 0x00000004 #define FLAG_KQUEUE 0x00000008 #define FLAG_PLANETLAB 0x00000010 #define FLAG_EPOLL 0x00000020 #define FLAG_RAWTCP 0x00000040 #define FLAG_DEBUGFILEAPPEND 0x00000080 #define FLAG_TLS 0x00000100 #define FLAG_NOTLS 0x00000200 /* * parameters configurable by the command line: * * options: bitmask corresponding to command line arguments * command: default command to use with scamper * pps: how many probe packets to send per second * window: maximum number of concurrent tasks to actively probe * outfile: where to send results by default * outtype: format to use when writing results to outfile * intype: format of input file * ctrl_inet_addr: address to use for control socket * ctrl_inet_port: port to use for control socket * ctrl_unix: file to use for unix domain control * ctrl_rem_port: port on remote host to connect to for direction * ctrl_rem_name: name or IP address of remote host to connect to * monitorname: canonical name of monitor assigned by human * listname: name of list assigned by human * listid: id of list assigned by human * cycleid: id of cycle assigned by human * arglist: whatever is left over after getopt processing * arglist_len: number of arguments left over after getopt processing * debugfile: place to write debugging output * firewall: scamper should use the system firewall when needed * pidfile: place to write process id */ static uint32_t options = 0; static uint32_t flags = 0; static char *command = NULL; static int pps = SCAMPER_PPS_DEF; static int window = SCAMPER_WINDOW_DEF; static char *outfile = "-"; static char *outtype = "text"; static char *intype = NULL; static char *ctrl_inet_addr = NULL; static int ctrl_inet_port = 0; static char *ctrl_unix = NULL; static int ctrl_rem_port = 0; static char *ctrl_rem_name = NULL; static char *monitorname = NULL; static char *listname = NULL; static int listid = -1; static int cycleid = -1; static char **arglist = NULL; static int arglist_len = 0; static char *firewall = NULL; static char *pidfile = NULL; #ifndef WITHOUT_DEBUGFILE static char *debugfile = NULL; #endif /* * parameters calculated by scamper at run time: * * wait_between: calculated wait between probes to reach pps, in microseconds * probe_window: maximum extension of probing window before truncation * exit_when_done: exit scamper when current window of tasks is completed */ static int wait_between = 1000000 / SCAMPER_PPS_DEF; static int probe_window = 250000; static int exit_when_done = 1; /* central cache of addresses that scamper is dealing with */ scamper_addrcache_t *addrcache = NULL; /* Source port to use in our probes */ static uint16_t default_sport = 0; typedef struct scamper_multicall { char *argv0; char *cmd; int (*validate)(int, char **, int *); const char *(*usage)(void); } scamper_multicall_t; static void version(void) { fprintf(stderr, "scamper version %s\n", SCAMPER_VERSION); return; } static void usage_str(char c, const char *str) { fprintf(stderr, " -%c %s\n", c, str); return; } static void usage_line(const char *str) { fprintf(stderr, " %s\n", str); return; } static void usage(uint32_t opt_mask) { char buf[256]; fprintf(stderr, "usage: scamper [-?Dv] [-c command] [-p pps] [-w window]\n" " [-M monitorname] [-l listname] [-L listid] [-C cycleid]\n" " [-o outfile] [-O options] [-F firewall] [-e pidfile]\n" #ifndef WITHOUT_DEBUGFILE " [-d debugfile]\n" #endif " [-i IPs | -I cmds | -f file | -P [ip:]port | -R name:port" #if defined(AF_UNIX) && !defined(_WIN32) " |\n -U unix]\n"); #else "]\n"); #endif if(opt_mask == 0) return; fprintf(stderr, "\n"); if((opt_mask & OPT_HELP) != 0) usage_str('?', "give an overview of the usage of scamper"); if((opt_mask & OPT_COMMAND) != 0) { (void)snprintf(buf, sizeof(buf), "command string (default: %s)", SCAMPER_COMMAND_DEF); usage_str('c', buf); } if((opt_mask & OPT_CYCLEID) != 0) usage_str('C', "cycle id"); #ifndef WITHOUT_DEBUGFILE if((opt_mask & OPT_DEBUGFILE) != 0) usage_str('d', "write debugging information to the specified file"); #endif #ifdef HAVE_DAEMON if((opt_mask & OPT_DAEMON) != 0) usage_str('D', "start as a daemon listening for commands on a port"); #endif if((opt_mask & OPT_PIDFILE) != 0) usage_str('e', "write process ID to specified file"); if((opt_mask & OPT_INFILE) != 0) usage_str('f', "list of files provided on the command line"); if((opt_mask & OPT_FIREWALL) != 0) usage_str('F', "use the system firewall to install rules as necessary"); if((opt_mask & OPT_IP) != 0) usage_str('i', "list of IP addresses provided on the command line"); if((opt_mask & OPT_CMDLIST) != 0) usage_str('I', "list of scamper commands provided on the command line"); if((opt_mask & OPT_LISTID) != 0) usage_str('l', "name to assign to default list"); if((opt_mask & OPT_LISTNAME) != 0) usage_str('L', "list id for default list"); if((opt_mask & OPT_MONITORNAME) != 0) usage_str('M', "specify the canonical name of the monitor"); if((opt_mask & OPT_OUTFILE) != 0) usage_str('o', "specify the file to write output to"); if((opt_mask & OPT_OPTION) != 0) { usage_str('O', "specify options to use:"); usage_line("text: output results in plain text for interactive use"); usage_line("warts: output results in warts format for science"); usage_line("tsps: input file for ping -T tsprespec=%s"); usage_line("cmdfile: input file specifies whole commands"); usage_line("json: output results in json format, better to use warts"); usage_line("planetlab: necessary to use safe raw sockets on planetlab"); usage_line("noinitndc: do not initialise neighbour discovery cache"); usage_line("outcopy: output copy of all results collected to file"); usage_line("rawtcp: use raw socket to send IPv4 TCP probes"); #ifdef HAVE_OPENSSL usage_line("notls: do not use TLS anywhere in scamper"); usage_line("tls: require TLS on remote control sockets"); #endif #ifndef _WIN32 usage_line("select: use select(2) rather than poll(2)"); #endif #ifdef HAVE_KQUEUE usage_line("kqueue: use kqueue(2) rather than poll(2)"); #endif #ifdef HAVE_EPOLL usage_line("epoll: use epoll(7) rather than poll(2)"); #endif #ifndef WITHOUT_DEBUGFILE usage_line("debugfileappend: append to debugfile, rather than truncate"); #endif } if((opt_mask & OPT_PPS) != 0) { snprintf(buf, sizeof(buf), "number of packets per second to send (%d <= pps <= %d)", SCAMPER_PPS_MIN, SCAMPER_PPS_MAX); usage_str('p', buf); } if((opt_mask & OPT_CTRL_INET) != 0) usage_str('P', "[ip:]port for control socket, default to loopback"); if((opt_mask & OPT_CTRL_REMOTE) != 0) usage_str('R', "name and port of remote host to receive commands from"); if((opt_mask & OPT_CTRL_UNIX) != 0) usage_str('U', "name of control socket in the file system"); if((opt_mask & OPT_VERSION) != 0) usage_str('v', "output the version of scamper this binary is"); if((opt_mask & OPT_WINDOW) != 0) usage_str('w', "limit the window of actively probing tasks"); return; } static int set_opt(uint32_t opt, char *str, int (*setfunc)(int)) { long l = 0; if(string_isnumber(str) == 0 || string_tolong(str, &l) == -1) { usage(opt); return -1; } return setfunc(l); } static int multicall_do(const scamper_multicall_t *mc, int argc, char *argv[]) { char *str; size_t off, len, tmp; int i, stop; if(argc == 1 || mc->validate(argc, argv, &stop) != 0 || stop == argc) { if(mc->usage != NULL) { printf("usage: scamper-%s \n", mc->usage()); } return -1; } /* assemble the command string */ len = strlen(mc->cmd) + 1; for(i=1; icmd); return -1; } off = strlen(mc->cmd); memcpy(str, mc->cmd, off); str[off++] = ' '; for(i=1; i 0 && cid <= 0x7fffffff) { cycleid = cid; return 0; } return -1; } static int listid_set(const int lid) { if(lid > 0 && lid <= 0x7fffffff) { listid = lid; return 0; } return -1; } static int ppswindow_set(int p, int w) { if(p == 0 && w == 0) return -1; if(p != pps) { if(p != 0 && (p < SCAMPER_PPS_MIN || p > SCAMPER_PPS_MAX)) return -1; /* * reset the pps scamper is operating at. re-calculate the * inter-probe delay, and the maximum size of the probe window. */ pps = p; if(p != 0) wait_between = 1000000 / pps; else wait_between = 0; probe_window = 250000; if(wait_between > 250000) probe_window += wait_between; } if(w != window) { if(w != 0 && (w < SCAMPER_WINDOW_MIN || w > SCAMPER_WINDOW_MAX)) return -1; window = w; } return 0; } static int check_options(int argc, char *argv[]) { static const scamper_multicall_t multicall[] = { {"scamper-trace", "trace", scamper_do_trace_arg_validate, scamper_do_trace_usage}, {"scamper-ping", "ping", scamper_do_ping_arg_validate, scamper_do_ping_usage}, {"scamper-tracelb", "tracelb", scamper_do_tracelb_arg_validate, scamper_do_tracelb_usage}, {"scamper-dealias", "dealias", scamper_do_dealias_arg_validate, scamper_do_dealias_usage}, {"scamper-sting", "sting", scamper_do_sting_arg_validate, scamper_do_sting_usage}, {"scamper-neighbourdisc", "neighbourdisc", scamper_do_neighbourdisc_arg_validate, scamper_do_neighbourdisc_usage}, {"scamper-tbit", "tbit", scamper_do_tbit_arg_validate, scamper_do_tbit_usage}, {"scamper-sniff", "sniff", scamper_do_sniff_arg_validate, scamper_do_sniff_usage}, }; int i; long lo_w = window, lo_p = pps; char opts[64]; char *opt_cycleid = NULL, *opt_listid = NULL, *opt_listname = NULL; char *opt_ctrl_inet = NULL, *opt_ctrl_unix = NULL, *opt_monitorname = NULL; char *opt_pps = NULL, *opt_command = NULL, *opt_window = NULL; char *opt_firewall = NULL, *opt_pidfile = NULL, *opt_ctrl_remote = NULL; #ifndef WITHOUT_DEBUGFILE char *opt_debugfile = NULL; #endif size_t argv0 = strlen(argv[0]); size_t m, len; size_t off; uint32_t o; for(m=0; m= len && strcmp(argv[0]+argv0-len, multicall[m].argv0) == 0) { return multicall_do(&multicall[m], argc, argv); } } off = 0; string_concat(opts, sizeof(opts), &off, "c:C:e:fF:iIl:L:M:o:O:p:P:R:vw:?"); #ifndef WITHOUT_DEBUGFILE string_concat(opts, sizeof(opts), &off, "d:"); #endif #if HAVE_DAEMON string_concat(opts, sizeof(opts), &off, "D"); #endif #if defined(AF_UNIX) string_concat(opts, sizeof(opts), &off, "U:"); #endif while((i = getopt(argc, argv, opts)) != -1) { switch(i) { case 'c': options |= OPT_COMMAND; opt_command = optarg; break; case 'C': options |= OPT_CYCLEID; opt_cycleid = optarg; break; #ifndef WITHOUT_DEBUGFILE case 'd': options |= OPT_DEBUGFILE; opt_debugfile = optarg; break; #endif #ifdef HAVE_DAEMON case 'D': options |= OPT_DAEMON; break; #endif case 'e': options |= OPT_PIDFILE; opt_pidfile = optarg; break; case 'f': options |= OPT_INFILE; break; case 'F': options |= OPT_FIREWALL; opt_firewall = optarg; break; case 'i': options |= OPT_IP; break; case 'I': options |= OPT_CMDLIST; break; case 'l': options |= OPT_LISTNAME; opt_listname = optarg; break; case 'L': options |= OPT_LISTID; opt_listid = optarg; break; case 'M': options |= OPT_MONITORNAME; opt_monitorname = optarg; break; case 'o': options |= OPT_OUTFILE; outfile = optarg; break; case 'O': if(strcasecmp(optarg, "text") == 0) outtype = optarg; else if(strcasecmp(optarg, "warts") == 0) outtype = optarg; else if(strcasecmp(optarg, "json") == 0) outtype = optarg; else if(strcasecmp(optarg, "tsps") == 0) intype = optarg; else if(strcasecmp(optarg, "cmdfile") == 0) intype = optarg; else if(strcasecmp(optarg, "planetlab") == 0) flags |= FLAG_PLANETLAB; else if(strcasecmp(optarg, "noinitndc") == 0) flags |= FLAG_NOINITNDC; else if(strcasecmp(optarg, "outcopy") == 0) flags |= FLAG_OUTCOPY; else if(strcasecmp(optarg, "rawtcp") == 0) flags |= FLAG_RAWTCP; #ifdef HAVE_OPENSSL else if(strcasecmp(optarg, "tls") == 0) flags |= FLAG_TLS; else if(strcasecmp(optarg, "notls") == 0) flags |= FLAG_NOTLS; #endif #ifndef _WIN32 else if(strcasecmp(optarg, "select") == 0) flags |= FLAG_SELECT; #endif #ifdef HAVE_KQUEUE else if(strcasecmp(optarg, "kqueue") == 0) flags |= FLAG_KQUEUE; #endif #ifdef HAVE_EPOLL else if(strcasecmp(optarg, "epoll") == 0) flags |= FLAG_EPOLL; #endif #ifndef WITHOUT_DEBUGFILE else if(strcasecmp(optarg, "debugfileappend") == 0) flags |= FLAG_DEBUGFILEAPPEND; #endif else { usage(OPT_OPTION); return -1; } break; case 'p': options |= OPT_PPS; opt_pps = optarg; break; case 'P': options |= OPT_CTRL_INET; opt_ctrl_inet = optarg; break; case 'R': options |= OPT_CTRL_REMOTE; opt_ctrl_remote = optarg; break; case 'U': options |= OPT_CTRL_UNIX; opt_ctrl_unix = optarg; break; case 'v': options |= OPT_VERSION; break; case 'w': options |= OPT_WINDOW; opt_window = optarg; break; case '?': options |= OPT_HELP; usage(0xffffffff); return -1; default: printerror(__func__, "could not parse command line options"); return -1; } } if(options & OPT_VERSION) { version(); return -1; } /* * if one of -IPRUi is not provided, pretend that -f was for backward * compatibility */ if((options & (OPT_CMDLIST | OPT_CTRL_INET | OPT_CTRL_REMOTE | OPT_CTRL_UNIX | OPT_IP)) == 0) { options |= OPT_INFILE; } if(options & (OPT_PPS|OPT_WINDOW)) { if(opt_window != NULL && string_tolong(opt_window, &lo_w) != 0) { usage(OPT_WINDOW); return -1; } if(opt_pps != NULL && string_tolong(opt_pps, &lo_p) != 0) { usage(OPT_PPS); return -1; } if(ppswindow_set(lo_p, lo_w) != 0) { usage(OPT_PPS|OPT_WINDOW); return -1; } } if(options & OPT_FIREWALL && (firewall = strdup(opt_firewall)) == NULL) { printerror(__func__, "could not strdup firewall"); return -1; } if(options & OPT_MONITORNAME && (monitorname = strdup(opt_monitorname)) == NULL) { printerror(__func__, "could not strdup monitorname"); return -1; } if(options & OPT_LISTNAME && (listname = strdup(opt_listname)) == NULL) { printerror(__func__, "could not strdup listname"); return -1; } if(options & OPT_LISTID && set_opt(OPT_LISTID, opt_listid, listid_set) != 0) { usage(OPT_LISTID); return -1; } if(options & OPT_CYCLEID && set_opt(OPT_CYCLEID, opt_cycleid, cycleid_set) != 0) { usage(OPT_CYCLEID); return -1; } #ifndef WITHOUT_DEBUGFILE if(options & OPT_DEBUGFILE && (debugfile = strdup(opt_debugfile)) == NULL) { printerror(__func__, "could not strdup debugfile"); return -1; } #endif if(options & OPT_PIDFILE && (pidfile = strdup(opt_pidfile)) == NULL) { printerror(__func__, "could not strdup pidfile"); return -1; } /* make sure incompatible flags were not specified */ if((flags & (FLAG_TLS|FLAG_NOTLS)) == (FLAG_TLS|FLAG_NOTLS)) { usage(OPT_OPTION); return -1; } /* these are the left-over arguments */ arglist = argv + optind; arglist_len = argc - optind; /* if one of -PUi is used, then a default command must be set */ if((options & (OPT_CTRL_INET | OPT_CTRL_UNIX | OPT_IP | OPT_INFILE)) != 0 && scamper_command_set((options & OPT_COMMAND) ? opt_command : SCAMPER_COMMAND_DEF) != 0) { return -1; } #ifdef HAVE_DAEMON if((options & OPT_DAEMON) && (options & (OPT_CTRL_INET|OPT_CTRL_UNIX|OPT_CTRL_REMOTE)) == 0) { usage(OPT_DAEMON | OPT_CTRL_INET | OPT_CTRL_UNIX | OPT_CTRL_REMOTE); return -1; } #endif o = options & (OPT_CTRL_INET | OPT_CTRL_UNIX | OPT_CTRL_REMOTE | OPT_IP | OPT_CMDLIST | OPT_INFILE); if(options & (OPT_CTRL_INET|OPT_CTRL_REMOTE|OPT_CTRL_UNIX)) { if(options & (OPT_IP | OPT_CMDLIST | OPT_INFILE)) { usage(o); return -1; } if(options & OPT_CTRL_INET) { /* if listening on control socket there should be no leftover args */ if(arglist_len != 0 || string_addrport(opt_ctrl_inet, &ctrl_inet_addr, &ctrl_inet_port) != 0) { usage(OPT_CTRL_INET); return -1; } } if(options & OPT_CTRL_REMOTE) { /* * if using a remote control socket, there should be no * leftover args */ if(arglist_len != 0 || string_addrport(opt_ctrl_remote, &ctrl_rem_name, &ctrl_rem_port) != 0) { scamper_debug(__func__, "hello %s %d", opt_ctrl_remote, arglist_len); usage(OPT_CTRL_REMOTE); return -1; } } if(options & OPT_CTRL_UNIX) { /* if listening on control socket there should be no leftover args */ if(arglist_len != 0) { usage(OPT_CTRL_UNIX); return -1; } ctrl_unix = opt_ctrl_unix; } } else if(options & (OPT_IP | OPT_CMDLIST)) { /* only one of the following should be specified */ if((options & (OPT_CTRL_INET|OPT_CTRL_REMOTE|OPT_CTRL_UNIX|OPT_INFILE)) || ((options & OPT_IP) && (options & OPT_CMDLIST))) { usage(o); return -1; } /* * if a list of IP addresses or commands is to be supplied, there has to * be at least one left over argument. */ if(arglist_len < 1) { if(options & OPT_IP) usage(OPT_IP); else if(options & OPT_CMDLIST) usage(OPT_CMDLIST); return -1; } } else { /* * if a listfile is specified, then there may only be one left over * argument, which specifies the listfile. */ assert(o == OPT_INFILE); if(arglist_len != 1) { usage(0); return -1; } } return 0; } const char *scamper_command_get(void) { assert(command != NULL); return command; } int scamper_command_set(const char *command_in) { char *d; if(command_in == NULL) { return -1; } if((d = strdup(command_in)) == NULL) { printerror(__func__, "could not strdup command"); return -1; } if(command != NULL) free(command); command = d; return 0; } void scamper_exitwhendone(int on) { if(on == 1 || on == 0) { exit_when_done = on; } return; } int scamper_pps_get() { return pps; } int scamper_pps_set(const int p) { return ppswindow_set(p, window); } int scamper_window_get() { return window; } int scamper_window_set(const int w) { return ppswindow_set(pps, w); } const char *scamper_monitorname_get() { return monitorname; } int scamper_monitorname_set(const char *mn) { char *tmp; /* * before removing the old monitor name, get a copy of the monitor name * since that's what we'll be using to store afterward */ if(mn != NULL) { if((tmp = strdup(mn)) == NULL) { return -1; } } else { tmp = NULL; } if(monitorname != NULL) { free(monitorname); } monitorname = tmp; return 0; } int scamper_option_planetlab(void) { if(flags & FLAG_PLANETLAB) return 1; return 0; } int scamper_option_select(void) { if(flags & FLAG_SELECT) return 1; return 0; } int scamper_option_kqueue(void) { if(flags & FLAG_KQUEUE) return 1; return 0; } int scamper_option_epoll(void) { if(flags & FLAG_EPOLL) return 1; return 0; } int scamper_option_noinitndc(void) { if(flags & FLAG_NOINITNDC) return 1; return 0; } int scamper_option_rawtcp(void) { if(flags & FLAG_RAWTCP) return 1; return 0; } int scamper_option_debugfileappend(void) { if(flags & FLAG_DEBUGFILEAPPEND) return 1; return 0; } int scamper_option_tls(void) { if(flags & FLAG_TLS) return 1; return 0; } int scamper_option_notls(void) { if(flags & FLAG_NOTLS) return 1; return 0; } int scamper_option_daemon(void) { if(options & OPT_DAEMON) return 1; return 0; } static int scamper_pidfile(void) { char buf[32]; mode_t mode; size_t len; int fd, flags = O_WRONLY | O_TRUNC | O_CREAT; #ifndef _WIN32 pid_t pid = getpid(); mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; #else DWORD pid = GetCurrentProcessId(); mode = _S_IREAD | _S_IWRITE; #endif #if defined(WITHOUT_PRIVSEP) fd = open(pidfile, flags, mode); #else fd = scamper_privsep_open_file(pidfile, flags, mode); #endif if(fd == -1) { printerror(__func__, "could not open %s", pidfile); goto err; } snprintf(buf, sizeof(buf), "%ld\n", (long)pid); len = strlen(buf); if(write_wrap(fd, buf, NULL, len) != 0) { printerror(__func__, "could not write pid"); goto err; } close(fd); return 0; err: if(fd != -1) close(fd); return -1; } #ifndef _WIN32 static void scamper_chld(int sig) { int status; if(sig != SIGCHLD) return; for(;;) { if(waitpid(-1, &status, WNOHANG) == -1) { break; } } return; } #endif static void scamper_sport_init(void) { #ifndef _WIN32 pid_t pid = getpid(); #else DWORD pid = GetCurrentProcessId(); #endif default_sport = (pid & 0x7fff) + 0x8000; return; } uint16_t scamper_sport_default(void) { return default_sport; } /* * scamper_timeout * * figure out how long the timeout on the poll (or equivalent) should be. * * returns: * zero if there is a timeout value computed * one if there is no timeout value computed * two if scamper should exit because it is done. */ static int scamper_timeout(struct timeval *timeout, struct timeval *nextprobe, struct timeval *lastprobe) { struct timeval tv; int probe = 0; if(scamper_queue_readycount() > 0 || ((window == 0 || scamper_queue_windowcount() < window) && scamper_sources_isready() != 0)) { /* * if there is something ready to be probed right now, then set the * timeout to go off when it is time to send the next probe */ timeval_add_us(nextprobe, lastprobe, wait_between); probe = 1; } else if(scamper_queue_count() > 0) { /* * if there isn't anything ready to go right now, but we are * waiting on a response from an earlier probe, then set the timer * to go off when that probe expires. */ scamper_queue_waittime(nextprobe); probe = 1; } else { if(exit_when_done != 0 && scamper_sources_isempty() == 1) return 2; } /* * if there are no events to consider, then we only need to consider * if there are events in the future */ if(scamper_queue_event_waittime(&tv) == 0) { if(probe == 0) return 1; timeval_cpy(timeout, nextprobe); return 0; } /* * there is an event and (maybe) a probe timeout to consider. * figure out which comes first: the event or the probe */ if(probe != 0 && timeval_cmp(nextprobe, &tv) <= 0) timeval_cpy(timeout, nextprobe); else timeval_cpy(timeout, &tv); return 0; } /* * scamper: * * this bit of code contains most of the logic for driving the parallel * measurement processes. */ static int scamper(int argc, char *argv[]) { struct timeval tv; struct timeval lastprobe; struct timeval nextprobe; struct timeval timeout, *timeout_ptr; const char *sofname; scamper_source_params_t ssp; scamper_source_t *source = NULL; scamper_task_t *task; scamper_outfile_t *sof, *sof2; scamper_file_t *file; int rc; if(check_options(argc, argv) == -1) { return -1; } #ifdef HAVE_DAEMON if((options & OPT_DAEMON) != 0 && daemon(1, 0) != 0) { printerror(__func__, "could not daemon"); return -1; } #endif scamper_debug_init(); /* * now that we've forked for privsep and again for daemon, write the * pidfile. */ if((options & OPT_PIDFILE) != 0 && scamper_pidfile() != 0) return -1; if(scamper_osinfo_init() != 0) return -1; /* * this has to be done before priviledge separation, as if scamper is * running on a BPF system it has to open a BPF fd to establish * version compatibility */ if(scamper_dl_init() == -1) { return -1; } #ifdef HAVE_OPENSSL if((flags & FLAG_NOTLS) == 0) SSL_library_init(); #endif #ifndef WITHOUT_PRIVSEP /* revoke the root priviledges we started with */ if(scamper_privsep_init() == -1) { return -1; } #endif random_seed(); if(firewall != NULL) { if(scamper_firewall_init(firewall) != 0) return -1; free(firewall); firewall = NULL; } #ifndef WITHOUT_DEBUGFILE /* * open the debug file immediately so initialisation debugging information * makes it to the file */ if(debugfile != NULL && scamper_debug_open(debugfile) != 0) { return -1; } #endif /* determine a suitable default value for the source port in packets */ scamper_sport_init(); /* allocate the cache of addresses for scamper to keep track of */ if((addrcache = scamper_addrcache_alloc()) == NULL) { return -1; } /* init the probing code */ if(scamper_probe_init() != 0) return -1; /* initialise the queues that hold the current tasks */ if(scamper_queue_init() == -1) return -1; /* setup the file descriptor monitoring code */ if(scamper_fds_init() == -1) { return -1; } if(options & (OPT_CTRL_INET|OPT_CTRL_UNIX|OPT_CTRL_REMOTE)) { if(scamper_control_init() != 0) return -1; if(options & OPT_CTRL_INET && scamper_control_add_inet(ctrl_inet_addr, ctrl_inet_port) != 0) return -1; if(options & OPT_CTRL_UNIX && scamper_control_add_unix(ctrl_unix) != 0) return -1; if(options & OPT_CTRL_REMOTE && scamper_control_add_remote(ctrl_rem_name, ctrl_rem_port) != 0) return -1; /* wait for more tasks when finished with the active window */ exit_when_done = 0; } /* initialise the subsystem responsible for obtaining source addresses */ if(scamper_getsrc_init() == -1) { return -1; } /* initialise the subsystem responsible for recording mac addresses */ if(scamper_addr2mac_init() == -1) { return -1; } if(scamper_rtsock_init() == -1) { return -1; } /* initialise the structures necessary to keep track of addresses to probe */ if(scamper_sources_init() == -1) { return -1; } /* * initialise the data structures necessary to keep track of the signatures * of tasks currently being probed */ if(scamper_task_init() == -1) { return -1; } /* * initialise the data structures necessary to keep track of output files * currently being written to */ if(scamper_outfiles_init(outfile, outtype) == -1) { return -1; } /* initialise scamper so it is ready to traceroute and ping */ if(scamper_do_trace_init() != 0 || scamper_do_ping_init() != 0 || scamper_do_tracelb_init() != 0 || scamper_do_dealias_init() != 0 || scamper_do_sting_init() != 0 || scamper_do_neighbourdisc_init() != 0 || scamper_do_tbit_init() != 0 || scamper_do_sniff_init() != 0) { return -1; } /* parameters for the default list */ memset(&ssp, 0, sizeof(ssp)); ssp.name = "default"; ssp.descr = "default"; ssp.priority = 1; ssp.sof = scamper_outfiles_get(NULL); if(options & OPT_LISTNAME) ssp.name = listname; if(options & OPT_LISTID) ssp.list_id = listid; if(options & OPT_CYCLEID) ssp.cycle_id = cycleid; /* * if we have an address list of some description on the command line, * read the addresses now */ if(options & (OPT_IP|OPT_CMDLIST)) { if((source = scamper_source_cmdline_alloc(&ssp, command, arglist, arglist_len)) == NULL) { return -1; } } else if((options & (OPT_CTRL_INET|OPT_CTRL_UNIX|OPT_CTRL_REMOTE)) == 0) { if(intype == NULL) source = scamper_source_file_alloc(&ssp, arglist[0], command, 1, 0); else if(strcasecmp(intype, "tsps") == 0) source = scamper_source_tsps_alloc(&ssp, arglist[0]); else if(strcasecmp(intype, "cmdfile") == 0) source = scamper_source_file_alloc(&ssp, arglist[0], NULL, 1, 0); if(source == NULL) return -1; } if(source != NULL) { scamper_sources_add(source); scamper_source_free(source); } gettimeofday_wrap(&lastprobe); for(;;) { if((rc = scamper_timeout(&timeout, &nextprobe, &lastprobe)) == 0) { /* * we've been told to calculate a timeout value. figure out what * it should be. */ gettimeofday_wrap(&tv); if(timeval_cmp(&timeout, &tv) <= 0) memset(&tv, 0, sizeof(tv)); else timeval_diff_tv(&tv, &tv, &timeout); timeout_ptr = &tv; } else if(rc == 1) { timeout_ptr = NULL; } else { /* exit when done */ break; } /* listen until it is time to send the next probe */ if(scamper_fds_poll(timeout_ptr) == -1) return -1; /* get the current time */ gettimeofday_wrap(&tv); if(scamper_queue_event_proc(&tv) != 0) return -1; /* take any 'done' tasks and output them now */ while((task = scamper_queue_getdone(&tv)) != NULL) { /* write the data out */ if((source = scamper_task_getsource(task)) != NULL && (sofname = scamper_source_getoutfile(source)) != NULL && (sof = scamper_outfiles_get(sofname)) != NULL) { file = scamper_outfile_getfile(sof); scamper_task_write(task, file); /* * write a copy of the data out if asked to, and it has not * already been written to this output file. */ if((flags & FLAG_OUTCOPY) != 0 && (sof2 = scamper_outfiles_get(NULL)) != NULL && sof != sof2) { file = scamper_outfile_getfile(sof2); scamper_task_write(task, file); } } /* cleanup the task */ scamper_task_free(task); } /* * if there is something waiting to be probed, then find out if it is * time to probe yet */ if(scamper_queue_readycount() > 0 || scamper_sources_isready() == 1) { /* * check for large differences between the time the last probe * was sent and the current time. don't allow the difference to * be larger than a particular amount, since that could result in * either a large flutter of probes to be sent, or a large time * before the next probe is sent */ if(timeval_inrange_us(&tv, &lastprobe, probe_window) == 0) timeval_sub_us(&lastprobe, &tv, wait_between); /* * when probing at > HZ, scamper might find that select blocks it * from achieving the specified packets per second rate if it sends * one probe per select. Based on the time spent in the last call * to select, send the necessary number of packets to fill that * window where we sent no packets. */ for(;;) { timeval_add_us(&nextprobe, &lastprobe, wait_between); /* if the next probe is not due to be sent, don't send one */ if(timeval_cmp(&nextprobe, &tv) > 0) break; /* * look for an address that we can send a probe to. if * scamper doesn't have a task on the probe queue waiting * to be probed, then get a fresh task. if there's absolutely * nothing that scamper can probe, then break. */ if((task = scamper_queue_select()) == NULL) { /* * if we are already probing to the window limit, don't * add any new tasks */ if(window != 0 && scamper_queue_windowcount() >= window) break; /* * if there are no more tasks ready to be added yet, there's * nothing more to be done in the loop */ if(scamper_sources_gettask(&task) != 0 || task == NULL) break; } scamper_task_probe(task); timeval_cpy(&lastprobe, &nextprobe); } } } return 0; } /* * cleanup: * * be nice to the system and clean up all our mallocs */ static void cleanup(void) { scamper_firewall_cleanup(); scamper_getsrc_cleanup(); scamper_rtsock_cleanup(); scamper_icmp4_cleanup(); scamper_icmp6_cleanup(); scamper_udp4_cleanup(); scamper_tcp4_cleanup(); scamper_addr2mac_cleanup(); scamper_do_trace_cleanup(); scamper_do_ping_cleanup(); scamper_do_tracelb_cleanup(); scamper_do_dealias_cleanup(); scamper_do_sting_cleanup(); scamper_do_neighbourdisc_cleanup(); scamper_do_tbit_cleanup(); scamper_do_sniff_cleanup(); scamper_dl_cleanup(); if(options & (OPT_CTRL_INET|OPT_CTRL_UNIX|OPT_CTRL_REMOTE)) scamper_control_cleanup(); scamper_sources_cleanup(); scamper_outfiles_cleanup(); scamper_fds_cleanup(); #ifndef WITHOUT_PRIVSEP scamper_privsep_cleanup(); #endif /* free the address cache, if one was used */ if(addrcache != NULL) { scamper_addrcache_free(addrcache); addrcache = NULL; } if(ctrl_inet_addr != NULL) { free(ctrl_inet_addr); ctrl_inet_addr = NULL; } if(ctrl_rem_name != NULL) { free(ctrl_rem_name); ctrl_rem_name = NULL; } if(monitorname != NULL) { free(monitorname); monitorname = NULL; } if(firewall != NULL) { free(firewall); firewall = NULL; } if(command != NULL) { free(command); command = NULL; } scamper_queue_cleanup(); scamper_task_cleanup(); scamper_probe_cleanup(); #ifndef WITHOUT_DEBUGFILE if(options & OPT_DEBUGFILE) scamper_debug_close(); #endif scamper_osinfo_cleanup(); #ifndef WITHOUT_DEBUGFILE if(debugfile != NULL) { free(debugfile); debugfile = NULL; } #endif if(pidfile != NULL) { free(pidfile); pidfile = NULL; } return; } int main(int argc, char *argv[]) { int i; #ifndef _WIN32 struct sigaction si_sa; #endif #ifdef _WIN32 WSADATA wsaData; #endif /* * if we are using dmalloc, then we want to get it to register its * logdump function to occur after we have used cleanup to free up * scamper's core data structures. this is a dirty hack. * * if we are running a debug build on freebsd, make poor malloc use more * prone to causing scamper to crash. */ #if defined(DMALLOC) free(malloc(1)); #elif !defined (NDEBUG) && defined(__FreeBSD__) && __FreeBSD_version >= 500014 && __FreeBSD_version < 1000011 _malloc_options = "AJ"; #endif #ifdef _WIN32 WSAStartup(MAKEWORD(2,2), &wsaData); timeBeginPeriod(1); #endif #ifndef _WIN32 if(signal(SIGPIPE, SIG_IGN) == SIG_ERR) { printerror(__func__, "could not ignore SIGPIPE"); return -1; } sigemptyset(&si_sa.sa_mask); si_sa.sa_flags = 0; si_sa.sa_handler = scamper_chld; if(sigaction(SIGCHLD, &si_sa, 0) == -1) { printerror(__func__, "could not set sigaction for SIGCHLD"); return -1; } #endif i = scamper(argc, argv); cleanup(); #ifdef _WIN32 timeEndPeriod(1); WSACleanup(); #endif return i; } scamper-cvs-20171204/scamper/scamper.h000644 001751 000000 00000003676 13211177642 017370 0ustar00mjlwheel000000 000000 /* * scamper.h * * $Id: scamper.h,v 1.59.2.1 2017/12/04 07:56:18 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2015 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_H #define __SCAMPER_H #define SCAMPER_PPS_MIN 1 #define SCAMPER_PPS_DEF 20 #define SCAMPER_PPS_MAX 10000 int scamper_pps_get(void); int scamper_pps_set(const int pps); #define SCAMPER_WINDOW_MIN 0 #define SCAMPER_WINDOW_DEF 0 #define SCAMPER_WINDOW_MAX 65535 int scamper_window_get(void); int scamper_window_set(const int window); #define SCAMPER_COMMAND_DEF "trace" const char *scamper_command_get(void); int scamper_command_set(const char *command); const char *scamper_monitorname_get(void); int scamper_monitorname_set(const char *monitorname); int scamper_option_planetlab(void); int scamper_option_noinitndc(void); int scamper_option_notls(void); int scamper_option_select(void); int scamper_option_kqueue(void); int scamper_option_epoll(void); int scamper_option_rawtcp(void); int scamper_option_debugfileappend(void); int scamper_option_tls(void); int scamper_option_daemon(void); void scamper_exitwhendone(int on); uint16_t scamper_sport_default(void); #define SCAMPER_VERSION "20171204" #endif /* __SCAMPER_H */ scamper-cvs-20171204/scamper/scamper_addr.c000644 001751 000000 00000071247 13210745002 020342 0ustar00mjlwheel000000 000000 /* * scamper_addr.c * * $Id: scamper_addr.c,v 1.68 2017/12/03 09:55:14 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2013-2014 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_addr.c,v 1.68 2017/12/03 09:55:14 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "mjl_patricia.h" #include "scamper_addr.h" #include "utils.h" /* * convenient table for masking off portions of addresses for checking * if an address falls in a prefix */ static const uint32_t uint32_netmask[] = { 0x80000000, 0xc0000000, 0xe0000000, 0xf0000000, 0xf8000000, 0xfc000000, 0xfe000000, 0xff000000, 0xff800000, 0xffc00000, 0xffe00000, 0xfff00000, 0xfff80000, 0xfffc0000, 0xfffe0000, 0xffff0000, 0xffff8000, 0xffffc000, 0xffffe000, 0xfffff000, 0xfffff800, 0xfffffc00, 0xfffffe00, 0xffffff00, 0xffffff80, 0xffffffc0, 0xffffffe0, 0xfffffff0, 0xfffffff8, 0xfffffffc, 0xfffffffe, 0xffffffff, }; static const uint32_t uint32_hostmask[] = { 0xffffffff, 0x7fffffff, 0x3fffffff, 0x1fffffff, 0x0fffffff, 0x07ffffff, 0x03ffffff, 0x01ffffff, 0x00ffffff, 0x007fffff, 0x003fffff, 0x001fffff, 0x000fffff, 0x0007ffff, 0x0003ffff, 0x0001ffff, 0x0000ffff, 0x00007fff, 0x00003fff, 0x00001fff, 0x00000fff, 0x000007ff, 0x000003ff, 0x000001ff, 0x000000ff, 0x0000007f, 0x0000003f, 0x0000001f, 0x0000000f, 0x00000007, 0x00000003, 0x00000001, }; #ifdef _WIN32 static const uint16_t uint16_mask[] = { 0x8000, 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, 0xffc0, 0xffe0, 0xfff0, 0xfff8, 0xfffc, 0xfffe, 0xffff, }; #endif static int ipv4_cmp(const scamper_addr_t *, const scamper_addr_t *); static int ipv4_human_cmp(const scamper_addr_t *, const scamper_addr_t *); static int ipv6_cmp(const scamper_addr_t *, const scamper_addr_t *); static int ipv6_human_cmp(const scamper_addr_t *, const scamper_addr_t *); static int ethernet_cmp(const scamper_addr_t *, const scamper_addr_t *); static int firewire_cmp(const scamper_addr_t *, const scamper_addr_t *); static void ipv4_tostr(const scamper_addr_t *, char *, const size_t); static void ipv6_tostr(const scamper_addr_t *, char *, const size_t); static void ethernet_tostr(const scamper_addr_t *, char *, const size_t); static void firewire_tostr(const scamper_addr_t *, char *, const size_t); static int ipv4_inprefix(const scamper_addr_t *, const void *, int len); static int ipv6_inprefix(const scamper_addr_t *, const void *, int len); static int ipv4_prefix(const scamper_addr_t *, const scamper_addr_t *); static int ipv4_prefixhosts(const scamper_addr_t *, const scamper_addr_t *); static int ipv6_prefix(const scamper_addr_t *, const scamper_addr_t *); static int ipv4_bit(const scamper_addr_t *, int bit); static int ipv6_bit(const scamper_addr_t *, int bit); static int ethernet_bit(const scamper_addr_t *, int bit); static int firewire_bit(const scamper_addr_t *, int bit); static int ipv4_fbd(const scamper_addr_t *, const scamper_addr_t *); static int ipv6_fbd(const scamper_addr_t *, const scamper_addr_t *); static int ethernet_fbd(const scamper_addr_t *, const scamper_addr_t *); static int firewire_fbd(const scamper_addr_t *, const scamper_addr_t *); static int ipv4_islinklocal(const scamper_addr_t *); static int ipv6_islinklocal(const scamper_addr_t *); static int ipv4_netaddr(const scamper_addr_t *, void *, int); static int ipv6_netaddr(const scamper_addr_t *, void *, int); static int ipv4_isreserved(const scamper_addr_t *); static int ipv6_isreserved(const scamper_addr_t *); static int ipv6_isunicast(const scamper_addr_t *); struct handler { int type; size_t size; int (*cmp)(const scamper_addr_t *sa, const scamper_addr_t *sb); int (*human_cmp)(const scamper_addr_t *sa, const scamper_addr_t *sb); void (*tostr)(const scamper_addr_t *addr, char *buf, const size_t len); int (*inprefix)(const scamper_addr_t *addr, const void *prefix, int len); int (*prefix)(const scamper_addr_t *a, const scamper_addr_t *b); int (*prefixhosts)(const scamper_addr_t *a, const scamper_addr_t *b); int (*islinklocal)(const scamper_addr_t *a); int (*netaddr)(const scamper_addr_t *a, void *net, int netlen); int (*isunicast)(const scamper_addr_t *a); int (*isreserved)(const scamper_addr_t *a); int (*bit)(const scamper_addr_t *a, int bit); int (*fbd)(const scamper_addr_t *a, const scamper_addr_t *b); }; static const struct handler handlers[] = { { SCAMPER_ADDR_TYPE_IPV4, 4, ipv4_cmp, ipv4_human_cmp, ipv4_tostr, ipv4_inprefix, ipv4_prefix, ipv4_prefixhosts, ipv4_islinklocal, ipv4_netaddr, NULL, ipv4_isreserved, ipv4_bit, ipv4_fbd, }, { SCAMPER_ADDR_TYPE_IPV6, 16, ipv6_cmp, ipv6_human_cmp, ipv6_tostr, ipv6_inprefix, ipv6_prefix, NULL, ipv6_islinklocal, ipv6_netaddr, ipv6_isunicast, ipv6_isreserved, ipv6_bit, ipv6_fbd, }, { SCAMPER_ADDR_TYPE_ETHERNET, 6, ethernet_cmp, ethernet_cmp, ethernet_tostr, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ethernet_bit, ethernet_fbd, }, { SCAMPER_ADDR_TYPE_FIREWIRE, 8, firewire_cmp, firewire_cmp, firewire_tostr, NULL, NULL, NULL, NULL, NULL, NULL, NULL, firewire_bit, firewire_fbd, } }; struct scamper_addrcache { patricia_t *trie[sizeof(handlers)/sizeof(struct handler)]; }; static int ipv4_cmp(const scamper_addr_t *sa, const scamper_addr_t *sb) { struct in_addr *a, *b; assert(sa->type == SCAMPER_ADDR_TYPE_IPV4); assert(sb->type == SCAMPER_ADDR_TYPE_IPV4); a = (struct in_addr *)sa->addr; b = (struct in_addr *)sb->addr; if(a->s_addr < b->s_addr) return -1; if(a->s_addr > b->s_addr) return 1; return 0; } static int ipv4_human_cmp(const scamper_addr_t *sa, const scamper_addr_t *sb) { uint32_t a, b; assert(sa->type == SCAMPER_ADDR_TYPE_IPV4); assert(sb->type == SCAMPER_ADDR_TYPE_IPV4); a = ntohl(((struct in_addr *)sa->addr)->s_addr); b = ntohl(((struct in_addr *)sb->addr)->s_addr); if(a < b) return -1; if(a > b) return 1; return 0; } static void ipv4_tostr(const scamper_addr_t *addr, char *buf, const size_t len) { addr_tostr(AF_INET, addr->addr, buf, len); return; } static int ipv4_inprefix(const scamper_addr_t *sa, const void *p, int len) { const struct in_addr *addr = sa->addr; const struct in_addr *prefix = p; if(len == 0) return 1; if(len > 32) return -1; if(((addr->s_addr ^ prefix->s_addr) & htonl(uint32_netmask[len-1])) == 0) return 1; return 0; } static int ipv4_prefix(const scamper_addr_t *sa, const scamper_addr_t *sb) { const struct in_addr *a = sa->addr; const struct in_addr *b = sb->addr; int i; for(i=32; i>0; i--) { if(((a->s_addr ^ b->s_addr) & htonl(uint32_netmask[i-1])) == 0) break; } return i; } static int ipv4_prefixhosts(const scamper_addr_t *sa, const scamper_addr_t *sb) { const struct in_addr *a = sa->addr; const struct in_addr *b = sb->addr; struct in_addr c; int i; for(i=32; i>0; i--) { if(((a->s_addr ^ b->s_addr) & htonl(uint32_netmask[i-1])) == 0) break; } if(i >= 31) return i; while(i>0) { c.s_addr = ntohl(a->s_addr) & uint32_hostmask[i]; if(c.s_addr == 0 || c.s_addr == uint32_hostmask[i]) { i--; continue; } c.s_addr = ntohl(b->s_addr) & uint32_hostmask[i]; if(c.s_addr == 0 || c.s_addr == uint32_hostmask[i]) { i--; continue; } break; } return i; } /* * ipv4_islinklocal * * an IPv4 address is a link local address if it is in 169.254.0.0/16 */ static int ipv4_islinklocal(const scamper_addr_t *sa) { const struct in_addr *a = sa->addr; if((ntohl(a->s_addr) & 0xffff0000) == 0xa9fe0000) return 1; return 0; } static int ipv4_netaddr(const scamper_addr_t *sa, void *net, int netlen) { const struct in_addr *a = sa->addr; struct in_addr p; if(netlen <= 0 || netlen > 32 || sa == NULL || net == NULL) return -1; p.s_addr = htonl(ntohl(a->s_addr) & uint32_netmask[netlen-1]); memcpy(net, &p, sizeof(p)); return 0; } static int ipv4_isreserved(const scamper_addr_t *a) { static const uint32_t prefs[][2] = { {0x00000000, 0xff000000}, /* 0.0.0.0/8 */ {0x0a000000, 0xff000000}, /* 10.0.0.0/8 */ {0x64400000, 0xffc00000}, /* 100.64.0.0/10 */ {0x7f000000, 0xff000000}, /* 127.0.0.0/8 */ {0xa9fe0000, 0xffff0000}, /* 169.254.0.0/16 */ {0xac100000, 0xfff00000}, /* 172.16.0.0/12 */ {0xc0000000, 0xffffff00}, /* 192.0.0.0/24 */ {0xc0000200, 0xffffff00}, /* 192.0.2.0/24 */ {0xc0586300, 0xffffff00}, /* 192.88.99.0/24 */ {0xc0a80000, 0xffff0000}, /* 192.168.0.0/16 */ {0xc6120000, 0xfffe0000}, /* 198.18.0.0/15 */ {0xc6336400, 0xffffff00}, /* 198.51.100.0/24 */ {0xcb007100, 0xffffff00}, /* 203.0.113.0/24 */ {0xe0000000, 0xf0000000}, /* 224.0.0.0/4 */ {0xf0000000, 0xf0000000}, /* 240.0.0.0/4 */ }; static const int prefc = 15; uint32_t addr = ntohl(((const struct in_addr *)a->addr)->s_addr); int i; for(i=0; iaddr; assert(bit > 0); assert(bit <= 32); return (ntohl(a->s_addr) >> (32 - bit)) & 1; } /* * ipv4_fbd: * * determine the first bit that is different between two IPv4 addresses. * bit 32 is the right most bit */ static int ipv4_fbd(const scamper_addr_t *sa, const scamper_addr_t *sb) { const struct in_addr *a, *b; uint32_t v, r; assert(sa->type == SCAMPER_ADDR_TYPE_IPV4); assert(sb->type == SCAMPER_ADDR_TYPE_IPV4); a = (const struct in_addr *)sa->addr; b = (const struct in_addr *)sb->addr; v = ntohl(a->s_addr ^ b->s_addr); #ifdef HAVE___BUILTIN_CLZ if(v != 0) r = __builtin_clz(v) + 1; else r = 32; #else r = 0; if(v & 0xFFFF0000) { v >>= 16; r += 16; } if(v & 0xFF00) { v >>= 8; r += 8; } if(v & 0xF0) { v >>= 4; r += 4; } if(v & 0xC) { v >>= 2; r += 2; } if(v & 0x2) { r += 1; } r = 32 - r; #endif return r; } static int ipv6_cmp(const scamper_addr_t *sa, const scamper_addr_t *sb) { struct in6_addr *a, *b; int i; assert(sa->type == SCAMPER_ADDR_TYPE_IPV6); assert(sb->type == SCAMPER_ADDR_TYPE_IPV6); a = (struct in6_addr *)sa->addr; b = (struct in6_addr *)sb->addr; #ifndef _WIN32 for(i=0; i<4; i++) { if(a->s6_addr32[i] < b->s6_addr32[i]) return -1; if(a->s6_addr32[i] > b->s6_addr32[i]) return 1; } #else for(i=0; i<8; i++) { if(a->u.Word[i] < b->u.Word[i]) return -1; if(a->u.Word[i] > b->u.Word[i]) return 1; } #endif return 0; } static int ipv6_human_cmp(const scamper_addr_t *sa, const scamper_addr_t *sb) { struct in6_addr *a, *b; int i; #ifndef _WIN32 uint32_t as, bs; #else uint16_t as, bs; #endif assert(sa->type == SCAMPER_ADDR_TYPE_IPV6); assert(sb->type == SCAMPER_ADDR_TYPE_IPV6); a = (struct in6_addr *)sa->addr; b = (struct in6_addr *)sb->addr; #ifndef _WIN32 for(i=0; i<4; i++) { as = ntohl(a->s6_addr32[i]); bs = ntohl(b->s6_addr32[i]); if(as < bs) return -1; if(as > bs) return 1; } #else for(i=0; i<8; i++) { as = ntohs(a->u.Word[i]); bs = ntohs(b->u.Word[i]); if(as < bs) return -1; if(as > bs) return 1; } #endif return 0; } static void ipv6_tostr(const scamper_addr_t *addr, char *buf, const size_t len) { addr_tostr(AF_INET6, addr->addr, buf, len); return; } static int ipv6_inprefix(const scamper_addr_t *sa, const void *p, int len) { const struct in6_addr *addr = sa->addr; const struct in6_addr *prefix = p; int i; #ifndef _WIN32 uint32_t mask; #else uint16_t mask; #endif if(len == 0) return 1; if(len > 128) return -1; #ifndef _WIN32 for(i=0; i<4; i++) { /* * handle the fact that we can only check 32 bits at a time. * no need to change byte order as all bytes are the same */ if(len > 32) mask = uint32_netmask[31]; else mask = htonl(uint32_netmask[len-1]); if(((addr->s6_addr32[i] ^ prefix->s6_addr32[i]) & mask) != 0) return 0; if(len <= 32) return 1; len -= 32; } #else for(i=0; i<8; i++) { if(len > 16) mask = uint16_mask[15]; else mask = htons(uint16_mask[len-1]); if(((addr->u.Word[i] ^ prefix->u.Word[i]) & mask) != 0) return 0; if(len <= 16) return 1; len -= 16; } #endif /* we should never get to this return statement */ return -1; } static int ipv6_prefix(const scamper_addr_t *sa, const scamper_addr_t *sb) { const struct in6_addr *a = sa->addr; const struct in6_addr *b = sb->addr; int i, j, x = 0; #ifndef _WIN32 uint32_t ua, ub; #else uint16_t ua, ub; #endif #ifndef _WIN32 for(i=0; i<4; i++) { ua = a->s6_addr32[i]; ub = b->s6_addr32[i]; if(ua == ub) { x += 32; continue; } for(j=0; j<32; j++) { if(((ua ^ ub) & htonl(uint32_netmask[j])) != 0) return x; x++; } } #else for(i=0; i<8; i++) { ua = a->u.Word[i]; ub = b->u.Word[i]; if(ua == ub) { x += 16; continue; } for(j=0; j<16; j++) { if(((ua ^ ub) & htons(uint16_mask[j])) != 0) return x; x++; } } #endif return x; } /* * ipv6_islinklocal * * an IPv6 address is a link local address if it is in fe80::/10 */ static int ipv6_islinklocal(const scamper_addr_t *sa) { const struct in6_addr *a = sa->addr; if(a->s6_addr[0] == 0xfe && (a->s6_addr[1] & 0xc0) == 0x80) return 1; return 0; } static int ipv6_netaddr(const scamper_addr_t *sa, void *net, int nl) { const struct in6_addr *a = sa->addr; struct in6_addr p; int i; if(nl <= 0 || nl > 128 || sa == NULL || net == NULL) return -1; memset(&p, 0, sizeof(p)); #ifndef _WIN32 for(i=0; i<4; i++) { if(nl >= 32) p.s6_addr32[i] = a->s6_addr32[i]; else p.s6_addr32[i] = htonl(ntohl(a->s6_addr32[i]) & uint32_netmask[nl-1]); if(nl <= 32) break; nl -= 32; } #else for(i=0; i<8; i++) { if(nl >= 16) p.u.Word[i] = a->u.Word[i]; else p.u.Word[i] = htons(ntohs(a->u.Word[i]) & uint16_mask[nl-1]); if(nl <= 16) break; nl -= 16; } #endif memcpy(net, &p, sizeof(p)); return 0; } static int ipv6_isreserved(const scamper_addr_t *sa) { const struct in6_addr *a = sa->addr; /* if the address falls outside of 2000::/3, then its reserved */ if((a->s6_addr[0] & 0xe0) != 0x20) return 1; /* 2002::/16 (6to4) */ if(a->s6_addr[1] == 0x02) return 1; /* 2001::/16 (many) */ if(a->s6_addr[1] == 0x01) { if(a->s6_addr[2] == 0) { /* 2001::/32 (teredo) */ if(a->s6_addr[3] == 0) return 1; /* 2001:2::/48 (benchmarking) */ if(a->s6_addr[3] == 0x2 && a->s6_addr[4] == 0 && a->s6_addr[5] == 0) return 1; /* 2001:3::/32 (AMT) */ if(a->s6_addr[3] == 0x3) return 1; /* 2001:4:112::/48 (AS112-v6) */ if(a->s6_addr[4] == 0x4 && a->s6_addr[5] == 0x1 && a->s6_addr[6] == 0x12) return 1; /* 2001:10::/28 (ORCHID) and 2001:20::/28 (ORCHIDv2) */ if(((a->s6_addr[3] & 0xf0) == 0x10) || ((a->s6_addr[3] & 0xf0) == 0x20)) return 1; } /* 2001:db8::/32 (documentation */ if(a->s6_addr[2] == 0x0d && a->s6_addr[3] == 0xb8) return 1; } return 0; } static int ipv6_isunicast(const scamper_addr_t *sa) { const struct in6_addr *a = sa->addr; if((a->s6_addr[0] & 0xe0) == 0x20) return 1; return 0; } static int ipv6_bit(const scamper_addr_t *sa, int bit) { struct in6_addr *a = (struct in6_addr *)sa->addr; assert(bit > 0); assert(bit <= 128); #ifndef _WIN32 return (ntohl(a->s6_addr32[(bit-1)/32]) >> (32 - (bit % 32))) & 1; #else return (ntohs(a->u.Word[(bit-1)/16]) >> (16 - (bit % 16))) & 1; #endif } static int ipv6_fbd(const scamper_addr_t *sa, const scamper_addr_t *sb) { const struct in6_addr *a, *b; int i, r; uint32_t v; assert(sa->type == SCAMPER_ADDR_TYPE_IPV6); assert(sb->type == SCAMPER_ADDR_TYPE_IPV6); a = (const struct in6_addr *)sa->addr; b = (const struct in6_addr *)sb->addr; for(i=0; i<4; i++) { if((v = ntohl(a->s6_addr32[i] ^ b->s6_addr32[i])) == 0) continue; #ifdef HAVE___BUILTIN_CLZ r = __builtin_clz(v) + 1 + (i * 32); #else r = 0; if(v & 0xFFFF0000) { v >>= 16; r += 16; } if(v & 0xFF00) { v >>= 8; r += 8; } if(v & 0xF0) { v >>= 4; r += 4; } if(v & 0xC) { v >>= 2; r += 2; } if(v & 0x2) { r += 1; } r = (32 - r) + (i * 32); #endif return r; } return 128; } static int ethernet_cmp(const scamper_addr_t *sa, const scamper_addr_t *sb) { assert(sa->type == SCAMPER_ADDR_TYPE_ETHERNET); assert(sb->type == SCAMPER_ADDR_TYPE_ETHERNET); return memcmp(sa->addr, sb->addr, 6); } static void ethernet_tostr(const scamper_addr_t *addr, char *buf, const size_t len) { uint8_t *mac = (uint8_t *)addr->addr; snprintf(buf, len, "%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); return; } static int ethernet_bit(const scamper_addr_t *addr, int bit) { static const uint8_t mask[] = {0x01,0x80,0x40,0x20,0x10,0x08,0x04,0x02}; static const uint8_t shift[] = {0, 7, 6, 5, 4, 3, 2, 1}; uint8_t *mac = (uint8_t *)addr->addr; assert(bit > 0 && bit <= 48); return (mac[(bit-1)/8] & mask[bit%8]) >> shift[bit%8]; } static int ethernet_fbd(const scamper_addr_t *sa, const scamper_addr_t *sb) { const uint8_t *a, *b; uint8_t v; int i, r = 0; assert(sa->type == SCAMPER_ADDR_TYPE_ETHERNET); assert(sb->type == SCAMPER_ADDR_TYPE_ETHERNET); a = (const uint8_t *)sa->addr; b = (const uint8_t *)sb->addr; for(i=0; i<6; i++) { if((v = a[i] ^ b[i]) == 0) continue; if(v & 0xF0) { v >>= 4; r += 4; } if(v & 0xC) { v >>= 2; r += 2; } if(v & 0x2) { r += 1; } r = (8 - r) + (i * 8); break; } return r; } static int firewire_cmp(const scamper_addr_t *sa, const scamper_addr_t *sb) { assert(sa->type == SCAMPER_ADDR_TYPE_FIREWIRE); assert(sb->type == SCAMPER_ADDR_TYPE_FIREWIRE); return memcmp(sa->addr, sb->addr, 8); } static void firewire_tostr(const scamper_addr_t *addr, char *buf, const size_t len) { uint8_t *lla = (uint8_t *)addr->addr; snprintf(buf, len, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", lla[0], lla[1], lla[2], lla[3], lla[4], lla[5], lla[6], lla[7]); return; } static int firewire_bit(const scamper_addr_t *addr, int bit) { static const uint8_t mask[] = {0x01,0x80,0x40,0x20,0x10,0x08,0x04,0x02}; static const uint8_t shift[] = {0, 7, 6, 5, 4, 3, 2, 1}; uint8_t *lla = (uint8_t *)addr->addr; assert(bit > 0 && bit <= 64); return (lla[(bit-1)/8] >> mask[bit%8]) >> shift[bit%8]; } static int firewire_fbd(const scamper_addr_t *sa, const scamper_addr_t *sb) { const uint8_t *a, *b; uint8_t v; int i, r = 0; assert(sa->type == SCAMPER_ADDR_TYPE_FIREWIRE); assert(sb->type == SCAMPER_ADDR_TYPE_FIREWIRE); a = (const uint8_t *)sa->addr; b = (const uint8_t *)sb->addr; for(i=0; i<8; i++) { if((v = a[i] ^ b[i]) == 0) continue; if(v & 0xF0) { v >>= 4; r += 4; } if(v & 0xC) { v >>= 2; r += 2; } if(v & 0x2) { r += 1; } r = (8 - r) + (i * 8); break; } return r; } size_t scamper_addr_size(const scamper_addr_t *sa) { return handlers[sa->type-1].size; } const char *scamper_addr_tostr(const scamper_addr_t *sa, char *dst, const size_t size) { handlers[sa->type-1].tostr(sa, dst, size); return dst; } scamper_addr_t *scamper_addr_alloc(const int type, const void *addr) { scamper_addr_t *sa; assert(addr != NULL); assert(type-1 >= 0); assert((size_t)(type-1) < sizeof(handlers)/sizeof(struct handler)); if((sa = malloc_zero(sizeof(scamper_addr_t))) != NULL) { if((sa->addr = memdup(addr, handlers[type-1].size)) == NULL) { free(sa); return NULL; } sa->type = type; sa->refcnt = 1; sa->internal = NULL; } return sa; } /* * scamper_addr_resolve: * * resolve the address contained in addr to a sockaddr that * tells us what family the address belongs to, and has a binary * representation of the address */ scamper_addr_t *scamper_addr_resolve(const int af, const char *addr) { struct addrinfo hints, *res, *res0; scamper_addr_t *sa = NULL; void *va; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = IPPROTO_UDP; hints.ai_family = af; if(getaddrinfo(addr, NULL, &hints, &res0) != 0 || res0 == NULL) { return NULL; } for(res = res0; res != NULL; res = res->ai_next) { if(res->ai_family == PF_INET) { va = &((struct sockaddr_in *)res->ai_addr)->sin_addr; sa = scamper_addr_alloc(SCAMPER_ADDR_TYPE_IPV4, va); break; } else if(res->ai_family == PF_INET6) { va = &((struct sockaddr_in6 *)res->ai_addr)->sin6_addr; sa = scamper_addr_alloc(SCAMPER_ADDR_TYPE_IPV6, va); break; } } freeaddrinfo(res0); return sa; } int scamper_addr_inprefix(const scamper_addr_t *addr, const void *p, int len) { if(handlers[addr->type-1].inprefix != NULL) return handlers[addr->type-1].inprefix(addr, p, len); return -1; } int scamper_addr_bit(const scamper_addr_t *a, int bit) { return handlers[a->type-1].bit(a, bit); } int scamper_addr_fbd(const scamper_addr_t *a, const scamper_addr_t *b) { return handlers[a->type-1].fbd(a, b); } int scamper_addr_prefix(const scamper_addr_t *a, const scamper_addr_t *b) { if(a->type != b->type || handlers[a->type-1].prefix == NULL) return -1; return handlers[a->type-1].prefix(a, b); } int scamper_addr_prefixhosts(const scamper_addr_t *a, const scamper_addr_t *b) { if(a->type != b->type || handlers[a->type-1].prefixhosts == NULL) return -1; return handlers[a->type-1].prefixhosts(a, b); } int scamper_addr_af(const scamper_addr_t *sa) { if(sa->type == SCAMPER_ADDR_TYPE_IPV4) return AF_INET; else if(sa->type == SCAMPER_ADDR_TYPE_IPV6) return AF_INET6; else return -1; } int scamper_addr_islinklocal(const scamper_addr_t *a) { if(handlers[a->type-1].islinklocal == NULL) return 0; return handlers[a->type-1].islinklocal(a); } int scamper_addr_netaddr(const scamper_addr_t *a, void *net, int netlen) { if(handlers[a->type-1].netaddr == NULL) return -1; return handlers[a->type-1].netaddr(a, net, netlen); } int scamper_addr_isrfc1918(const scamper_addr_t *sa) { uint32_t x; if(sa->type != SCAMPER_ADDR_TYPE_IPV4) return 0; x = ntohl(((const struct in_addr *)sa->addr)->s_addr); if((x & 0xff000000) == 0x0a000000 || /* 10.0.0.0 /8 */ (x & 0xfff00000) == 0xac100000 || /* 172.16.0.0 /12 */ (x & 0xffff0000) == 0xc0a80000) /* 192.168.0.0 /16 */ { return 1; } return 0; } int scamper_addr_is6to4(const scamper_addr_t *sa) { const struct in6_addr *a; if(sa->type != SCAMPER_ADDR_TYPE_IPV6) return 0; a = sa->addr; #ifndef _WIN32 if(a->s6_addr[0] == 0x20 && a->s6_addr[1] == 0x02) return 1; #else if(a->u.Word[0] == htons(0x2002)) return 1; #endif return 0; } int scamper_addr_isunicast(const scamper_addr_t *sa) { if(handlers[sa->type-1].isunicast == NULL) return -1; return handlers[sa->type-1].isunicast(sa); } int scamper_addr_isreserved(const scamper_addr_t *sa) { if(handlers[sa->type-1].isreserved == NULL) return -1; return handlers[sa->type-1].isreserved(sa); } scamper_addr_t *scamper_addrcache_get(scamper_addrcache_t *ac, const int type, const void *addr) { scamper_addr_t *sa, findme; findme.type = type; findme.addr = (void *)addr; if((sa = patricia_find(ac->trie[type-1], &findme)) != NULL) { assert(sa->internal == ac); sa->refcnt++; return sa; } if((sa = scamper_addr_alloc(type, addr)) != NULL) { if(patricia_insert(ac->trie[type-1], sa) == NULL) goto err; sa->internal = ac; } return sa; err: scamper_addr_free(sa); return NULL; } /* * scamper_addr_resolve: * * resolve the address contained in addr to a sockaddr that * tells us what family the address belongs to, and has a binary * representation of the address */ scamper_addr_t *scamper_addrcache_resolve(scamper_addrcache_t *addrcache, const int af, const char *addr) { struct addrinfo hints, *res, *res0; scamper_addr_t *sa = NULL; void *va; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = IPPROTO_UDP; hints.ai_family = af; if(getaddrinfo(addr, NULL, &hints, &res0) != 0 || res0 == NULL) { return NULL; } for(res = res0; res != NULL; res = res->ai_next) { if(res->ai_family == PF_INET) { va = &((struct sockaddr_in *)res->ai_addr)->sin_addr; sa = scamper_addrcache_get(addrcache, SCAMPER_ADDR_TYPE_IPV4, va); break; } else if(res->ai_family == PF_INET6) { va = &((struct sockaddr_in6 *)res->ai_addr)->sin6_addr; sa = scamper_addrcache_get(addrcache, SCAMPER_ADDR_TYPE_IPV6, va); break; } } freeaddrinfo(res0); return sa; } scamper_addr_t *scamper_addr_use(scamper_addr_t *sa) { if(sa != NULL) sa->refcnt++; return sa; } void scamper_addr_free(scamper_addr_t *sa) { scamper_addrcache_t *ac; if(sa == NULL) { return; } assert(sa->refcnt > 0); if(--sa->refcnt > 0) return; if((ac = sa->internal) != NULL) patricia_remove_item(ac->trie[sa->type-1], sa); free(sa->addr); free(sa); return; } int scamper_addr_cmp(const scamper_addr_t *a, const scamper_addr_t *b) { assert(a->type > 0 && a->type <= sizeof(handlers)/sizeof(struct handler)); assert(b->type > 0 && b->type <= sizeof(handlers)/sizeof(struct handler)); /* * if the two address structures point to the same memory, then they are * a match */ if(a == b) { return 0; } /* * if the two address types are the same, then do a comparison on the * underlying addresses */ if(a->type == b->type) { return handlers[a->type-1].cmp(a, b); } /* otherwise, return a code based on the difference between the types */ if(a->type < b->type) { return -1; } else { return 1; } } int scamper_addr_human_cmp(const scamper_addr_t *a, const scamper_addr_t *b) { assert(a->type > 0 && a->type <= sizeof(handlers)/sizeof(struct handler)); assert(b->type > 0 && b->type <= sizeof(handlers)/sizeof(struct handler)); /* * if the two address structures point to the same memory, then they are * a match */ if(a == b) { return 0; } /* * if the two address types are the same, then do a comparison on the * underlying addresses */ if(a->type == b->type) { return handlers[a->type-1].human_cmp(a, b); } /* otherwise, return a code based on the difference between the types */ if(a->type < b->type) { return -1; } else { return 1; } } int scamper_addr_raw_cmp(const scamper_addr_t *a, const void *raw) { return memcmp(a->addr, raw, handlers[a->type-1].size); } static void free_cb(void *node) { ((scamper_addr_t *)node)->internal = NULL; return; } void scamper_addrcache_free(scamper_addrcache_t *ac) { int i; for(i=(sizeof(handlers)/sizeof(struct handler))-1; i>=0; i--) if(ac->trie[i] != NULL) patricia_free_cb(ac->trie[i], free_cb); free(ac); return; } scamper_addrcache_t *scamper_addrcache_alloc() { scamper_addrcache_t *ac; int i; if((ac = malloc_zero(sizeof(scamper_addrcache_t))) == NULL) return NULL; for(i=(sizeof(handlers)/sizeof(struct handler))-1; i>=0; i--) { ac->trie[i] = patricia_alloc((patricia_bit_t)handlers[i].bit, (patricia_cmp_t)handlers[i].cmp, (patricia_fbd_t)handlers[i].fbd); if(ac->trie[i] == NULL) goto err; } return ac; err: scamper_addrcache_free(ac); return NULL; } scamper-cvs-20171204/scamper/scamper_addr.h000644 001751 000000 00000016764 12756273236 020375 0ustar00mjlwheel000000 000000 /* * scamper_addr.h * * $Id: scamper_addr.h,v 1.28 2016/08/21 09:38:38 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2013 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_ADDR_H #define __SCAMPER_ADDR_H /* * the scamper_addr code has a number of purposes: * * first, it provides a way to record different address types in the same * structure regardless of the operating system scamper is used on. * * second, it provides a way to reference count the addresses contained, so * that users of addresses do not have to allocate copies of the address * each time they use the address internally. * * third, it can provide a 'cache' of addresses so that only one copy of * the address needs to be kept among all users of scamper_addr. */ /* * these are the types of addresses that scamper understands */ #define SCAMPER_ADDR_TYPE_IPV4 0x01 /* 32 bit IPv4 address */ #define SCAMPER_ADDR_TYPE_IPV6 0x02 /* 128 bit IPv6 address */ #define SCAMPER_ADDR_TYPE_ETHERNET 0x03 /* 48 bit ethernet mac address */ #define SCAMPER_ADDR_TYPE_FIREWIRE 0x04 /* 64 bit firewire link address */ #define SCAMPER_ADDR_TYPE_MAX SCAMPER_ADDR_TYPE_FIREWIRE #define SCAMPER_ADDR_TYPE_IS_IPV4(a) ((a)->type == SCAMPER_ADDR_TYPE_IPV4) #define SCAMPER_ADDR_TYPE_IS_IPV6(a) ((a)->type == SCAMPER_ADDR_TYPE_IPV6) #define SCAMPER_ADDR_TYPE_IS_IP(a) ((a)->type == SCAMPER_ADDR_TYPE_IPV4 || \ (a)->type == SCAMPER_ADDR_TYPE_IPV6) /* * scamper_addr: * * this structure is used to store an address in scamper. * the contents of this will eventually be made private, so users of * addresses should not count on the contents of the struct remaining * public. */ typedef struct scamper_addr { int type; void *addr; int refcnt; void *internal; } scamper_addr_t; /* * scamper_addr_alloc: * allocate an address of the specified type; the reference count of the * address is initialised to one * * scamper_addr_use: * increment the reference count by one, and return a reference to the * address passed in as a convenience. * * scamper_addr_free: * decrement the reference count held on the address. when the reference * count becomes zero, the address is freed. * * scamper_addr_resolve: * attempt to resolve the string as getaddrinfo would, and return the address * * scamper_addr_af: * return the address family of the address * * scamper_addr_inprefix: * return if the address is in the prefix. * * scamper_addr_prefix: * return the longest number of matching bits for the two addresses. * * scamper_addr_prefixhosts: * return the longest network prefix that would allow for these two hosts. * * scamper_addr_netaddr: * return the network address for the supplied address given prefix length. */ scamper_addr_t *scamper_addr_alloc(const int type, const void *addr); scamper_addr_t *scamper_addr_use(scamper_addr_t *sa); void scamper_addr_free(scamper_addr_t *sa); scamper_addr_t *scamper_addr_resolve(const int af, const char *str); int scamper_addr_af(const scamper_addr_t *sa); int scamper_addr_inprefix(const scamper_addr_t *sa, const void *p, int len); int scamper_addr_prefix(const scamper_addr_t *a, const scamper_addr_t *b); int scamper_addr_prefixhosts(const scamper_addr_t *a, const scamper_addr_t *b); int scamper_addr_netaddr(const scamper_addr_t *a, void *net, int netlen); int scamper_addr_bit(const scamper_addr_t *a, int bit); int scamper_addr_fbd(const scamper_addr_t *a, const scamper_addr_t *b); /* * scamper_addr_alloc_[ipv4|ipv6|ethernet|firewire] * * these macros are provided as a convenience as the type constants can * become unwieldy to use */ #define scamper_addr_alloc_ipv4(addr) \ scamper_addr_alloc(SCAMPER_ADDR_TYPE_IPV4, addr) #define scamper_addr_alloc_ipv6(addr) \ scamper_addr_alloc(SCAMPER_ADDR_TYPE_IPV6, addr) #define scamper_addr_alloc_ethernet(addr) \ scamper_addr_alloc(SCAMPER_ADDR_TYPE_ETHERNET, addr) #define scamper_addr_alloc_firewire(addr) \ scamper_addr_alloc(SCAMPER_ADDR_TYPE_FIREWIRE, addr) /* * scamper_addr_cmp: * given two addresses, return their sort order. */ int scamper_addr_cmp(const scamper_addr_t *a, const scamper_addr_t *b); int scamper_addr_human_cmp(const scamper_addr_t *a, const scamper_addr_t *b); int scamper_addr_raw_cmp(const scamper_addr_t *a, const void *raw); /* * scamper_addr_tostr: * given a scamper address, convert it to a string representation in the * buffer of specified size. */ const char *scamper_addr_tostr(const scamper_addr_t *sa, char *dst, const size_t size); /* * scamper_addr_size * return the size of the underlying address stored in the scamper_addr * structure. useful for writing address objects to disk... */ size_t scamper_addr_size(const scamper_addr_t *sa); /* * scamper_addrcache: * store identical addresses just once in this structure * * scamper_addrcache_alloc: * allocate an empty address cache and return a pointer to it * * scamper_addrcache_free: * free the address cache structure. all addresses have their reference * count decremented; if their reference count is zero, the underlying * address is freed as well. */ typedef struct scamper_addrcache scamper_addrcache_t; scamper_addrcache_t *scamper_addrcache_alloc(void); void scamper_addrcache_free(scamper_addrcache_t *ac); /* * scamper_addrcache_get: * return a pointer to a scamper_addr_t which corresponds to the address * out of the cache; allocate the address from scratch if necessary */ scamper_addr_t *scamper_addrcache_get(scamper_addrcache_t *ac, const int type, const void *addr); scamper_addr_t *scamper_addrcache_resolve(scamper_addrcache_t *ac, const int af, const char *addr); /* * scamper_addr_islinklocal: * determine if the address is a link-local IPv4 or IPv6 address. * * scamper_addr_isrfc1918: * determine if the address is an RFC 1918 address. */ int scamper_addr_islinklocal(const scamper_addr_t *a); int scamper_addr_isrfc1918(const scamper_addr_t *a); int scamper_addr_isunicast(const scamper_addr_t *a); int scamper_addr_is6to4(const scamper_addr_t *a); int scamper_addr_isreserved(const scamper_addr_t *a); /* * scamper_addrcache_get_[ipv4|ipv6|ethernet|firewire] * * these macros are provided as a convenience as the type constants can * become unwieldy to use */ #define scamper_addrcache_get_ipv4(addrcache, addr) \ scamper_addrcache_get(addrcache, SCAMPER_ADDR_TYPE_IPV4, addr) #define scamper_addrcache_get_ipv6(addrcache, addr) \ scamper_addrcache_get(addrcache, SCAMPER_ADDR_TYPE_IPV6, addr) #define scamper_addrcache_get_ethernet(addrcache, addr) \ scamper_addrcache_get(addrcache, SCAMPER_ADDR_TYPE_ETHERNET, addr) #define scamper_addrcache_get_firewire(addrcache, addr) \ scamper_addrcache_get(addrcache, SCAMPER_ADDR_TYPE_FIREWIRE, addr) #endif /* __SCAMPER_ADDR_H */ scamper-cvs-20171204/scamper/scamper_addr2mac.c000644 001751 000000 00000036335 13210743022 021104 0ustar00mjlwheel000000 000000 /* * scamper_addr2mac.c: handle a cache of IP to MAC address mappings * * $Id: scamper_addr2mac.c,v 1.41 2017/12/03 09:38:26 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2014 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_addr2mac.c,v 1.41 2017/12/03 09:38:26 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #if defined(__APPLE__) #define HAVE_BSD_ARPCACHE #endif #if defined(__FreeBSD__) #define HAVE_BSD_ARPCACHE #endif #if defined(__NetBSD__) #define HAVE_BSD_ARPCACHE #endif #if defined(__OpenBSD__) #define HAVE_BSD_ARPCACHE #endif #if defined(__DragonFly__) #define HAVE_BSD_ARPCACHE #endif #if defined(__linux__) struct ndmsg { unsigned char ndm_family; unsigned char ndm_pad1; unsigned short ndm_pad2; int ndm_ifindex; uint16_t ndm_state; uint8_t ndm_flags; uint8_t ndm_type; }; struct sockaddr_nl { sa_family_t nl_family; unsigned short nl_pad; uint32_t nl_pid; uint32_t nl_groups; }; struct nlmsghdr { uint32_t nlmsg_len; uint16_t nlmsg_type; uint16_t nlmsg_flags; uint32_t nlmsg_seq; uint32_t nlmsg_pid; }; struct rtattr { unsigned short rta_len; unsigned short rta_type; }; #define NLMSG_ERROR 0x2 #define NLMSG_DONE 0x3 #define NLMSG_ALIGNTO 4 #define NLMSG_ALIGN(len) (((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1)) #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(sizeof(struct nlmsghdr))) #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))) #define NLMSG_OK(nlh,len) ((len) > 0 && (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ (nlh)->nlmsg_len <= (len)) #define RTA_ALIGNTO 4 #define RTA_ALIGN(len) (((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1)) #define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len)) #define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0))) #define RTA_OK(rta,len) ((len) > 0 && (rta)->rta_len >= sizeof(struct rtattr) && \ (rta)->rta_len <= (len)) #define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \ (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len))) #define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0)) #define NDA_DST 1 #define NDA_LLADDR 2 #define NDA_MAX (NDA_LLADDR+1) #define NDA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg)))) #define RTM_BASE 0x10 #define RTM_NEWNEIGH (RTM_BASE+12) #define RTM_GETNEIGH (RTM_BASE+14) #define NLM_F_REQUEST 1 #define NLM_F_ROOT 0x100 #define NLM_F_MATCH 0x200 #define NETLINK_ROUTE 0 #define NUD_REACHABLE 0x02 #endif /* __linux__ */ #include "scamper.h" #include "scamper_addr.h" #include "scamper_addr2mac.h" #include "scamper_rtsock.h" #include "scamper_debug.h" #include "utils.h" #include "mjl_splaytree.h" typedef struct addr2mac { int ifindex; scamper_addr_t *ip; scamper_addr_t *mac; time_t expire; } addr2mac_t; static splaytree_t *tree = NULL; extern scamper_addrcache_t *addrcache; static int addr2mac_cmp(const addr2mac_t *a, const addr2mac_t *b) { if(a->ifindex < b->ifindex) return -1; if(a->ifindex > b->ifindex) return 1; return scamper_addr_cmp(a->ip, b->ip); } static void addr2mac_free(addr2mac_t *addr2mac) { if(addr2mac->ip != NULL) scamper_addr_free(addr2mac->ip); if(addr2mac->mac != NULL) scamper_addr_free(addr2mac->mac); free(addr2mac); return; } static addr2mac_t *addr2mac_alloc(const int ifindex, scamper_addr_t *ip, scamper_addr_t *mac, time_t expire) { addr2mac_t *addr2mac; if((addr2mac = malloc_zero(sizeof(addr2mac_t))) == NULL) { printerror(__func__, "could not malloc addr2mac"); return NULL; } addr2mac->ifindex = ifindex; addr2mac->ip = ip != NULL ? scamper_addr_use(ip) : NULL; addr2mac->mac = mac != NULL ? scamper_addr_use(mac) : NULL; addr2mac->expire = expire; return addr2mac; } static int addr2mac_add(const int ifindex, const int type, const void *ipraw, const void *macraw, const time_t expire) { const int mt = SCAMPER_ADDR_TYPE_ETHERNET; scamper_addr_t *mac = NULL; scamper_addr_t *ip = NULL; addr2mac_t *addr2mac = NULL; char ipstr[128], macstr[128]; if((ip = scamper_addrcache_get(addrcache, type, ipraw)) == NULL) { printerror(__func__, "could not get ip"); goto err; } if((mac = scamper_addrcache_get(addrcache, mt, macraw)) == NULL) { printerror(__func__, "could not get mac"); goto err; } if((addr2mac = addr2mac_alloc(ifindex, ip, mac, expire)) == NULL) { goto err; } scamper_addr_free(ip); ip = NULL; scamper_addr_free(mac); mac = NULL; if(splaytree_insert(tree, addr2mac) == NULL) { printerror(__func__, "could not add %s:%s to tree", scamper_addr_tostr(addr2mac->ip, ipstr, sizeof(ipstr)), scamper_addr_tostr(addr2mac->mac, macstr, sizeof(macstr))); goto err; } scamper_debug(__func__, "ifindex %d ip %s mac %s expire %d", ifindex, scamper_addr_tostr(addr2mac->ip, ipstr, sizeof(ipstr)), scamper_addr_tostr(addr2mac->mac, macstr, sizeof(macstr)), expire); return 0; err: if(addr2mac != NULL) addr2mac_free(addr2mac); if(mac != NULL) scamper_addr_free(mac); if(ip != NULL) scamper_addr_free(ip); return -1; } int scamper_addr2mac_add(int ifindex, scamper_addr_t *ip, scamper_addr_t *mac) { addr2mac_t *a2m = NULL; char ipstr[128], macstr[128]; if(scamper_addr2mac_whohas(ifindex, ip) != NULL) return 0; if((a2m = addr2mac_alloc(ifindex, ip, mac, 0)) == NULL) return -1; if(splaytree_insert(tree, a2m) == NULL) { printerror(__func__, "could not add %s:%s to tree", scamper_addr_tostr(a2m->ip, ipstr, sizeof(ipstr)), scamper_addr_tostr(a2m->mac, macstr, sizeof(macstr))); addr2mac_free(a2m); return -1; } scamper_debug(__func__, "ifindex %d ip %s mac %s", ifindex, scamper_addr_tostr(a2m->ip, ipstr, sizeof(ipstr)), scamper_addr_tostr(a2m->mac, macstr, sizeof(macstr))); return 0; } /* * scamper_addr2mac_whohas * * return the MAC address associated with an IP address, if it is cached. */ scamper_addr_t *scamper_addr2mac_whohas(const int ifindex, scamper_addr_t *dst) { addr2mac_t findme, *addr2mac; findme.ifindex = ifindex; findme.ip = dst; /* see if this IP address has a record in our tree */ if((addr2mac = splaytree_find(tree, &findme)) != NULL) { return addr2mac->mac; } return NULL; } #if defined(__linux__) static int addr2mac_init_linux() { struct nlmsghdr *nlmsg; struct ndmsg *ndmsg; struct rtattr *rta, *tb[NDA_MAX]; struct sockaddr_nl snl; struct msghdr msg; struct iovec iov; struct timeval tv; pid_t pid; uint8_t buf[16384]; ssize_t ssize; ssize_t len; int rlen; int fd = -1; void *ip, *mac; int iptype; pid = getpid(); memset(buf, 0, sizeof(buf)); nlmsg = (struct nlmsghdr *)buf; nlmsg->nlmsg_len = NLMSG_LENGTH(sizeof(struct ndmsg)); nlmsg->nlmsg_type = RTM_GETNEIGH; nlmsg->nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT | NLM_F_MATCH; nlmsg->nlmsg_seq = 0; nlmsg->nlmsg_pid = pid; ndmsg = NLMSG_DATA(nlmsg); ndmsg->ndm_family = AF_UNSPEC; if((fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE)) == -1) { printerror(__func__, "could not open netlink"); goto err; } len = nlmsg->nlmsg_len; if((ssize = send(fd, buf, len, 0)) < len) { if(ssize == -1) { printerror(__func__, "could not send netlink"); } goto err; } for(;;) { iov.iov_base = buf; iov.iov_len = sizeof(buf); msg.msg_name = &snl; msg.msg_namelen = sizeof(snl); msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = NULL; msg.msg_controllen = 0; msg.msg_flags = 0; if((len = recvmsg(fd, &msg, 0)) == -1) { if(errno == EINTR) continue; printerror(__func__, "could not recvmsg"); goto err; } gettimeofday_wrap(&tv); nlmsg = (struct nlmsghdr *)buf; while(NLMSG_OK(nlmsg, len)) { if(nlmsg->nlmsg_pid != pid || nlmsg->nlmsg_seq != 0) { goto skip; } if(nlmsg->nlmsg_type == NLMSG_DONE) { goto done; } if(nlmsg->nlmsg_type == NLMSG_ERROR) { scamper_debug(__func__, "nlmsg error"); goto err; } /* get current neighbour entries only */ if(nlmsg->nlmsg_type != RTM_NEWNEIGH) { goto skip; } /* make sure the address is reachable */ ndmsg = NLMSG_DATA(nlmsg); if((ndmsg->ndm_state & NUD_REACHABLE) == 0) { goto skip; } /* make sure we can process this address type */ switch(ndmsg->ndm_family) { case AF_INET: iptype = SCAMPER_ADDR_TYPE_IPV4; break; case AF_INET6: iptype = SCAMPER_ADDR_TYPE_IPV6; break; default: goto skip; } /* fill a table with parameters from the payload */ memset(tb, 0, sizeof(tb)); rlen = nlmsg->nlmsg_len - NLMSG_LENGTH(sizeof(struct ndmsg)); for(rta = NDA_RTA(ndmsg); RTA_OK(rta,rlen); rta = RTA_NEXT(rta,rlen)) { if(rta->rta_type >= NDA_MAX) continue; tb[rta->rta_type] = rta; } /* * skip if we don't have a destination IP address, or if * we don't have an ethernet mac address */ if(tb[NDA_DST] == NULL || tb[NDA_LLADDR] == NULL || RTA_PAYLOAD(tb[NDA_LLADDR]) != 6) { goto skip; } ip = RTA_DATA(tb[NDA_DST]); mac = RTA_DATA(tb[NDA_LLADDR]); addr2mac_add(ndmsg->ndm_ifindex, iptype, ip, mac, tv.tv_sec+600); skip: nlmsg = NLMSG_NEXT(nlmsg, len); } } done: close(fd); return 0; err: close(fd); return -1; } #endif #if defined(HAVE_BSD_ARPCACHE) static void addr2mac_mib_make(int *mib, int af) { mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; mib[3] = af; mib[4] = NET_RT_FLAGS; #if defined(RTF_LLINFO) mib[5] = RTF_LLINFO; #else mib[5] = 0; #endif return; } static int addr2mac_init_bsd(void) { struct rt_msghdr *rtm; struct sockaddr_inarp *sin; struct sockaddr_in6 *sin6; struct sockaddr_dl *sdl; int iptype; void *ip, *mac; int mib[6]; void *vbuf = NULL; uint8_t *buf; size_t i, j, size; /* * firstly, get the IPv4 ARP cache and load that. * we get it by using the sysctl interface to the cache and parsing each * entry */ addr2mac_mib_make(mib, AF_INET); if(sysctl_wrap(mib, 6, &vbuf, &size) == -1) { printerror(__func__, "sysctl arp cache"); goto err; } iptype = SCAMPER_ADDR_TYPE_IPV4; buf = (uint8_t *)vbuf; for(i=0; irtm_msglen) { j = i; rtm = (struct rt_msghdr *)(buf + j); j += sizeof(struct rt_msghdr); sin = (struct sockaddr_inarp *)(buf + j); j += scamper_rtsock_roundup(sin->sin_len); sdl = (struct sockaddr_dl *)(buf + j); /* don't deal with permanent arp entries at this time */ if(sdl->sdl_type != IFT_ETHER || sdl->sdl_alen != ETHER_ADDR_LEN) { continue; } ip = &sin->sin_addr; mac = sdl->sdl_data + sdl->sdl_nlen; addr2mac_add(sdl->sdl_index, iptype, ip, mac, (time_t)rtm->rtm_rmx.rmx_expire); } if(vbuf != NULL) { free(vbuf); vbuf = NULL; } /* now it is time to get the IPv6 neighbour discovery cache */ addr2mac_mib_make(mib, AF_INET6); if(sysctl_wrap(mib, 6, &vbuf, &size) == -1) { /* * assume that EINVAL means that IPv6 support is not provided on * this system */ if(errno == EINVAL || errno == EAFNOSUPPORT) return 0; printerror(__func__, "sysctl ndp cache"); goto err; } iptype = SCAMPER_ADDR_TYPE_IPV6; buf = (uint8_t *)vbuf; for(i=0; irtm_msglen) { j = i; rtm = (struct rt_msghdr *)(buf + j); j += sizeof(struct rt_msghdr); sin6 = (struct sockaddr_in6 *)(buf + j); j += scamper_rtsock_roundup(sin6->sin6_len); sdl = (struct sockaddr_dl *)(buf + j); if(sdl->sdl_family != AF_LINK || sdl->sdl_type != IFT_ETHER || sdl->sdl_alen != ETHER_ADDR_LEN || (rtm->rtm_flags & RTF_HOST) == 0) { continue; } /* clear out any embedded ifindex in a linklocal address */ if(IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { sin6->sin6_addr.s6_addr[2] = 0; sin6->sin6_addr.s6_addr[3] = 0; } ip = &sin6->sin6_addr; mac = sdl->sdl_data + sdl->sdl_nlen; addr2mac_add(sdl->sdl_index, iptype, ip, mac, (time_t)rtm->rtm_rmx.rmx_expire); } if(vbuf != NULL) { free(vbuf); vbuf = NULL; } return 0; err: if(vbuf != NULL) free(vbuf); return -1; } #endif #ifdef _WIN32 static int GetIpNetTable_wrap(MIB_IPNETTABLE **table, ULONG *size) { int rc; *table = NULL; *size = 0; for(;;) { if(*size > 0 && (*table = malloc_zero(*size)) == NULL) return -1; if((rc = GetIpNetTable(*table, size, FALSE)) == NO_ERROR) return 0; free(*table); *table = NULL; if(rc != ERROR_INSUFFICIENT_BUFFER) break; } return -1; } static int addr2mac_init_win32() { MIB_IPNETTABLE *table; ULONG size; DWORD dw; int iptype; iptype = SCAMPER_ADDR_TYPE_IPV4; if(GetIpNetTable_wrap(&table, &size) == 0 && table != NULL) { for(dw=0; dwdwNumEntries; dw++) { addr2mac_add(table->table[dw].dwIndex, iptype, &table->table[dw].dwAddr, table->table[dw].bPhysAddr, 0); } free(table); } return 0; } #endif int scamper_addr2mac_init() { if((tree = splaytree_alloc((splaytree_cmp_t)addr2mac_cmp)) == NULL) { printerror(__func__, "could not alloc tree"); return -1; } if(scamper_option_noinitndc() != 0) return 0; #ifdef HAVE_BSD_ARPCACHE if(addr2mac_init_bsd() != 0) { return -1; } #endif #ifdef __linux__ if(addr2mac_init_linux() != 0) { return -1; } #endif #ifdef _WIN32 if(addr2mac_init_win32() != 0) { return -1; } #endif return 0; } void scamper_addr2mac_cleanup() { splaytree_free(tree, (splaytree_free_t)addr2mac_free); return; } scamper-cvs-20171204/scamper/scamper_addr2mac.h000644 001751 000000 00000002345 11634537537 021127 0ustar00mjlwheel000000 000000 /* * scamper_addr2mac.h: an implementation of two neighbour discovery methods * * $Id: scamper_addr2mac.h,v 1.8 2011/09/16 03:15:43 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2009 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_ADDR2MAC_H #define __SCAMPER_ADDR2MAC_H scamper_addr_t *scamper_addr2mac_whohas(const int ifindex,scamper_addr_t *dst); int scamper_addr2mac_add(int ifindex, scamper_addr_t *ip, scamper_addr_t *mac); int scamper_addr2mac_init(void); void scamper_addr2mac_cleanup(void); #endif /* __SCAMPER_ADDR2MAC_H */ scamper-cvs-20171204/scamper/scamper_control.c000644 001751 000000 00000242666 13210743022 021115 0ustar00mjlwheel000000 000000 /* * scamper_control.c * * $Id: scamper_control.c,v 1.196 2017/12/03 09:38:26 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2014 The Regents of the University of California * Copyright (C) 2014-2017 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_control.c,v 1.196 2017/12/03 09:38:26 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_control.h" #include "scamper_debug.h" #include "scamper_fds.h" #include "scamper_linepoll.h" #include "scamper_writebuf.h" #include "scamper_file.h" #include "scamper_outfiles.h" #include "scamper_task.h" #include "scamper_queue.h" #include "scamper_sources.h" #include "scamper_source_file.h" #include "scamper_source_control.h" #include "scamper_source_tsps.h" #include "scamper_privsep.h" #include "mjl_list.h" #include "utils.h" /* hack to deal with lss clear */ #include "scamper_list.h" #include "trace/scamper_trace_do.h" /* * client_obj_t * */ typedef struct client_obj { void *data; size_t len; } client_obj_t; /* * client_txt_t * * string and length, not including null character */ typedef struct client_txt { char *str; size_t len; } client_txt_t; /* * remote_t: struct to define a remote control instance. * * server_name: name/ip address of the remote control server * server_port: port to connect to on the remote control server * fd: file descriptor for an established session * wb: writebuf for the established session * magic: randomly generated magic for the instance * buf: read buf to assemble incoming messages with * bufoff: where in the read buf we are up to * alias: alias assigned by the remote control server to this instance * num: last ID assigned by this instance to identify callbacks */ typedef struct control_remote { char *server_name; int server_port; scamper_fd_t *fd; scamper_writebuf_t *wb; uint8_t magic[8]; uint8_t buf[6+65536]; size_t bufoff; char *alias; uint32_t num; dlist_t *list; struct timeval tx_ka; struct timeval rx_abort; scamper_queue_t *sq; #ifdef HAVE_OPENSSL int mode; SSL *ssl; BIO *rbio; BIO *wbio; #endif } control_remote_t; typedef struct control_unix { char *name; uint32_t num; scamper_fd_t *fd; } control_unix_t; typedef struct control_inet { scamper_fd_t *fd; } control_inet_t; /* * client_t * * this structure records state required to manage a client connected to * scamper via a control socket. */ typedef struct client { /* the mode the client is in: interactive, attached, flush*/ uint8_t mode; /* the type the client is: socket or channel */ uint8_t type; /* node for this client in the list of connected clients */ dlist_node_t *node; /* pointer returned by the source observe code */ void *observe; /* linepoll to process incoming lines of text */ scamper_linepoll_t *lp; /* text strings to pass over socket when able to */ slist_t *txt; union { struct client_sock { struct sockaddr *sa; scamper_fd_t *fdn; scamper_writebuf_t *wb; } sock; struct client_chan { uint32_t id; control_remote_t *rem; dlist_node_t *node; } chan; } un; /* * the next set of variables are used when the client's connection is used * to supply tasks, and is also used to send the results back. * * source: the source allocated to the control socket. * sof: scamper file wrapper for accessing the warts code. * sof_objs: warts objects waiting to be written. * sof_obj: current object partially written over socket. * sof_off: offset into current object being written. * sof_format: the format (warts/json) of results being sent to clients */ scamper_source_t *source; scamper_outfile_t *sof; slist_t *sof_objs; client_obj_t *sof_obj; size_t sof_off; uint8_t sof_format; } client_t; #define CLIENT_MODE_INTERACTIVE 0 #define CLIENT_MODE_ATTACHED 1 #define CLIENT_MODE_FLUSH 2 #define CLIENT_TYPE_SOCKET 0 #define CLIENT_TYPE_CHANNEL 1 #define CLIENT_FORMAT_WARTS 0 #define CLIENT_FORMAT_JSON 1 typedef struct command { char *word; int (*handler)(client_t *client, char *param); } command_t; typedef struct param { char *word; char **var; } param_t; /* * client_list: a doubly linked list of connected clients * ctrl_rem: a remote control instance * ctrl_unix: a local unix domain socket to control scamper * ctrl_inet: an IP socket available to control scamper */ static dlist_t *client_list = NULL; static control_remote_t *ctrl_rem = NULL; static control_unix_t *ctrl_unix = NULL; static control_inet_t *ctrl_inet = NULL; #define CONTROL_MASTER_NEW 0 /* scamper --> remoted */ #define CONTROL_MASTER_ID 1 /* scamper <-- remoted */ #define CONTROL_CHANNEL_NEW 2 /* scamper <-- remoted */ #define CONTROL_CHANNEL_FIN 3 /* scamper <-> remoted */ #define CONTROL_KEEPALIVE 4 /* scamper <-> remoted */ /* forward declare remote_reconnect so that it may be used throughout */ static int remote_reconnect(void *param); static int remote_tx_ka(void *param); static int remote_rx_abort(void *param); /* * global variables for remote control socket where TLS is used * * tls_ctx: TLS context used with the remote controller * */ #ifdef HAVE_OPENSSL #define SSL_MODE_HANDSHAKE 0x00 #define SSL_MODE_ESTABLISHED 0x01 static SSL_CTX *tls_ctx = NULL; #endif static int command_handler(command_t *handler, int cnt, client_t *client, char *word, char *param, int *retval) { int i; for(i=0; idata != NULL) free(obj->data); free(obj); return; } static void client_txt_free(client_txt_t *txt) { if(txt == NULL) return; if(txt->str != NULL) free(txt->str); free(txt); return; } static char *client_sockaddr_tostr(client_t *client, char *buf, size_t len) { assert(client->type == CLIENT_TYPE_SOCKET); /* * if the socket is a unix domain socket, make something up that * is sensible. */ #if defined(AF_UNIX) && !defined(_WIN32) if(client->un.sock.sa->sa_family == AF_UNIX) { if(ctrl_unix->name == NULL) return NULL; snprintf(buf, len, "%s:%d", ctrl_unix->name, ctrl_unix->num++); return buf; } #endif /* * get the name of the connected socket, which is used to name the * source and the outfile */ if(sockaddr_tostr(client->un.sock.sa, buf, len) == NULL) { printerror(0, NULL, __func__, "could not decipher client sockaddr"); return NULL; } return buf; } /* * client_free * * free up client state for the socket handle. */ static void client_free(client_t *client) { int fd; if(client == NULL) return; /* free up the structures for doing socket work with */ if(client->type == CLIENT_TYPE_SOCKET) { if(client->un.sock.fdn != NULL) { fd = scamper_fd_fd_get(client->un.sock.fdn); scamper_fd_free(client->un.sock.fdn); client->un.sock.fdn = NULL; shutdown(fd, SHUT_RDWR); close(fd); } if(client->un.sock.wb != NULL) { scamper_writebuf_free(client->un.sock.wb); client->un.sock.wb = NULL; } if(client->un.sock.sa != NULL) { free(client->un.sock.sa); client->un.sock.sa = NULL; } } else if(client->type == CLIENT_TYPE_CHANNEL) { if(client->un.chan.node != NULL) { dlist_node_pop(client->un.chan.rem->list, client->un.chan.node); client->un.chan.node = NULL; } } if(client->lp != NULL) { scamper_linepoll_free(client->lp, 0); client->lp = NULL; } /* remove the client from the list of clients */ if(client->node != NULL) { dlist_node_pop(client_list, client->node); client->node = NULL; } /* if we are monitoring source events, unobserve */ if(client->observe != NULL) { scamper_sources_unobserve(client->observe); client->observe = NULL; } /* make sure the source is empty before freeing */ if(client->source != NULL) { scamper_source_abandon(client->source); scamper_source_free(client->source); client->source = NULL; } /* cleanup the output file */ if(client->sof != NULL) { scamper_outfile_free(client->sof); client->sof = NULL; } if(client->sof_objs != NULL) { slist_free_cb(client->sof_objs, (slist_free_t)client_obj_free); client->sof_objs = NULL; } if(client->txt != NULL) { slist_free_cb(client->txt, (slist_free_t)client_txt_free); client->txt = NULL; } free(client); return; } static int client_send(client_t *client, char *fs, ...) { char msg[512], *str = NULL; client_txt_t *t = NULL; size_t len, size = sizeof(msg) - 1; va_list ap; int ret; va_start(ap, fs); ret = len = vsnprintf(msg, sizeof(msg), fs, ap); if(len < size) { va_end(ap); str = msg; } else { if((str = malloc_zero((size_t)(len+1))) == NULL) { va_end(ap); goto err; } vsnprintf(str, len+1, fs, ap); va_end(ap); } str[len++] = '\n'; if(str == msg && (str = memdup(msg, len)) == NULL) goto err; if((t = malloc_zero(sizeof(client_txt_t))) == NULL) goto err; if(slist_tail_push(client->txt, t) == NULL) goto err; t->str = str; t->len = len; if(client->type == CLIENT_TYPE_SOCKET) scamper_fd_write_unpause(client->un.sock.fdn); else scamper_fd_write_unpause(ctrl_rem->fd); return ret; err: if(str != NULL && str != msg) free(str); return -1; } /* * param_handler * */ static int param_handler(param_t *handler, int cnt, client_t *client, char *param, char *next) { int i; for(i=0; i", name); return -1; } return 0; } static char *source_tostr(char *str, const size_t len, const scamper_source_t *source) { const char *ptr; char descr[256], outfile[256], type[512], sw1[4]; int i; /* format type-specific data */ switch((i = scamper_source_gettype(source))) { case SCAMPER_SOURCE_TYPE_FILE: snprintf(type, sizeof(type), "type 'file' file '%s' cycles %d autoreload %s", scamper_source_file_getfilename(source), scamper_source_file_getcycles(source), switch_tostr(sw1, sizeof(sw1), scamper_source_file_getautoreload(source))); break; case SCAMPER_SOURCE_TYPE_CMDLINE: snprintf(type, sizeof(type), "type 'cmdline'"); break; case SCAMPER_SOURCE_TYPE_CONTROL: snprintf(type, sizeof(type), "type 'control'"); break; case SCAMPER_SOURCE_TYPE_TSPS: snprintf(type, sizeof(type), "type 'tsps' file '%s'", scamper_source_tsps_getfilename(source)); break; default: printerror(0, NULL, __func__, "unknown source type %d", i); return NULL; } /* if there is a description for the source, then format it in */ if((ptr = scamper_source_getdescr(source)) != NULL) snprintf(descr, sizeof(descr), " descr '%s'", ptr); else descr[0] = '\0'; /* outfile */ if((ptr = scamper_source_getoutfile(source)) != NULL) snprintf(outfile, sizeof(outfile), " outfile '%s'", ptr); else outfile[0] = '\0'; snprintf(str, len, "name '%s'%s list_id %u cycle_id %u priority %u%s %s", scamper_source_getname(source), descr, scamper_source_getlistid(source), scamper_source_getcycleid(source), scamper_source_getpriority(source), outfile, type); return str; } /* * client_data_send * * take a data object and put it on the list of data objects to send. */ static int client_data_send(void *param, const void *vdata, size_t len) { client_t *client = param; client_obj_t *obj = NULL; const uint8_t *data = vdata; scamper_fd_t *fdn; assert(len >= 8); assert(client->sof_objs != NULL); if(client->sof_format == CLIENT_FORMAT_WARTS) { if(data[0] != 0x12 || data[1] != 0x05) { printerror_msg(__func__, "lost synchronisation: %02x%02x %02x%02x %02x%02x%02x%02x", data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]); goto err; } /* cycle end */ if(data[2] == 0 && data[3] == 0x04) client->mode = CLIENT_MODE_FLUSH; } else if(client->sof_format == CLIENT_FORMAT_JSON) { if(data[0] != '{') { printerror_msg(__func__, "lost synchronisation %c", data[0]); goto err; } /* cycle end */ if(strncmp("{\"type\":\"cycle-stop\",", (const char *)data, 21) == 0) client->mode = CLIENT_MODE_FLUSH; } if((obj = malloc_zero(sizeof(client_obj_t))) == NULL) { printerror(__func__, "could not alloc obj"); goto err; } if((obj->data = memdup(vdata, len)) == NULL) { printerror(__func__, "could not memdup"); goto err; } obj->len = len; if(slist_tail_push(client->sof_objs, obj) == NULL) { printerror(__func__, "could not push obj onto list"); goto err; } obj = NULL; if(client->type == CLIENT_TYPE_SOCKET) fdn = client->un.sock.fdn; else fdn = ctrl_rem->fd; if(fdn != NULL) scamper_fd_write_unpause(fdn); return 0; err: client_obj_free(obj); return -1; } static void client_signalmore(void *param) { client_t *client = (client_t *)param; client_send(client, "MORE"); return; } static char *client_tostr(void *param, char *buf, size_t len) { client_t *client = param; size_t off = 0; assert(client->type == CLIENT_TYPE_SOCKET || client->type == CLIENT_TYPE_CHANNEL); buf[0] = '\0'; if(client->type == CLIENT_TYPE_SOCKET) string_concat(buf,len,&off,"fd %d", scamper_fd_fd_get(client->un.sock.fdn)); else string_concat(buf,len,&off,"chan %u", client->un.chan.id); return buf; } /* * command_attach * * the client wants to receive data from measurements over their control * socket connection. * */ #ifndef _WIN32 static int command_attach(client_t *client, char *buf) { scamper_source_params_t ssp; scamper_file_t *sf; char sab[128]; long priority = 1; char *priority_str = NULL, *format = NULL, *params[2], *next; int i, cnt = sizeof(params) / sizeof(char *); param_t handlers[] = { {"priority", &priority_str}, {"format", &format}, }; int handler_cnt = sizeof(handlers) / sizeof(param_t); if(params_get(buf, params, &cnt) != 0) { client_send(client, "ERR could not params_get"); return 0; } for(i=0; i 100000)) { client_send(client, "ERR invalid priority"); return 0; } if(format == NULL) format = "warts"; if(strcasecmp(format, "warts") == 0) { client->sof_format = CLIENT_FORMAT_WARTS; } else if(strcasecmp(format, "json") == 0) { client->sof_format = CLIENT_FORMAT_JSON; } else { client_send(client, "ERR format must be warts or json"); return 0; } if(client_sockaddr_tostr(client, sab, sizeof(sab)) == NULL) goto err; if((client->sof_objs = slist_alloc()) == NULL) { printerror(__func__, "could not alloc objs list"); goto err; } if((client->sof = scamper_outfile_opennull(sab, format)) == NULL) { printerror(__func__, "could not alloc outfile"); goto err; } sf = scamper_outfile_getfile(client->sof); scamper_file_setwritefunc(sf, client, client_data_send); /* create the source */ memset(&ssp, 0, sizeof(ssp)); ssp.list_id = 0; ssp.cycle_id = 1; ssp.priority = priority; ssp.name = sab; ssp.sof = client->sof; if((client->source = scamper_source_control_alloc(&ssp, client_signalmore, client_tostr, client)) == NULL) { printerror(__func__, "could not allocate source '%s'", sab); goto err; } /* put the source into rotation */ if(scamper_sources_add(client->source) != 0) { printerror(__func__, "could not add source '%s' to rotation", sab); goto err; } client->mode = CLIENT_MODE_ATTACHED; client_send(client, "OK"); return 0; err: client_send(client, "ERR internal error"); client_free(client); return 0; } #endif static int command_lss_clear(client_t *client, char *buf) { if(buf == NULL) { client_send(client, "ERR usage: lss-clear [lss-name]"); return 0; } string_nextword(buf); if(scamper_do_trace_dtree_lss_clear(buf) != 0) { return client_send(client, "ERR lss-clear %s failed", buf); } return client_send(client, "OK lss-clear %s", buf); } static int command_exit(client_t *client, char *buf) { client_free(client); return 0; } static int command_get_command(client_t *client, char *buf) { const char *command = scamper_command_get(); if(command == NULL) { return client_send(client, "OK null command"); } return client_send(client, "OK command %s", command); } static int command_get_monitorname(client_t *client, char *buf) { const char *monitorname = scamper_monitorname_get(); if(monitorname == NULL) { return client_send(client, "OK null monitorname"); } return client_send(client, "OK monitorname %s", monitorname); } static int command_get_pid(client_t *client, char *buf) { #ifndef _WIN32 pid_t pid = getpid(); #else DWORD pid = GetCurrentProcessId(); #endif return client_send(client, "OK pid %d", pid); } static int command_get_pps(client_t *client, char *buf) { int pps = scamper_pps_get(); return client_send(client, "OK pps %d", pps); } static int command_get_version(client_t *client, char *buf) { return client_send(client, "OK version " SCAMPER_VERSION); } static int command_get_window(client_t *client, char *buf) { return client_send(client, "OK window %d/%d", scamper_queue_windowcount(), scamper_window_get()); } static int command_get(client_t *client, char *buf) { static command_t handlers[] = { {"command", command_get_command}, {"monitorname", command_get_monitorname}, {"pid", command_get_pid}, {"pps", command_get_pps}, {"version", command_get_version}, {"window", command_get_window}, }; static int handler_cnt = sizeof(handlers) / sizeof(command_t); int ret; if(buf == NULL) { client_send(client, "ERR usage: get " "[command | monitorname | pid | pps | version | window]"); return 0; } if(command_handler(handlers, handler_cnt, client, buf, NULL, &ret) == -1) { client_send(client, "ERR unhandled get command '%s'", buf); return 0; } return 0; } static int command_help(client_t *client, char *buf) { client_send(client, "ERR XXX: todo"); return 0; } static void observe_source_event_add(const scamper_source_event_t *sse, char *buf, const size_t len) { buf[0] = 'a'; buf[1] = 'd'; buf[2] = 'd'; buf[3] = ' '; source_tostr(buf+4, len-4, sse->source); return; } static void observe_source_event_update(const scamper_source_event_t *sse, char *buf, const size_t len) { char autoreload[16]; char cycles[16]; char priority[24]; /* autoreload */ if(sse->sse_update_flags & 0x01) snprintf(autoreload, sizeof(autoreload), " autoreload %d", sse->sse_update_autoreload); else autoreload[0] = '\0'; /* cycles */ if(sse->sse_update_flags & 0x02) snprintf(cycles, sizeof(cycles), " cycles %d", sse->sse_update_cycles); else cycles[0] = '\0'; /* priority */ if(sse->sse_update_flags & 0x04) snprintf(priority, sizeof(priority), " priority %d", sse->sse_update_priority); else priority[0] = '\0'; snprintf(buf, len, "update '%s'%s%s%s", scamper_source_getname(sse->source), autoreload, cycles, priority); return; } static void observe_source_event_cycle(const scamper_source_event_t *sse, char *buf, const size_t len) { snprintf(buf, len, "cycle '%s' id %d", scamper_source_getname(sse->source), sse->sse_cycle_cycle_id); return; } static void observe_source_event_delete(const scamper_source_event_t *sse, char *buf, const size_t len) { snprintf(buf, len, "delete '%s'", scamper_source_getname(sse->source)); return; } static void observe_source_event_finish(const scamper_source_event_t *sse, char *buf, const size_t len) { snprintf(buf, len, "finish '%s'", scamper_source_getname(sse->source)); return; } /* * command_observe_source_cb * * this function is a callback that is used whenever some event occurs * with a source. */ static void command_observe_source_cb(const scamper_source_event_t *sse, void *param) { static void (* const func[])(const scamper_source_event_t *, char *, const size_t) = { observe_source_event_add, observe_source_event_update, observe_source_event_cycle, observe_source_event_delete, observe_source_event_finish, }; client_t *client = (client_t *)param; char buf[512]; size_t len; if(sse->event < 0x01 || sse->event > 0x05) { return; } snprintf(buf, sizeof(buf), "EVENT %u source ", (uint32_t)sse->sec); len = strlen(buf); func[sse->event-1](sse, buf + len, sizeof(buf)-len); client_send(client, "%s", buf); return; } static int command_observe(client_t *client, char *buf) { if(buf == NULL) { client_send(client, "ERR usage: observe [sources]"); return 0; } string_nextword(buf); if(strcasecmp(buf, "sources") != 0) { client_send(client, "ERR usage: observe [sources]"); return 0; } client->observe = scamper_sources_observe(command_observe_source_cb, client); if(client->observe == NULL) { printerror(__func__, "could not observe sources"); client_send(client, "ERR could not observe"); return -1; } client_send(client, "OK"); return 0; } /* * command_outfile_close * * outfile close */ static int command_outfile_close(client_t *client, char *buf) { scamper_outfile_t *sof; if(buf == NULL) { client_send(client, "ERR usage: outfile close "); return 0; } string_nextword(buf); if((sof = scamper_outfiles_get(buf)) == NULL) { client_send(client, "ERR unknown outfile '%s'", buf); return 0; } if(scamper_outfile_close(sof) == -1) { client_send(client, "ERR could not drop outfile: refcnt %d", scamper_outfile_getrefcnt(sof)); return 0; } client_send(client, "OK"); return 0; } static int outfile_foreach(void *param, scamper_outfile_t *sof) { client_t *client = (client_t *)param; scamper_file_t *sf = scamper_outfile_getfile(sof); char *filename = scamper_file_getfilename(sf); if(filename == NULL) filename = "(null)"; client_send(client, "INFO '%s' file '%s' refcnt %d", scamper_outfile_getname(sof), filename, scamper_outfile_getrefcnt(sof)); return 0; } /* * command_outfile_list * * outfile list */ static int command_outfile_list(client_t *client, char *buf) { scamper_outfiles_foreach(client, outfile_foreach); client_send(client, "OK"); return 0; } /* * command_outfile_open * * outfile open name mode file */ static int command_outfile_open(client_t *client, char *buf) { char *params[24]; int i, cnt = sizeof(params) / sizeof(char *); char *file = NULL, *mode = NULL, *name = NULL; char *next; param_t handlers[] = { {"file", &file}, {"mode", &mode}, {"name", &name}, }; int handler_cnt = sizeof(handlers) / sizeof(param_t); if(params_get(buf, params, &cnt) == -1) { client_send(client, "ERR params_get failed"); return -1; } for(i=0; i file " "mode "); return -1; } if(strcasecmp(mode, "truncate") != 0 && strcasecmp(mode, "append") != 0) { client_send(client, "ERR mode must be truncate or append"); return -1; } if(scamper_outfile_open(name, file, mode) == NULL) { client_send(client, "ERR could not add outfile"); return -1; } client_send(client, "OK"); return 0; } /* * outfile socket * * outfile socket name type */ static int command_outfile_socket(client_t *client, char *buf) { char *params[4], *next; int i, fd; int cnt = sizeof(params) / sizeof(char *); char *name = NULL, *type = NULL; param_t handlers[] = { {"name", &name}, {"type", &type}, }; int handler_cnt = sizeof(handlers) / sizeof(param_t); assert(client->type == CLIENT_TYPE_SOCKET); if(params_get(buf, params, &cnt) == -1) { client_send(client, "ERR source add params_get failed"); return -1; } for(i=0; i type "); return 0; } if(scamper_outfiles_get(name) != NULL) { client_send(client, "ERR outfile '%s' already exists", name); return 0; } fd = scamper_fd_fd_get(client->un.sock.fdn); if(scamper_outfile_openfd(name, fd, type) == NULL) { client_send(client, "ERR could not turn socket into outfile"); return 0; } client_send(client, "OK"); return 0; } /* * outfile swap * * swap */ static int command_outfile_swap(client_t *client, char *buf) { scamper_outfile_t *a, *b; char *files[2]; int cnt = 2; if(params_get(buf, files, &cnt) == -1) { client_send(client, "ERR params_get failed"); return -1; } if(cnt != 2) { client_send(client, "ERR usage outfile swap "); return -1; } if((a = scamper_outfiles_get(files[0])) == NULL) { client_send(client, "ERR unknown outfile '%s'", a); return -1; } if((b = scamper_outfiles_get(files[1])) == NULL) { client_send(client, "ERR unknown outfile '%s'", b); return -1; } scamper_outfiles_swap(a, b); client_send(client, "OK"); return 0; } static int command_outfile(client_t *client, char *buf) { static command_t handlers[] = { {"close", command_outfile_close}, {"list", command_outfile_list}, {"open", command_outfile_open}, {"socket", command_outfile_socket}, {"swap", command_outfile_swap}, }; static int handler_cnt = sizeof(handlers) / sizeof(command_t); char *next; int ret; if(buf == NULL) { client_send(client, "ERR usage: outfile [close | list | open | swap]"); return 0; } next = string_nextword(buf); if(command_handler(handlers, handler_cnt, client, buf, next, &ret) == -1) { client_send(client, "ERR unhandled outfile command '%s'", buf); } return 0; } static int command_set_command(client_t *client, char *buf) { if(scamper_command_set(buf) == -1) { client_send(client, "ERR could not set command"); return -1; } client_send(client, "OK"); return 0; } static int command_set_monitorname(client_t *client, char *buf) { if(scamper_monitorname_set(buf) == -1) { client_send(client, "ERR could not set monitorname"); return -1; } client_send(client, "OK"); return 0; } static int command_set_pps(client_t *client, char *buf) { return set_long(client, buf, "pps", scamper_pps_set, SCAMPER_PPS_MIN, SCAMPER_PPS_MAX); } static int command_set_window(client_t *client, char *buf) { return set_long(client, buf, "window", scamper_window_set, SCAMPER_WINDOW_MIN, SCAMPER_WINDOW_MAX); } static int command_set(client_t *client, char *buf) { static command_t handlers[] = { {"command", command_set_command}, {"monitorname", command_set_monitorname}, {"pps", command_set_pps}, {"window", command_set_window}, }; static int handler_cnt = sizeof(handlers) / sizeof(command_t); char *next; int ret; if(buf == NULL) { client_send(client, "ERR usage: " "set [command | monitorname | pps | window]"); return 0; } next = string_nextword(buf); if(command_handler(handlers, handler_cnt, client, buf, next, &ret) == -1) { client_send(client, "ERR unhandled set command '%s'", buf); } return 0; } /* * command_source_add * * this function deals with a control socket adding a new address list file * to scamper. no other type of source is supported with this function. * * source add [name ] [descr ] [list_id ] [cycle_id ] * [priority ] [outfile ] * [command ] [file ] [cycles ] * [autoreload ] */ static int command_source_add(client_t *client, char *buf) { scamper_source_params_t ssp; scamper_source_t *source; char *params[24]; int i, cnt = sizeof(params) / sizeof(char *); char *file = NULL, *name = NULL, *priority = NULL; char *descr = NULL, *list_id = NULL, *cycles = NULL, *autoreload = NULL; char *outfile = NULL, *command = NULL, *cycle_id = NULL; long l; int i_cycles, i_autoreload; char *next; param_t handlers[] = { {"autoreload", &autoreload}, {"command", &command}, {"cycle_id", &cycle_id}, {"cycles", &cycles}, {"descr", &descr}, {"file", &file}, {"list_id", &list_id}, {"name", &name}, {"outfile", &outfile}, {"priority", &priority}, }; int handler_cnt = sizeof(handlers) / sizeof(param_t); if(params_get(buf, params, &cnt) == -1) { client_send(client, "ERR source add params_get failed"); return -1; } for(i=0; i 0x7fffffffL) { client_send(client, "ERR list_id "); return -1; } ssp.list_id = l; } /* sanity check the cycle_id parameter */ if(cycle_id != NULL) { if(string_tolong(cycle_id, &l) == -1 || l < 0 || l > 0x7fffffffL) { client_send(client, "ERR cycle_id "); return -1; } ssp.cycle_id = l; } /* sanity check the priority parameter */ if(priority != NULL) { if(string_tolong(priority, &l) == -1 || l < 0 || l > 0x7fffffff) { client_send(client, "ERR priority "); return -1; } ssp.priority = l; } /* sanity check the autoreload parameter */ if(autoreload != NULL) { if(get_switch(client, "autoreload", autoreload, &l) != 0) { return -1; } i_autoreload = l; } else i_autoreload = 0; /* sanity check the cycle parameter */ if(cycles != NULL) { if(string_tolong(cycles, &l) == -1 || l < 0) { client_send(client, "ERR cycle "); return -1; } i_cycles = l; } else i_cycles = 1; if(command == NULL) command = (char *)scamper_command_get(); if((source = scamper_source_file_alloc(&ssp, file, command, i_cycles, i_autoreload)) == NULL) { client_send(client, "ERR could not alloc source"); return -1; } if(scamper_sources_add(source) != 0) { scamper_source_free(source); client_send(client, "ERR could not add source"); return -1; } scamper_source_free(source); client_send(client, "OK source added"); return 0; } /* * command_source_cycle * * source cycle */ static int command_source_cycle(client_t *client, char *buf) { scamper_source_t *source; char *params[1]; char *name; int cnt = sizeof(params) / sizeof(char *); if(params_get(buf, params, &cnt) == -1) { client_send(client, "ERR source cycle params_get failed"); return -1; } if(cnt != 1) { client_send(client, "ERR missing required parameter for source cycle"); return -1; } name = params[0]; if((source = scamper_sources_get(name)) == NULL) { client_send(client, "ERR no source '%s'", name); return -1; } if(scamper_source_cycle(source) == -1) { client_send(client, "ERR could not cycle source '%s'", name); return -1; } client_send(client, "OK"); return 0; } /* * command_source_delete * * source delete */ static int command_source_delete(client_t *client, char *buf) { scamper_source_t *source; char *name; char *params[1]; int cnt = sizeof(params) / sizeof(char *); if(params_get(buf, params, &cnt) == -1) { client_send(client, "ERR source delete params_get failed"); return -1; } if(cnt != 1) { client_send(client, "ERR missing required parameter for source delete"); return -1; } name = params[0]; if((source = scamper_sources_get(name)) == NULL) { client_send(client, "ERR unknown source '%s'", params[0]); return -1; } if(scamper_sources_del(source) == -1) { client_send(client, "ERR could not delete source '%s'", name); return -1; } client_send(client, "OK source '%s' deleted", name); return 0; } static int source_foreach(void *param, scamper_source_t *source) { client_t *client = (client_t *)param; char str[1024]; if(source_tostr(str, sizeof(str), source) != NULL) { client_send(client, "INFO %s", str); } return 0; } /* * command_source_list * * source list [] * */ static int command_source_list(client_t *client, char *buf) { scamper_source_t *source; char *params[1], str[1024]; char *name; int cnt = sizeof(params) / sizeof(char *); /* if there is no parameter, then dump all lists */ if(buf == NULL) { scamper_sources_foreach(client, source_foreach); client_send(client, "OK"); return 0; } /* if there is a parameter, then use that to find a source */ if(params_get(buf, params, &cnt) == -1 || cnt != 1) { client_send(client, "ERR source check params_get failed"); return -1; } name = params[0]; if((source = scamper_sources_get(name)) == NULL) { client_send(client, "ERR no source '%s'", name); return 0; } client_send(client, "INFO %s", source_tostr(str, sizeof(str), source)); client_send(client, "OK"); return 0; } /* * command_source_update * * source update [priority ] * [autoreload ] [cycles ] * */ static int command_source_update(client_t *client, char *buf) { scamper_source_t *source; char *autoreload = NULL, *cycles = NULL, *priority = NULL; int i_autoreload, i_cycles; long l; int i, cnt, handler_cnt; char *params[10], *next; param_t handlers[] = { {"autoreload", &autoreload}, {"cycles", &cycles}, {"priority", &priority}, }; if(buf == NULL) { client_send(client, "ERR missing name parameter"); return 0; } cnt = sizeof(params) / sizeof(char *); if(params_get(buf, params, &cnt) == -1) { client_send(client, "ERR source update params_get failed"); return -1; } /* the name parameter should be in parameter zero */ if(cnt < 1) { client_send(client, "ERR missing name parameter"); return 0; } /* find the source */ if((source = scamper_sources_get(params[0])) == NULL) { client_send(client, "ERR no such source '%s'", params[0]); return 0; } /* parse out each parameter */ for(i=1; i"); return 0; } i_autoreload = l; } if(cycles != NULL) { if(string_tolong(cycles, &l) == -1 || l < 0) { client_send(client, "ERR cycles "); return 0; } i_cycles = l; } } if(priority != NULL) { if(string_tolong(priority, &l) == -1 || l < 0) { client_send(client, "ERR priority "); return 0; } scamper_source_setpriority(source, (uint32_t)l); } if(autoreload != NULL || cycles != NULL) { scamper_source_file_update(source, (autoreload != NULL ? &i_autoreload : NULL), (cycles != NULL ? &i_cycles : NULL)); } client_send(client, "OK"); return 0; } static int command_source(client_t *client, char *buf) { static command_t handlers[] = { {"add", command_source_add}, {"cycle", command_source_cycle}, {"delete", command_source_delete}, {"list", command_source_list}, {"update", command_source_update}, }; static int handler_cnt = sizeof(handlers) / sizeof(command_t); char *next; int ret; if(buf == NULL) { client_send(client, "ERR usage: source [add | cycle | delete | list | update]"); return 0; } next = string_nextword(buf); if(command_handler(handlers, handler_cnt, client, buf, next, &ret) == -1) { client_send(client, "ERR unhandled command '%s'", buf); return 0; } return 0; } static int command_shutdown_cancel(client_t *client, char *buf) { scamper_exitwhendone(0); client_send(client, "OK"); return 0; } static int command_shutdown_done(client_t *client, char *buf) { scamper_exitwhendone(1); client_send(client, "OK"); return 0; } static int command_shutdown_flush(client_t *client, char *buf) { /* empty the address list of all sources */ scamper_sources_empty(); /* tell scamper to exit when it has finished probing the existing window */ scamper_exitwhendone(1); client_send(client, "OK"); return 0; } static int command_shutdown_now(client_t *client, char *buf) { /* empty the active trace window */ scamper_queue_empty(); /* empty the address list of all sources */ scamper_sources_empty(); /* tell scamper to exit when it has finished probing the existing window */ scamper_exitwhendone(1); client_send(client, "OK"); return 0; } static int command_shutdown(client_t *client, char *buf) { static command_t handlers[] = { {"cancel", command_shutdown_cancel}, {"done", command_shutdown_done}, {"flush", command_shutdown_flush}, {"now", command_shutdown_now}, }; static int handler_cnt = sizeof(handlers) / sizeof(command_t); char *next; int ret; if(buf == NULL) { client_send(client, "ERR usage: [cancel | done | flush | now]"); return 0; } next = string_nextword(buf); if(command_handler(handlers, handler_cnt, client, buf, next, &ret) == -1) { client_send(client, "ERR unhandled command '%s'", buf); return 0; } return 0; } static int client_isdone(client_t *client) { size_t len; int c; if(client->type == CLIENT_TYPE_SOCKET && (len = scamper_writebuf_len(client->un.sock.wb)) != 0) { scamper_debug(__func__, "client writebuf len %d", len); return 0; } if(client->source != NULL && scamper_source_isfinished(client->source) == 0) { scamper_debug(__func__, "source not finished"); return 0; } if(client->sof_obj != NULL) { scamper_debug(__func__, "object partially written"); return 0; } if(client->sof_objs != NULL && (c = slist_count(client->sof_objs)) != 0) { scamper_debug(__func__, "objects outstanding %d", c); return 0; } return 1; } /* * client_attached_cb * * this callback is used when a control socket has been 'attached' such that * it sends commands over the control socket and in return it obtains * results. */ static int client_attached_cb(client_t *client, uint8_t *buf, size_t len) { char *str; long l; uint32_t id; assert(client->source != NULL); /* the control socket will not be supplying any more tasks */ if(len == 4 && strcasecmp((char *)buf, "done") == 0) { client_send(client, "OK"); scamper_source_control_finish(client->source); return 0; } if(len >= 5 && strncasecmp((char *)buf, "halt ", 5) == 0) { str = string_nextword((char *)buf); if(string_isnumber(str) == 0) return client_send(client, "ERR usage: halt [id]"); if(string_tolong(str, &l) != 0 || l <= 0 || l > 0xffffffffUL) return client_send(client, "ERR halt number invalid"); id = l; if(scamper_source_halttask(client->source, id) != 0) return client_send(client, "ERR no task id-%d", id); return client_send(client, "OK halted %ld", id); } /* try the command to see if it is valid and acceptable */ if(scamper_source_command2(client->source, (char *)buf, &id) != 0) return client_send(client, "ERR command not accepted"); return client_send(client, "OK id-%d", id); } static int client_interactive_cb(client_t *client, uint8_t *buf, size_t len) { static command_t handlers[] = { #ifndef _WIN32 {"attach", command_attach}, #endif {"exit", command_exit}, {"get", command_get}, {"help", command_help}, {"lss-clear", command_lss_clear}, {"observe", command_observe}, {"outfile", command_outfile}, {"set", command_set}, {"shutdown", command_shutdown}, {"source", command_source}, }; static int handler_cnt = sizeof(handlers) / sizeof(command_t); char *next; int ret; /* XXX: should check for null? */ next = string_nextword((char *)buf); if(command_handler(handlers,handler_cnt,client,(char *)buf,next,&ret) == -1) { client_send(client, "ERR unhandled command '%s'", buf); return 0; } return 0; } /* * client_read_line * * callback passed to the client's linepoll instance, which is used to read * incoming commands. the current mode the client is in determines how the * command is actually handled. */ static int client_read_line(void *param, uint8_t *buf, size_t len) { static int (*const func[])(client_t *, uint8_t *, size_t) = { client_interactive_cb, /* CLIENT_MODE_INTERACTIVE == 0x00 */ client_attached_cb, /* CLIENT_MODE_ATTACHED == 0x01 */ NULL, /* CLIENT_MODE_FLUSH == 0x02 */ }; client_t *client = (client_t *)param; /* make sure all the characters in the string are printable */ if(string_isprint((char *)buf, len) == 0) { if(client->source != NULL) { scamper_source_control_finish(client->source); scamper_source_abandon(client->source); } client_send(client, "ERR invalid character in line"); client->mode = CLIENT_MODE_FLUSH; return 0; } if(func[client->mode] != NULL) return func[client->mode](client, buf, len); return 0; } static client_t *client_alloc(uint8_t type) { client_t *client = NULL; if((client = malloc_zero(sizeof(client_t))) == NULL) goto err; client->type = type; if((client->node = dlist_tail_push(client_list, client)) == NULL || (client->lp = scamper_linepoll_alloc(client_read_line, client)) == NULL || (client->txt = slist_alloc()) == NULL) goto err; return client; err: if(client != NULL) client_free(client); return NULL; } static void client_read(const int fd, client_t *client) { ssize_t rrc; uint8_t buf[4096]; assert(client->type == CLIENT_TYPE_SOCKET); assert(scamper_fd_fd_get(client->un.sock.fdn) == fd); /* handle error conditions */ if((rrc = read(fd, buf, sizeof(buf))) < 0) { if(errno == EAGAIN || errno == EINTR) return; printerror(__func__, "could not read from %d", fd); client_free(client); return; } /* handle disconnection */ if(rrc == 0) { scamper_fd_read_pause(client->un.sock.fdn); if(client->source != NULL) { scamper_source_control_finish(client->source); scamper_source_abandon(client->source); } if(client_isdone(client) != 0) client_free(client); else client->mode = CLIENT_MODE_FLUSH; return; } scamper_linepoll_handle(client->lp, buf, (size_t)rrc); return; } static int client_writebuf_send(client_t *client, void *buf, size_t len) { assert(client->type == CLIENT_TYPE_SOCKET); return scamper_writebuf_send(client->un.sock.wb, buf, len); } static int client_write_do(client_t *client, int (*sendfunc)(client_t *, void *, size_t)) { client_txt_t *t = NULL; client_obj_t *o = NULL; uint8_t data[8192]; char str[64]; size_t len; int rc; if(client->sof_off == 0) { while((t = slist_head_pop(client->txt)) != NULL) { rc = sendfunc(client, t->str, t->len); client_txt_free(t); t = NULL; if(rc != 0) return -1; } /* check if we should start sending through a completed task */ if(client->sof_objs != NULL && (o = slist_head_pop(client->sof_objs)) != NULL) { client->sof_obj = o; if(client->sof_format == CLIENT_FORMAT_WARTS) len = snprintf(str, sizeof(str), "DATA %d\n", (int)uuencode_len(o->len, NULL, NULL)); else len = snprintf(str, sizeof(str), "DATA %d\n", (int)o->len); if(sendfunc(client, str, len) < 0) { printerror(__func__, "could not send DATA header"); return -1; } } } else { o = client->sof_obj; } if(o != NULL) { if(client->sof_format == CLIENT_FORMAT_WARTS) { len = uuencode_bytes(o->data, o->len, &client->sof_off, data, sizeof(data)); } else { if((len = o->len - client->sof_off) > sizeof(data)) len = sizeof(data); memcpy(data, o->data + client->sof_off, len); client->sof_off += len; } if(client->sof_off == o->len) { client_obj_free(o); client->sof_obj = NULL; client->sof_off = 0; } if(sendfunc(client, data, len) != 0) { printerror(__func__, "could not send %d bytes", len); return -1; } } return 0; } static void client_write(const int fd, client_t *client) { assert(client->type == CLIENT_TYPE_SOCKET); assert(scamper_fd_fd_get(client->un.sock.fdn) == fd); /* * if there is nothing buffered in the writebuf, then put some more * in there. */ if(scamper_writebuf_len(client->un.sock.wb) == 0 && client_write_do(client, client_writebuf_send) != 0) goto err; if(scamper_writebuf_write(fd, client->un.sock.wb) != 0) { printerror(__func__, "fd %d", fd); goto err; } /* * do we have anything more to write for this client at this time? * if not, pause the polling for write events, and check if we're * going to have anything more at all. */ if(scamper_writebuf_len(client->un.sock.wb) == 0 && slist_count(client->txt) == 0 && client->sof_off == 0 && (client->sof_objs == NULL || slist_count(client->sof_objs) == 0)) { scamper_fd_write_pause(client->un.sock.fdn); if(client->mode == CLIENT_MODE_FLUSH && client_isdone(client) != 0) client_free(client); } return; err: client_free(client); return; } /* * remote_list_onremove * */ static void remote_list_onremove(client_t *client) { assert(client->type == CLIENT_TYPE_CHANNEL); client->un.chan.node = NULL; return; } /* * remote_free * * if all is zero, only state for a given socket is free'd, not all * of the structure. */ static void remote_free(control_remote_t *rm, int all) { client_t *client; int fd; /* go through the client list, freeing any remaining client structures */ while((client = dlist_head_pop(rm->list)) != NULL) client_free(client); #ifdef HAVE_OPENSSL if(rm->ssl != NULL) { SSL_free(rm->ssl); } else { if(rm->wbio != NULL) BIO_free(rm->wbio); if(rm->rbio != NULL) BIO_free(rm->rbio); } #endif if(rm->fd != NULL) { fd = scamper_fd_fd_get(rm->fd); scamper_fd_free(rm->fd); rm->fd = NULL; shutdown(fd, SHUT_RDWR); close(fd); } if(rm->wb != NULL) { scamper_writebuf_free(rm->wb); rm->wb = NULL; } if(rm->alias != NULL) { free(rm->alias); rm->alias = NULL; } if(all == 0) return; if(rm->sq != NULL) { scamper_queue_free(rm->sq); rm->sq = NULL; } if(rm->server_name != NULL) { free(rm->server_name); rm->server_name = NULL; } if(rm->alias != NULL) { free(rm->alias); rm->alias = NULL; } if(rm->list != NULL) { dlist_free(rm->list); rm->list = NULL; } free(rm); return; } /* * remote_retry: * * the master control socket went away, schedule a reconnect. */ static int remote_retry(int now) { struct timeval tv; uint8_t u8; /* free just the state for a given socket, not all of the structure */ remote_free(ctrl_rem, 0); gettimeofday_wrap(&tv); if(now == 0) { random_u8(&u8); tv.tv_sec += 60 + u8; scamper_debug(__func__, "waiting for %u seconds", 60 + u8); } scamper_queue_event_update_time(ctrl_rem->sq, &tv); scamper_queue_event_update_cb(ctrl_rem->sq, remote_reconnect, NULL); return 0; } #ifdef HAVE_OPENSSL /* * remote_sock_ssl_want_read * * the OpenSSL routines told us to do a read from the socket. */ static int remote_sock_ssl_want_read(control_remote_t *rm) { uint8_t buf[1024]; int pending, rc, size, off = 0; if((pending = BIO_pending(rm->wbio)) < 0) { scamper_debug(__func__, "BIO_pending returns %d", pending); return -1; } while(off < pending) { if(pending - off > sizeof(buf)) size = sizeof(buf); else size = pending - off; if((rc = BIO_read(rm->wbio, buf, size)) <= 0) { if(BIO_should_retry(rm->wbio) == 0) scamper_debug(__func__, "BIO_read should not retry"); else scamper_debug(__func__, "BIO_read returned %d", rc); return -1; } off += rc; scamper_writebuf_send(rm->wb, buf, rc); } if(pending != 0) scamper_fd_write_unpause(rm->fd); return pending; } /* * remote_sock_ssl_init * * initialise the remote socket's SSL state. */ static int remote_sock_ssl_init(control_remote_t *rm) { int rc; if((rm->wbio = BIO_new(BIO_s_mem())) == NULL || (rm->rbio = BIO_new(BIO_s_mem())) == NULL || (rm->ssl = SSL_new(tls_ctx)) == NULL) { scamper_debug(__func__, "could not create bios / ssl"); return -1; } SSL_set_bio(rm->ssl, rm->rbio, rm->wbio); SSL_set_connect_state(rm->ssl); rc = SSL_do_handshake(rm->ssl); assert(rc <= 0); if((rc = SSL_get_error(rm->ssl, rc)) == SSL_ERROR_WANT_READ && remote_sock_ssl_want_read(rm) < 0) return -1; return 0; } /* * remote_sock_is_valid_cert: * * this code ensures that the peer presented a valid certificate -- * first that the peer verified and passed a signed certificate, and * then that the name provided in the cert corresponds to the name of * our peer. * * it is based on post_connection_check in "Network Security with * OpenSSL" by John Viega, Matt Messier, and Pravir Chandra. */ #if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L static int remote_sock_is_valid_cert(control_remote_t *rm) { X509 *cert = NULL; X509_EXTENSION *ext; X509_NAME *name; const X509V3_EXT_METHOD *meth; STACK_OF(CONF_VALUE) *val; CONF_VALUE *nval; const char *str; char buf[256]; int rc = 0; int i, j; if(SSL_get_verify_result(rm->ssl) != X509_V_OK) { scamper_debug(__func__, "invalid certificate"); return 0; } if((cert = SSL_get_peer_certificate(rm->ssl)) == NULL) { scamper_debug(__func__, "no peer certificate"); return 0; } for(i=0; ii2v == NULL || meth->d2i == NULL) continue; val = meth->i2v(meth, meth->d2i(NULL, (const unsigned char **)&ext->value->data, ext->value->length), NULL); for(j=0; jname, "DNS") == 0 && strcasecmp(nval->value, rm->server_name) == 0) { rc = 1; goto done; } } } if((name = X509_get_subject_name(cert)) != NULL && X509_NAME_get_text_by_NID(name, NID_commonName, buf, sizeof(buf)) > 0) { buf[sizeof(buf)-1] = 0; if(strcasecmp(buf, rm->server_name) == 0) { rc = 1; } } done: if(cert != NULL) X509_free(cert); return rc; } #endif /* OpenSSL version < 1.1.0 */ #endif /* * remote_sock_send * */ static int remote_sock_send(control_remote_t *rm, void *ptr, size_t len) { #ifdef HAVE_OPENSSL if(rm->ssl != NULL) { SSL_write(rm->ssl, ptr, len); remote_sock_ssl_want_read(rm); return 0; } #endif return scamper_writebuf_send(rm->wb, ptr, len); } /* * remote_rx_abort * * we have not received anything in some time from the remote controller. * assume the TCP socket got broken. schedule a reconnect. */ static int remote_rx_abort(void *param) { return remote_retry(1); } /* * remote_tx_ka * * we have not sent anything in some time to the remote controller. * send a keepalive to keep the socket going. */ static int remote_tx_ka(void *param) { uint8_t buf[4+2+1]; bytes_htonl(buf+0, 0); bytes_htons(buf+4, 1); buf[6] = CONTROL_KEEPALIVE; remote_sock_send(ctrl_rem, buf, sizeof(buf)); scamper_fd_write_unpause(ctrl_rem->fd); return 0; } /* * remote_event_queue * * set the appropriate event handler */ static int remote_event_queue(control_remote_t *rm) { #ifdef HAVE_OPENSSL if(rm->ssl != NULL && rm->mode != SSL_MODE_ESTABLISHED) { scamper_queue_event_update_cb(rm->sq, remote_rx_abort, NULL); scamper_queue_event_update_time(rm->sq, &rm->rx_abort); return 0; } #endif if(timeval_cmp(&rm->tx_ka, &rm->rx_abort) <= 0) { scamper_queue_event_update_cb(rm->sq, remote_tx_ka, NULL); scamper_queue_event_update_time(rm->sq, &rm->tx_ka); } else { scamper_queue_event_update_cb(rm->sq, remote_rx_abort, NULL); scamper_queue_event_update_time(rm->sq, &rm->rx_abort); } return 0; } static client_t *remote_channel_find(control_remote_t *rem, uint32_t id) { dlist_node_t *dn; client_t *client; for(dn=dlist_head_node(rem->list); dn != NULL; dn=dlist_node_next(dn)) { client = dlist_node_item(dn); assert(client->type == CLIENT_TYPE_CHANNEL); if(client->un.chan.id == id) return client; } return NULL; } static int remote_read_control_id(const uint8_t *buf, size_t len) { uint8_t id_len; uint8_t off; if(ctrl_rem->alias != NULL) { free(ctrl_rem->alias); ctrl_rem->alias = NULL; } if(len < 1) return -1; if((id_len = buf[0]) == 0) return -1; buf++; len--; /* ensure the message could contain the specified number of bytes */ if(len < id_len) return -1; off = 0; while(off < id_len-1 && off < len) if(isprint(buf[off++]) == 0) return -1; if(buf[id_len-1] != '\0') return -1; if((ctrl_rem->alias = memdup(buf, id_len)) == NULL) return -1; scamper_debug(__func__, "remote alias: %s", ctrl_rem->alias); return 0; } static int remote_read_control_channel_new(const uint8_t *buf, size_t len) { scamper_source_params_t ssp; scamper_file_t *sf; client_t *client = NULL; char listname[512]; uint32_t channel; if(len != 4) return -1; channel = bytes_ntohl(buf); snprintf(listname,sizeof(listname), "%s_%u", ctrl_rem->alias,ctrl_rem->num++); if((client = client_alloc(CLIENT_TYPE_CHANNEL)) == NULL || (client->sof_objs = slist_alloc()) == NULL || (client->sof = scamper_outfile_opennull(listname, "warts")) == NULL) goto err; client->un.chan.id = channel; client->un.chan.rem = ctrl_rem; client->mode = CLIENT_MODE_ATTACHED; sf = scamper_outfile_getfile(client->sof); scamper_file_setwritefunc(sf, client, client_data_send); memset(&ssp, 0, sizeof(ssp)); ssp.list_id = 0; ssp.cycle_id = 1; ssp.priority = 1; ssp.name = (char *)listname; ssp.sof = client->sof; if((client->source = scamper_source_control_alloc(&ssp, client_signalmore, client_tostr, client)) == NULL) { printerror(__func__, "could not allocate source '%s'", listname); goto err; } /* put the source into rotation */ if(scamper_sources_add(client->source) != 0) { printerror(__func__, "could not add source '%s' to rotation", listname); goto err; } if((client->un.chan.node = dlist_tail_push(ctrl_rem->list, client)) == NULL) { printerror(__func__, "could not add client to remote list"); goto err; } client->un.chan.rem = ctrl_rem; return 0; err: if(client != NULL) client_free(client); return -1; } /* * remote_read_control_channel_fin * * */ static int remote_read_control_channel_fin(const uint8_t *buf, size_t len) { client_t *client; uint32_t channel; if(len != 4) { scamper_debug(__func__, "malformed fin: %u", (unsigned int)len); return -1; } channel = bytes_ntohl(buf); scamper_debug(__func__, "channel %u", channel); if((client = remote_channel_find(ctrl_rem, channel)) == NULL) { scamper_debug(__func__, "could not find channel %u", channel); return -1; } scamper_source_control_finish(client->source); return 0; } static int remote_read_control_keepalive(const uint8_t *buf, size_t len) { if(len != 0) return -1; return 0; } static int remote_read_control(const uint8_t *buf, size_t len) { uint8_t type; if(len < 1) return -1; type = buf[0]; buf++; len--; switch(type) { case CONTROL_MASTER_ID: return remote_read_control_id(buf, len); case CONTROL_CHANNEL_NEW: return remote_read_control_channel_new(buf, len); case CONTROL_CHANNEL_FIN: return remote_read_control_channel_fin(buf, len); case CONTROL_KEEPALIVE: return remote_read_control_keepalive(buf, len); } return -1; } /* * remote_read_payload * * process a payload from reading the remote control socket. the * payload has gone through OpenSSL before reaching here, if used. */ static int remote_read_payload(control_remote_t *rm, const uint8_t *buf, size_t len) { client_t *client; uint16_t msglen, x, y; uint32_t channel_id; size_t off = 0; while(off < len) { /* to start with, ensure that we have a complete header */ while(rm->bufoff < 6 && off < len) rm->buf[rm->bufoff++] = buf[off++]; if(off == len) return 0; /* figure out how large the message is supposed to be */ msglen = bytes_ntohs(rm->buf+4); /* figure out how to build the message */ x = msglen - (rm->bufoff - 6); y = len - off; if(y < x) { /* if we cannot complete the message, buffer what we have */ memcpy(rm->buf + rm->bufoff, buf+off, y); rm->bufoff += y; return 0; } /* we now have a complete message */ channel_id = bytes_ntohl(rm->buf); memcpy(rm->buf + rm->bufoff, buf+off, x); off += x; rm->bufoff = 0; /* if the message is a control message */ if(channel_id == 0) { if(remote_read_control(rm->buf + 6, msglen) != 0) return -1; continue; } if((client = remote_channel_find(rm, channel_id)) == NULL) { scamper_debug(__func__, "could not find channel %u", channel_id); return -1; } scamper_linepoll_handle(client->lp, rm->buf + 6, msglen); } return 0; } /* * remote_send_master * */ static int remote_send_master(control_remote_t *rm) { const char *monitorname = scamper_monitorname_get(); size_t off, len; uint8_t buf[512]; if(monitorname != NULL) { if(strlen(monitorname) > 254) return -1; off = 0; while(monitorname[off] != '\0') { if(isalnum(monitorname[off]) == 0 && monitorname[off] != '.' && monitorname[off] != '-') return -1; off++; } } off = 0; len = 1 + 1 + 8 + 1 + (monitorname != NULL ? strlen(monitorname) + 1 : 0); bytes_htonl(buf+off, 0); off += 4; bytes_htons(buf+off, len); off += 2; buf[off++] = CONTROL_MASTER_NEW; buf[off++] = 8; /* length of magic */ memcpy(buf+off, rm->magic, 8); off += 8; if(monitorname != NULL) { len = strlen(monitorname) + 1; buf[off++] = len; memcpy(buf+off, monitorname, len); len += 1 + 1 + 8 + 1; } else { buf[off++] = 0; } len += 6; return remote_sock_send(ctrl_rem, buf, len); } /* * remote_read_sock * * handle a read event on remote control socket. this function steps * through TLS negotiation and decryption. * * returns zero if the socket was disconnected, 1 if there was no error, * and -1 on error. */ static int remote_read_sock(control_remote_t *rm) { ssize_t rrc; uint8_t buf[4096]; int fd = scamper_fd_fd_get(rm->fd); #ifdef HAVE_OPENSSL int rc; #endif if((rrc = read(fd, buf, sizeof(buf))) < 0) { if(errno == EAGAIN || errno == EINTR) return 1; printerror(__func__, "could not read from %d", fd); return -1; } if(rrc == 0) { scamper_debug(__func__, "disconnected fd %d", fd); return 0; } #ifdef HAVE_OPENSSL if(rm->ssl != NULL) { BIO_write(rm->rbio, buf, rrc); if(rm->mode == SSL_MODE_HANDSHAKE) { if(SSL_is_init_finished(rm->ssl) != 0 || (rc = SSL_do_handshake(rm->ssl)) > 0) { #if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L if(remote_sock_is_valid_cert(rm) == 0) return -1; #endif rm->mode = SSL_MODE_ESTABLISHED; } if(remote_sock_ssl_want_read(rm) < 0) return -1; } else if(rm->mode == SSL_MODE_ESTABLISHED) { while((rc = SSL_read(rm->ssl, buf, sizeof(buf))) > 0) { if(remote_read_payload(rm, buf, (size_t)rc) != 0) return -1; } if(remote_sock_ssl_want_read(rm) < 0) return -1; } return 1; } #endif if(remote_read_payload(rm, buf, (size_t)rrc) != 0) return -1; return 1; } /* * remote_read * * this function handles read events on the master control socket back * to the remote controller. it does not handle regular client socket * traffic. * */ static void remote_read(const int fd, void *param) { #ifdef HAVE_OPENSSL int enter_mode = ctrl_rem->mode; #endif struct timeval tv; int rc; assert(scamper_fd_fd_get(ctrl_rem->fd) == fd); if((rc = remote_read_sock(ctrl_rem)) < 0) goto retry; if(rc == 0) { scamper_debug(__func__, "disconnected fd %d", fd); goto retry; } gettimeofday_wrap(&tv); timeval_add_s(&ctrl_rem->rx_abort, &tv, 60); remote_event_queue(ctrl_rem); #ifdef HAVE_OPENSSL /* when TLS has completed, we need to enter into the attach mode */ if(ctrl_rem->ssl != NULL && enter_mode == SSL_MODE_HANDSHAKE && ctrl_rem->mode == SSL_MODE_ESTABLISHED) { scamper_debug(__func__, "remote established"); if(remote_send_master(ctrl_rem) != 0) goto retry; } #endif return; retry: remote_retry(0); return; } static int client_channel_send(client_t *client, void *buf, size_t len) { uint8_t hdr[4+2]; assert(client->type == CLIENT_TYPE_CHANNEL); if(len > 65535) return -1; bytes_htonl(hdr+0, client->un.chan.id); bytes_htons(hdr+4, len); if(remote_sock_send(ctrl_rem, hdr, 6) < 0 || remote_sock_send(ctrl_rem, buf, len) < 0) return -1; return 0; } static void remote_write(const int fd, void *param) { struct timeval tv; dlist_node_t *dn; client_t *client; uint8_t buf[4+2+1+4]; int rc = 0; /* * if there is nothing buffered in the writebuf, then put some more * in there. */ if(scamper_writebuf_gtzero(ctrl_rem->wb) == 0) { /* if there are no clients, then we won't have anything to send */ if(dlist_head_node(ctrl_rem->list) == NULL) { scamper_fd_write_pause(ctrl_rem->fd); return; } /* * take a pass through the clients, getting something from each * connected channel, if available */ dn = dlist_head_node(ctrl_rem->list); while(dn != NULL) { client = dlist_node_item(dn); dn = dlist_node_next(dn); if(client->mode == CLIENT_MODE_FLUSH && client_isdone(client) != 0) { /* construct a channel FIN message */ bytes_htonl(buf+0, 0); bytes_htons(buf+4, 5); buf[6] = CONTROL_CHANNEL_FIN; bytes_htonl(buf+7, client->un.chan.id); /* don't need the client anymore */ client_free(client); /* send the FIN */ if(remote_sock_send(ctrl_rem, buf, sizeof(buf)) != 0) goto err; continue; } if((rc = client_write_do(client, client_channel_send)) != 0) goto err; } /* if there is still nothing in the writebuf, then pause for now */ if(scamper_writebuf_gtzero(ctrl_rem->wb) == 0) { scamper_fd_write_pause(ctrl_rem->fd); return; } } if(scamper_writebuf_write(fd, ctrl_rem->wb) != 0) goto err; gettimeofday_wrap(&tv); timeval_add_s(&ctrl_rem->tx_ka, &tv, 30); remote_event_queue(ctrl_rem); return; err: remote_retry(0); return; } /* * remote_connect * * this function is tasked with establishing a connection to a remote * control server. it tries to negotiate SSL, if that is requested. * if the connect fails, the code schedules a retry for a later time. * */ static int remote_connect(void) { struct addrinfo hints, *res, *res0 = NULL; struct timeval tv; char port[8]; int rc, fd = -1, opt; snprintf(port, sizeof(port), "%d", ctrl_rem->server_port); memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; if((rc = getaddrinfo(ctrl_rem->server_name, port, &hints, &res0)) != 0) { printerror_gai(__func__, rc, "could not getaddrinfo %s:%s", ctrl_rem->server_name, port); remote_retry(0); goto done; } for(res=res0; res != NULL; res = res->ai_next) { if((fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) continue; if(connect(fd, res->ai_addr, res->ai_addrlen) != 0) { close(fd); fd = -1; continue; } break; } if(fd < 0) { printerror(__func__, "could not connect to %s:%s", ctrl_rem->server_name, port); remote_retry(0); goto done; } opt = 1; if(setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&opt,sizeof(opt)) != 0) { printerror(__func__, "could not set TCP_NODELAY"); close(fd); goto err; } #ifdef O_NONBLOCK if(fcntl_set(fd, O_NONBLOCK) != 0) { printerror(__func__, "could not set O_NONBLOCK"); close(fd); goto err; } #endif if((ctrl_rem->fd=scamper_fd_private(fd,NULL,remote_read,remote_write))==NULL) { printerror(__func__, "could not add fd"); goto err; } if((ctrl_rem->wb = scamper_writebuf_alloc()) == NULL) { printerror(__func__, "could not alloc wb"); goto err; } if(scamper_option_tls() == 0) { remote_send_master(ctrl_rem); scamper_fd_write_unpause(ctrl_rem->fd); } else { #ifdef HAVE_OPENSSL if(remote_sock_ssl_init(ctrl_rem) != 0) goto err; #else goto err; #endif } gettimeofday_wrap(&tv); timeval_add_s(&ctrl_rem->rx_abort, &tv, 60); timeval_add_s(&ctrl_rem->tx_ka, &tv, 30); remote_event_queue(ctrl_rem); done: if(res0 != NULL) freeaddrinfo(res0); return 0; err: if(res0 != NULL) freeaddrinfo(res0); return -1; } static int remote_reconnect(void *param) { return remote_connect(); } static void control_accept(const int fd, void *param) { struct sockaddr_storage ss; socklen_t socklen; client_t *c = NULL; int s; /* accept the new client */ socklen = sizeof(ss); if((s = accept(fd, (struct sockaddr *)&ss, &socklen)) == -1) { printerror(__func__, "could not accept"); return; } scamper_debug(__func__, "fd %d", s); /* make the socket non-blocking, so a read or write will not hang scamper */ #ifndef _WIN32 if(fcntl_set(s, O_NONBLOCK) == -1) { printerror(__func__, "could not set NONBLOCK"); goto err; } #endif /* allocate the structure that holds the socket/client together */ if((c = client_alloc(CLIENT_TYPE_SOCKET)) == NULL || (c->un.sock.wb = scamper_writebuf_alloc()) == NULL || (c->un.sock.sa = memdup(&ss, socklen)) == NULL || (c->un.sock.fdn = scamper_fd_private(s, c, (scamper_fd_cb_t)client_read, (scamper_fd_cb_t)client_write)) == NULL) { printerror(__func__, "could not alloc client"); goto err; } scamper_fd_write_pause(c->un.sock.fdn); c->mode = CLIENT_MODE_INTERACTIVE; return; err: close(s); if(c != NULL) client_free(c); return; } int scamper_control_add_remote(const char *name, int port) { uint32_t u32; #if defined(HAVE_OPENSSL) && \ defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L X509_VERIFY_PARAM *param = NULL; #endif if((ctrl_rem = malloc_zero(sizeof(control_remote_t))) == NULL || (ctrl_rem->list = dlist_alloc()) == NULL || (ctrl_rem->sq = scamper_queue_alloc(NULL)) == NULL) return -1; dlist_onremove(ctrl_rem->list, (dlist_onremove_t)remote_list_onremove); random_u32(&u32); memcpy(ctrl_rem->magic+0, &u32, 4); random_u32(&u32); memcpy(ctrl_rem->magic+4, &u32, 4); if(scamper_option_tls() != 0) { #ifdef HAVE_OPENSSL if((tls_ctx = SSL_CTX_new(SSLv23_client_method())) == NULL) { scamper_debug(__func__, "could not create tls_ctx"); return -1; } SSL_CTX_set_options(tls_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1); #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L param = SSL_CTX_get0_param(tls_ctx); X509_VERIFY_PARAM_set_hostflags(param, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS); X509_VERIFY_PARAM_set1_host(param, name, 0); #endif SSL_CTX_set_verify(tls_ctx, SSL_VERIFY_PEER, NULL); /* load the default set of certs into the SSL context */ if(SSL_CTX_set_default_verify_paths(tls_ctx) != 1) { scamper_debug(__func__, "could not load default CA certs"); return -1; } #else return -1; #endif } if((ctrl_rem->server_name = strdup(name)) == NULL) { printerror(__func__, "could not strdup name"); return -1; } ctrl_rem->server_port = port; return remote_connect(); } int scamper_control_add_unix(const char *file) { #if defined(AF_UNIX) && !defined(_WIN32) int fd = -1; #ifdef WITHOUT_PRIVSEP struct sockaddr_un sn; uid_t uid; if(sockaddr_compose_un((struct sockaddr *)&sn, file) != 0) { printerror(__func__, "could not compose socket"); goto err; } if((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { printerror(__func__, "could not create socket"); goto err; } if(bind(fd, (struct sockaddr *)&sn, sizeof(sn)) != 0) { printerror(__func__, "could not bind"); goto err; } if((uid = getuid()) != geteuid() && chown(file, uid, -1) != 0) { printerror(__func__, "could not chown"); goto err; } if(listen(fd, -1) != 0) { printerror(__func__, "could not listen"); goto err; } #else if((fd = scamper_privsep_open_unix(file)) == -1) { printerror(__func__, "could not open unix socket"); goto err; } #endif if((ctrl_unix = malloc_zero(sizeof(control_unix_t))) == NULL || (ctrl_unix->fd = scamper_fd_private(fd,NULL,control_accept,NULL))==NULL || (ctrl_unix->name = strdup(file)) == NULL) { printerror(__func__, "could not alloc ctrl_unix"); goto err; } return 0; err: if(fd != -1 && (ctrl_unix == NULL || ctrl_unix->fd == NULL)) close(fd); #endif return -1; } int scamper_control_add_inet(const char *ip, int port) { struct sockaddr_storage sas; struct sockaddr *sa = (struct sockaddr *)&sas; struct in_addr in; int af = AF_INET, fd = -1, opt; if(ip != NULL) { if(sockaddr_compose_str(sa, ip, port) != 0) { printerror(__func__, "could not compose sockaddr from %s:%d", ip, port); goto err; } af = sa->sa_family; } else { /* bind the socket to loopback on the specified port */ in.s_addr = htonl(INADDR_LOOPBACK); sockaddr_compose(sa, AF_INET, &in, port); } /* open the TCP socket we are going to listen on */ if((fd = socket(af, SOCK_STREAM, IPPROTO_TCP)) == -1) { printerror(__func__, "could not create socket"); goto err; } opt = 1; if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(opt)) != 0) { printerror(__func__, "could not set SO_REUSEADDR"); goto err; } opt = 1; if(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&opt, sizeof(opt)) != 0) { printerror(__func__, "could not set TCP_NODELAY"); goto err; } if(bind(fd, sa, sockaddr_len(sa)) != 0) { if(ip == NULL) printerror(__func__, "could not bind to port %d", port); else printerror(__func__, "could not bind to %s:%d", ip, port); goto err; } /* tell the system we want to listen for new clients on this socket */ if(listen(fd, -1) != 0) { printerror(__func__, "could not listen"); goto err; } if((ctrl_inet = malloc_zero(sizeof(control_inet_t))) == NULL || (ctrl_inet->fd = scamper_fd_private(fd,NULL,control_accept,NULL)) == NULL) { printerror(__func__, "could not malloc control_inet_t"); return -1; } return 0; err: if(fd != -1 && (ctrl_inet == NULL || ctrl_inet->fd == NULL)) close(fd); return -1; } int scamper_control_init(void) { if((client_list = dlist_alloc()) == NULL) { printerror(__func__, "could not alloc client_list"); return -1; } return 0; } /* * scamper_control_cleanup * * go through and free all the clients that are connected. * write anything left in the writebuf to the clients (non-blocking) and * then close the socket. */ void scamper_control_cleanup(void) { client_t *client; int fd; if(client_list != NULL) { while((client = dlist_head_pop(client_list)) != NULL) { client->node = NULL; if(client->type == CLIENT_TYPE_SOCKET) scamper_writebuf_write(scamper_fd_fd_get(client->un.sock.fdn), client->un.sock.wb); client_free(client); } dlist_free(client_list); client_list = NULL; } /* stop monitoring the control socket for new connections */ if(ctrl_unix != NULL) { if(ctrl_unix->fd != NULL) { if((fd = scamper_fd_fd_get(ctrl_unix->fd)) != -1) { close(fd); #if defined(AF_UNIX) && !defined(_WIN32) if(ctrl_unix->name != NULL) { #ifndef WITHOUT_PRIVSEP scamper_privsep_unlink(ctrl_unix->name); #else unlink(ctrl_unix->name); #endif } #endif } scamper_fd_free(ctrl_unix->fd); ctrl_unix->fd = NULL; } if(ctrl_unix->name != NULL) { free(ctrl_unix->name); ctrl_unix->name = NULL; } free(ctrl_unix); ctrl_unix = NULL; } if(ctrl_inet != NULL) { if(ctrl_inet->fd != NULL) { if((fd = scamper_fd_fd_get(ctrl_inet->fd)) != -1) close(fd); scamper_fd_free(ctrl_inet->fd); ctrl_inet->fd = NULL; } free(ctrl_inet); ctrl_inet = NULL; } if(ctrl_rem != NULL) { remote_free(ctrl_rem, 1); ctrl_rem = NULL; } #ifdef HAVE_OPENSSL if(tls_ctx != NULL) { SSL_CTX_free(tls_ctx); tls_ctx = NULL; } #endif return; } scamper-cvs-20171204/scamper/scamper_control.h000644 001751 000000 00000002300 12742346652 021116 0ustar00mjlwheel000000 000000 /* * scamper_control.h * * $Id: scamper_control.h,v 1.11 2016/07/16 06:01:14 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Copyright (C) 2014-2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_CONTROL_H #define __SCAMPER_CONTROL_H int scamper_control_add_inet(const char *addr, int port); int scamper_control_add_unix(const char *name); int scamper_control_add_remote(const char *name, int port); int scamper_control_init(void); void scamper_control_cleanup(void); #endif scamper-cvs-20171204/scamper/scamper_cyclemon.c000644 001751 000000 00000006341 11442777141 021250 0ustar00mjlwheel000000 000000 /* * scamper_cyclemon: monitor active use of cycle structures so we know when * to write a cycle-stop record. * * $Id: scamper_cyclemon.c,v 1.19 2010/09/11 22:10:41 mjl Exp $ * * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_cyclemon.c,v 1.19 2010/09/11 22:10:41 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_list.h" #include "scamper_outfiles.h" #include "scamper_task.h" #include "scamper_sources.h" #include "scamper_cyclemon.h" #include "utils.h" struct scamper_cyclemon { struct scamper_cycle *cycle; scamper_cyclemon_finish_t finish; scamper_source_t *source; scamper_outfile_t *outfile; int refcnt; }; scamper_cycle_t *scamper_cyclemon_cycle(const scamper_cyclemon_t *cyclemon) { if(cyclemon != NULL) { return cyclemon->cycle; } return NULL; } void scamper_cyclemon_source_detach(scamper_cyclemon_t *cyclemon) { cyclemon->source = NULL; return; } /* * scamper_cyclemon_free * */ void scamper_cyclemon_free(scamper_cyclemon_t *cyclemon) { if(cyclemon == NULL) { return; } if(cyclemon->cycle != NULL) { scamper_cycle_free(cyclemon->cycle); } if(cyclemon->outfile != NULL) { scamper_outfile_free(cyclemon->outfile); } free(cyclemon); return; } void scamper_cyclemon_unuse(scamper_cyclemon_t *cyclemon) { if(cyclemon == NULL) { return; } cyclemon->refcnt--; /* * if there are still others with a pointer to the cycle monitor, then * don't finish the cycle off */ if(cyclemon->refcnt > 0) { return; } cyclemon->finish(cyclemon->cycle, cyclemon->source, cyclemon->outfile); scamper_cyclemon_free(cyclemon); return; } scamper_cyclemon_t *scamper_cyclemon_use(scamper_cyclemon_t *cyclemon) { if(cyclemon != NULL) cyclemon->refcnt++; return cyclemon; } int scamper_cyclemon_refcnt(scamper_cyclemon_t *cyclemon) { return cyclemon->refcnt; } scamper_cyclemon_t *scamper_cyclemon_alloc(scamper_cycle_t *cycle, scamper_cyclemon_finish_t finish, scamper_source_t *source, scamper_outfile_t *outfile) { scamper_cyclemon_t *cyclemon; if((cyclemon = malloc_zero(sizeof(scamper_cyclemon_t))) != NULL) { cyclemon->cycle = scamper_cycle_use(cycle); cyclemon->outfile = scamper_outfile_use(outfile); cyclemon->finish = finish; cyclemon->source = source; cyclemon->refcnt = 1; } return cyclemon; } scamper-cvs-20171204/scamper/scamper_cyclemon.h000644 001751 000000 00000004112 11017746267 021252 0ustar00mjlwheel000000 000000 /* * scamper_cyclemon: monitor active use of cycle structures so we know when * to write a cycle-stop record. * * $Id: scamper_cyclemon.h,v 1.7 2008/05/30 09:45:27 mjl Exp $ * * Copyright (C) 2006-2008 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_CYCLEMON_H #define __SCAMPER_CYCLEMON_H struct scamper_source; struct scamper_outfile; typedef void (*scamper_cyclemon_finish_t)(scamper_cycle_t *cycle, struct scamper_source *source, struct scamper_outfile *outfile); /* structure for monitoring the references to a cycle by data producers */ typedef struct scamper_cyclemon scamper_cyclemon_t; /* allocate a structure to monitor when to write a cycle stop record to file */ scamper_cyclemon_t *scamper_cyclemon_alloc(scamper_cycle_t *cycle, scamper_cyclemon_finish_t finish, struct scamper_source *source, struct scamper_outfile *outfile); scamper_cycle_t *scamper_cyclemon_cycle(const scamper_cyclemon_t *cyclemon); void scamper_cyclemon_source_detach(scamper_cyclemon_t *cyclemon); /* use and unuse the cyclemon structure */ scamper_cyclemon_t *scamper_cyclemon_use(scamper_cyclemon_t *cyclemon); void scamper_cyclemon_unuse(scamper_cyclemon_t *cyclemon); int scamper_cyclemon_refcnt(scamper_cyclemon_t *cyclemon); /* free the cyclemon structure without writing to disk */ void scamper_cyclemon_free(scamper_cyclemon_t *cyclemon); #endif /* __SCAMPER_CYCLEMON_H */ scamper-cvs-20171204/scamper/scamper_debug.c000644 001751 000000 00000014451 13210743022 020510 0ustar00mjlwheel000000 000000 /* * scamper_debug.c * * $Id: scamper_debug.c,v 1.36 2017/12/03 09:38:26 mjl Exp $ * * routines to reduce the impact of debugging cruft in scamper's code. * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Copyright (C) 2012,2015,2017 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_debug.c,v 1.36 2017/12/03 09:38:26 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_debug.h" #include "scamper_privsep.h" #include "utils.h" #ifndef WITHOUT_DEBUGFILE static FILE *debugfile = NULL; #endif #ifdef HAVE_DAEMON static int isdaemon = 0; #endif static char *timestamp_str(char *buf, const size_t len) { struct timeval tv; struct tm *tm; int ms; time_t t; buf[0] = '\0'; gettimeofday_wrap(&tv); t = tv.tv_sec; if((tm = localtime(&t)) == NULL) return buf; ms = tv.tv_usec / 1000; snprintf(buf, len, "[%02d:%02d:%02d:%03d]", tm->tm_hour, tm->tm_min, tm->tm_sec, ms); return buf; } #ifndef NDEBUG void __scamper_assert(const char *file, int line, const char *func, const char *expr, void *data) { char ts[16]; timestamp_str(ts, sizeof(ts)); fprintf(stderr, "%s assertion failed: %s:%d %s `%s'\n", ts, file, line, func, expr); fflush(stderr); #ifndef WITHOUT_DEBUGFILE if(debugfile != NULL) { fprintf(debugfile, "%s assertion failed: %s:%d %s `%s'\n", ts, file, line, func, expr); fflush(debugfile); } #endif abort(); return; } #endif /* * printerror * * format a nice and consistent error string using strerror and the * arguments supplied */ void printerror(const char *func, const char *format, ...) { char message[512]; char ts[16]; va_list ap; int ecode = errno; if(isdaemon != 0) { #ifndef WITHOUT_DEBUGFILE if(debugfile == NULL) return; #else return; #endif } va_start(ap, format); vsnprintf(message, sizeof(message), format, ap); va_end(ap); timestamp_str(ts, sizeof(ts)); fprintf(stderr, "%s %s: %s: %s\n", ts, func, message, strerror(ecode)); fflush(stderr); #ifndef WITHOUT_DEBUGFILE if(debugfile != NULL) { fprintf(debugfile, "%s %s: %s: %s\n", ts, func, message, strerror(ecode)); fflush(debugfile); } #endif return; } void printerror_gai(const char *func, int ecode, const char *format, ...) { char msg[512], ts[16]; va_list ap; if(isdaemon != 0) { #ifndef WITHOUT_DEBUGFILE if(debugfile == NULL) return; #else return; #endif } va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); timestamp_str(ts, sizeof(ts)); fprintf(stderr, "%s %s: %s: %s\n", ts, func, msg, gai_strerror(ecode)); fflush(stderr); #ifndef WITHOUT_DEBUGFILE if(debugfile != NULL) { fprintf(debugfile, "%s %s: %s: %s\n", ts, func, msg, gai_strerror(ecode)); fflush(debugfile); } #endif return; } void printerror_msg(const char *func, const char *format, ...) { char msg[512], ts[16]; va_list ap; if(isdaemon != 0) { #ifndef WITHOUT_DEBUGFILE if(debugfile == NULL) return; #else return; #endif } va_start(ap, format); vsnprintf(msg, sizeof(msg), format, ap); va_end(ap); timestamp_str(ts, sizeof(ts)); fprintf(stderr, "%s %s: %s\n", ts, func, msg); fflush(stderr); #ifndef WITHOUT_DEBUGFILE if(debugfile != NULL) { fprintf(debugfile, "%s %s: %s\n", ts, func, msg); fflush(debugfile); } #endif return; } #ifdef HAVE_SCAMPER_DEBUG void scamper_debug(const char *func, const char *format, ...) { char message[512]; va_list ap; char ts[16]; char fs[64]; #if !defined(WITHOUT_DEBUGFILE) && defined(NDEBUG) if(debugfile == NULL) return; #endif assert(format != NULL); #ifdef HAVE_DAEMON if(isdaemon != 0) { #ifndef WITHOUT_DEBUGFILE if(debugfile == NULL) return; #else return; #endif } #endif va_start(ap, format); vsnprintf(message, sizeof(message), format, ap); va_end(ap); timestamp_str(ts, sizeof(ts)); if(func != NULL) snprintf(fs, sizeof(fs), "%s: ", func); else fs[0] = '\0'; #ifndef NDEBUG fprintf(stderr, "%s %s%s\n", ts, fs, message); fflush(stderr); #endif #ifndef WITHOUT_DEBUGFILE if(debugfile != NULL) { fprintf(debugfile, "%s %s%s\n", ts, fs, message); fflush(debugfile); } #endif return; } #endif #ifndef WITHOUT_DEBUGFILE int scamper_debug_open(const char *file) { mode_t mode; int flags, fd; #if defined(WITHOUT_PRIVSEP) && !defined(_WIN32) uid_t uid = getuid(); #endif #ifndef _WIN32 mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; #else mode = _S_IREAD | _S_IWRITE; #endif if(scamper_option_debugfileappend() == 0) flags = O_WRONLY | O_CREAT | O_TRUNC; else flags = O_WRONLY | O_CREAT | O_APPEND; #ifndef WITHOUT_PRIVSEP fd = scamper_privsep_open_file(file, flags, mode); #else fd = open(file, flags, mode); #endif if(fd == -1) { printerror(__func__, "could not open debugfile %s", file); return -1; } if((debugfile = fdopen(fd, "a")) == NULL) { printerror(__func__, "could not fdopen debugfile %s", file); return -1; } #if defined(WITHOUT_PRIVSEP) && !defined(_WIN32) if(uid != geteuid() && fchown(fd, uid, -1) != 0) { printerror(__func__, "could not fchown"); } #endif return 0; } void scamper_debug_close() { if(debugfile != NULL) { fclose(debugfile); debugfile = NULL; } return; } #endif void scamper_debug_init(void) { #ifdef HAVE_DAEMON if(scamper_option_daemon()) isdaemon = 1; #endif return; } scamper-cvs-20171204/scamper/scamper_debug.h000644 001751 000000 00000003602 13210743022 020511 0ustar00mjlwheel000000 000000 /* * scamper_debug.h * * $Id: scamper_debug.h,v 1.19 2017/12/03 09:38:26 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2009 The University of Waikato * Copyright (C) 2015,2017 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DEBUG_H #define __SCAMPER_DEBUG_H void printerror(const char *func, const char *format, ...); void printerror_gai(const char *func, int ecode, const char *format, ...); void printerror_msg(const char *func, const char *format, ...); #ifdef NDEBUG #define scamper_assert(expr, task) ((void)0) #else #define scamper_assert(expr, task) ((expr) ? (void)0 : \ __scamper_assert(__FILE__,__LINE__,__FUNC__, #expr, task)) void __scamper_assert(const char *file, int line, const char *func, const char *expr, void *task); #endif /* only define scamper_debug if scamper is being built in debugging mode */ #if defined(NDEBUG) && defined(WITHOUT_DEBUGFILE) #define scamper_debug(func, format, ...) ((void)0) #else #define HAVE_SCAMPER_DEBUG void scamper_debug(const char *func, const char *format, ...); #endif #ifndef WITHOUT_DEBUGFILE int scamper_debug_open(const char *debugfile); void scamper_debug_close(void); #endif void scamper_debug_init(void); #endif /* scamper_debug.h */ scamper-cvs-20171204/scamper/scamper_dl.c000644 001751 000000 00000140267 13210744730 020035 0ustar00mjlwheel000000 000000 /* * scamper_dl: manage BPF/PF_PACKET datalink instances for scamper * * $Id: scamper_dl.c,v 1.186 2017/12/03 09:54:32 mjl Exp $ * * Matthew Luckie * Ben Stasiewicz added fragmentation support. * Stephen Eichler added SACK support. * * Supported by: * The University of Waikato * NLANR Measurement and Network Analysis * CAIDA * The WIDE Project * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012 Matthew Luckie * Copyright (C) 2014-2015 The Regents of the University of California * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_dl.c,v 1.186 2017/12/03 09:54:32 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #if defined(HAVE_BPF) || defined(__linux__) #define HAVE_BPF_FILTER #endif #include "scamper.h" #include "scamper_debug.h" #include "scamper_addr.h" #include "scamper_fds.h" #include "scamper_dl.h" #include "scamper_privsep.h" #include "scamper_task.h" #include "scamper_if.h" #include "scamper_osinfo.h" #include "utils.h" #if defined(HAVE_BPF) && defined(DLT_APPLE_IP_OVER_IEEE1394) #define HAVE_FIREWIRE #elif defined(__linux__) && defined(ARPHRD_IEEE1394) #define HAVE_FIREWIRE #endif struct scamper_dl { /* the file descriptor that scamper has on the datalink */ scamper_fd_t *fdn; /* the callback used to read packets off the datalink */ int (*dlt_cb)(scamper_dl_rec_t *dl, uint8_t *pkt, size_t len); /* the underlying type of the datalink (DLT_* or ARPHDR_* values) */ int type; /* how the user should frame packet to transmit on the datalink */ int tx_type; /* if we're using BPF, then we need to use an appropriately sized buffer */ #if defined(HAVE_BPF) u_int readbuf_len; #endif }; static uint8_t *readbuf = NULL; static size_t readbuf_len = 0; #if defined(HAVE_BPF) static const scamper_osinfo_t *osinfo = NULL; #endif /* * dl_parse_ip * * pkt points to the beginning of an IP header. given the length of the * packet, parse the contents into a datalink record structure. */ static int dl_parse_ip(scamper_dl_rec_t *dl, uint8_t *pktbuf, size_t pktlen) { struct ip *ip4; struct ip6_hdr *ip6; struct ip6_ext *ip6_exthdr; struct ip6_frag *ip6_fraghdr; struct icmp *icmp4; struct icmp6_hdr *icmp6; struct tcphdr *tcp; struct udphdr *udp; size_t iplen; size_t extlen; uint8_t *pkt = pktbuf; size_t len = pktlen; size_t off; uint8_t *tmp; uint16_t u16; int i; if((pkt[0] >> 4) == 4) /* IPv4 */ { ip4 = (struct ip *)pkt; #ifndef _WIN32 iplen = (ip4->ip_hl << 2); #else iplen = ((ip4->ip_vhl) & 0xf) << 2; #endif /* * make sure that the captured packet has enough to cover the whole * of the IP header */ if(iplen > len) return 0; /* figure out fragmentation details */ u16 = ntohs(ip4->ip_off); dl->dl_ip_off = (u16 & IP_OFFMASK) * 8; if(dl->dl_ip_off != 0 || (u16 & IP_MF) != 0) dl->dl_ip_flags |= SCAMPER_DL_IP_FLAG_FRAG; if((u16 & IP_DF) != 0) dl->dl_ip_flags |= SCAMPER_DL_IP_FLAG_DF; if((u16 & IP_MF) != 0) dl->dl_ip_flags |= SCAMPER_DL_IP_FLAG_MF; dl->dl_af = AF_INET; dl->dl_ip_hl = iplen; dl->dl_ip_proto = ip4->ip_p; dl->dl_ip_size = ntohs(ip4->ip_len); dl->dl_ip_id = ntohs(ip4->ip_id); dl->dl_ip_tos = ip4->ip_tos; dl->dl_ip_ttl = ip4->ip_ttl; dl->dl_ip_src = (uint8_t *)&ip4->ip_src; dl->dl_ip_dst = (uint8_t *)&ip4->ip_dst; dl->dl_flags |= SCAMPER_DL_REC_FLAG_NET; dl->dl_net_type = SCAMPER_DL_REC_NET_TYPE_IP; pkt += iplen; len -= iplen; } else if((pkt[0] >> 4) == 6) /* IPv6 */ { ip6 = (struct ip6_hdr *)pkt; if((iplen = sizeof(struct ip6_hdr)) > len) return 0; dl->dl_af = AF_INET6; dl->dl_ip_hl = iplen; dl->dl_ip_flow = ntohl(ip6->ip6_flow) & 0xfffff; dl->dl_ip_proto = ip6->ip6_nxt; dl->dl_ip_size = ntohs(ip6->ip6_plen) + sizeof(struct ip6_hdr); dl->dl_ip_hlim = ip6->ip6_hlim; dl->dl_ip_src = (uint8_t *)&ip6->ip6_src; dl->dl_ip_dst = (uint8_t *)&ip6->ip6_dst; dl->dl_flags |= SCAMPER_DL_REC_FLAG_NET; dl->dl_net_type = SCAMPER_DL_REC_NET_TYPE_IP; pkt += iplen; len -= iplen; /* Process any IPv6 fragmentation headers */ for(;;) { switch(dl->dl_ip_proto) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: case IPPROTO_ROUTING: if(sizeof(struct ip6_ext) > len) return 0; ip6_exthdr = (struct ip6_ext *)pkt; if((extlen = (ip6_exthdr->ip6e_len * 8) + 8) > len) return 0; dl->dl_ip_proto = ip6_exthdr->ip6e_nxt; break; case IPPROTO_FRAGMENT: if((extlen = sizeof(struct ip6_frag)) > len) return 0; ip6_fraghdr = (struct ip6_frag *)pkt; dl->dl_ip6_id = ntohl(ip6_fraghdr->ip6f_ident); dl->dl_ip_off = ntohs(ip6_fraghdr->ip6f_offlg) & 0xfff8; dl->dl_ip_proto = ip6_fraghdr->ip6f_nxt; dl->dl_ip_flags |= SCAMPER_DL_IP_FLAG_FRAG; if(ntohs(ip6_fraghdr->ip6f_offlg) & 0x1) dl->dl_ip_flags |= SCAMPER_DL_IP_FLAG_MF; break; default: extlen = 0; break; } if(extlen == 0) break; dl->dl_ip_hl += extlen; pkt += extlen; len -= extlen; } } else { return 0; } dl->dl_ip_data = pkt; dl->dl_ip_datalen = len; /* * can't do any further processing of the packet if we're seeing * a later fragment */ if(dl->dl_ip_off != 0) return 1; if(dl->dl_ip_proto == IPPROTO_UDP) { if((int)sizeof(struct udphdr) > len) { return 0; } udp = (struct udphdr *)pkt; dl->dl_udp_dport = ntohs(udp->uh_dport); dl->dl_udp_sport = ntohs(udp->uh_sport); dl->dl_udp_sum = udp->uh_sum; dl->dl_flags |= SCAMPER_DL_REC_FLAG_TRANS; } else if(dl->dl_ip_proto == IPPROTO_TCP) { if((int)sizeof(struct tcphdr) > len) { return 0; } tcp = (struct tcphdr *)pkt; dl->dl_tcp_dport = ntohs(tcp->th_dport); dl->dl_tcp_sport = ntohs(tcp->th_sport); dl->dl_tcp_seq = ntohl(tcp->th_seq); dl->dl_tcp_ack = ntohl(tcp->th_ack); #ifndef _WIN32 dl->dl_tcp_hl = tcp->th_off * 4; #else dl->dl_tcp_hl = (tcp->th_offx2 >> 4) * 4; #endif dl->dl_tcp_flags = tcp->th_flags; dl->dl_tcp_win = ntohs(tcp->th_win); dl->dl_flags |= SCAMPER_DL_REC_FLAG_TRANS; if(dl->dl_tcp_hl >= 20 && len >= dl->dl_tcp_hl) { off = 20; while(off < dl->dl_tcp_hl) { tmp = pkt + off; if(tmp[0] == 0) /* End of option list */ break; if(tmp[0] == 1) /* no-op */ { off++; continue; } if(tmp[1] == 0) break; /* make sure the option can be extracted */ if(off + tmp[1] > dl->dl_tcp_hl) break; if(tmp[0] == 2 && tmp[1] == 4) /* mss option */ dl->dl_tcp_mss = bytes_ntohs(tmp+2); if(tmp[0] == 4 && tmp[1] == 2) /* sack permitted option */ dl->dl_tcp_opts |= SCAMPER_DL_TCP_OPT_SACKP; if(tmp[0] == 8 && tmp[1] == 10) /* timestamps */ { dl->dl_tcp_opts |= SCAMPER_DL_TCP_OPT_TS; dl->dl_tcp_tsval = bytes_ntohl(tmp+2); dl->dl_tcp_tsecr = bytes_ntohl(tmp+6); } if(tmp[0] == 5) { if(tmp[1]==10 || tmp[1]==18 || tmp[1]==26 || tmp[1]==34) { dl->dl_tcp_sack_edgec = (tmp[1]-2) / 4; for(i=0; i<(tmp[1]-2)/4; i++) dl->dl_tcp_sack_edges[i] = bytes_ntohl(tmp+2 + (i*4)); } else { dl->dl_tcp_sack_edgec = -1; } } if(tmp[0] == 34 && tmp[1] >= 2) { dl->dl_tcp_opts |= SCAMPER_DL_TCP_OPT_FO; dl->dl_tcp_fo_cookielen = tmp[1] - 2; for(i=0; idl_tcp_fo_cookielen; i++) dl->dl_tcp_fo_cookie[i] = tmp[2+i]; } if(tmp[0] == 254 && tmp[1] >= 4 && bytes_ntohs(tmp+2) == 0xF989) { dl->dl_tcp_opts |= SCAMPER_DL_TCP_OPT_FO_EXP; dl->dl_tcp_fo_cookielen = tmp[1] - 4; for(i=0; idl_tcp_fo_cookielen; i++) dl->dl_tcp_fo_cookie[i] = tmp[4+i]; } off += tmp[1]; } dl->dl_tcp_datalen = dl->dl_ip_size - dl->dl_ip_hl - dl->dl_tcp_hl; if(dl->dl_tcp_datalen > 0) dl->dl_tcp_data = pkt + dl->dl_tcp_hl; } } else if(dl->dl_ip_proto == IPPROTO_ICMP) { /* the absolute minimum ICMP header size is 8 bytes */ if(ICMP_MINLEN > len) { return 0; } icmp4 = (struct icmp *)pkt; dl->dl_icmp_type = icmp4->icmp_type; dl->dl_icmp_code = icmp4->icmp_code; switch(dl->dl_icmp_type) { case ICMP_UNREACH: case ICMP_TIMXCEED: if(ICMP_MINLEN + (int)sizeof(struct ip) > len) { return 0; } if(dl->dl_icmp_type == ICMP_UNREACH && dl->dl_icmp_code == ICMP_UNREACH_NEEDFRAG) { dl->dl_icmp_nhmtu = ntohs(icmp4->icmp_nextmtu); } ip4 = &icmp4->icmp_ip; dl->dl_icmp_ip_proto = ip4->ip_p; dl->dl_icmp_ip_size = ntohs(ip4->ip_len); dl->dl_icmp_ip_id = ntohs(ip4->ip_id); dl->dl_icmp_ip_tos = ip4->ip_tos; dl->dl_icmp_ip_ttl = ip4->ip_ttl; dl->dl_icmp_ip_src = (uint8_t *)&ip4->ip_src; dl->dl_icmp_ip_dst = (uint8_t *)&ip4->ip_dst; /* * the ICMP response should include the IP header and the first * 8 bytes of the transport header. */ #ifndef _WIN32 if((size_t)(ICMP_MINLEN + (ip4->ip_hl << 2) + 8) > len) #else if((size_t)(ICMP_MINLEN + ((ip4->ip_vhl & 0xf) << 2) + 8) > len) #endif { return 0; } pkt = (uint8_t *)ip4; #ifndef _WIN32 iplen = (ip4->ip_hl << 2); #else iplen = ((ip4->ip_vhl & 0xf) << 2); #endif pkt += iplen; if(dl->dl_icmp_ip_proto == IPPROTO_UDP) { udp = (struct udphdr *)pkt; dl->dl_icmp_udp_sport = ntohs(udp->uh_sport); dl->dl_icmp_udp_dport = ntohs(udp->uh_dport); dl->dl_icmp_udp_sum = udp->uh_sum; } else if(dl->dl_icmp_ip_proto == IPPROTO_ICMP) { icmp4 = (struct icmp *)pkt; dl->dl_icmp_icmp_type = icmp4->icmp_type; dl->dl_icmp_icmp_code = icmp4->icmp_code; dl->dl_icmp_icmp_id = ntohs(icmp4->icmp_id); dl->dl_icmp_icmp_seq = ntohs(icmp4->icmp_seq); } else if(dl->dl_icmp_ip_proto == IPPROTO_TCP) { tcp = (struct tcphdr *)pkt; dl->dl_icmp_tcp_sport = ntohs(tcp->th_sport); dl->dl_icmp_tcp_dport = ntohs(tcp->th_dport); dl->dl_icmp_tcp_seq = ntohl(tcp->th_seq); } break; case ICMP_ECHOREPLY: case ICMP_ECHO: case ICMP_TSTAMPREPLY: case ICMP_TSTAMP: dl->dl_icmp_id = ntohs(icmp4->icmp_id); dl->dl_icmp_seq = ntohs(icmp4->icmp_seq); break; default: return 0; } dl->dl_flags |= SCAMPER_DL_REC_FLAG_TRANS; } else if(dl->dl_ip_proto == IPPROTO_ICMPV6) { /* the absolute minimum ICMP header size is 8 bytes */ if((int)sizeof(struct icmp6_hdr) > len) { return 0; } icmp6 = (struct icmp6_hdr *)pkt; dl->dl_icmp_type = icmp6->icmp6_type; dl->dl_icmp_code = icmp6->icmp6_code; pkt += sizeof(struct icmp6_hdr); len -= sizeof(struct icmp6_hdr); switch(dl->dl_icmp_type) { case ICMP6_TIME_EXCEEDED: case ICMP6_DST_UNREACH: case ICMP6_PACKET_TOO_BIG: if((int)sizeof(struct ip6_hdr) + 8 > len) { return 0; } if(dl->dl_icmp_type == ICMP6_PACKET_TOO_BIG) { #ifndef _WIN32 dl->dl_icmp_nhmtu = (ntohl(icmp6->icmp6_mtu) % 0xffff); #else dl->dl_icmp_nhmtu = ntohs(icmp6->icmp6_seq); #endif } ip6 = (struct ip6_hdr *)pkt; pkt += sizeof(struct ip6_hdr); dl->dl_icmp_ip_proto = ip6->ip6_nxt; dl->dl_icmp_ip_size = ntohs(ip6->ip6_plen) + sizeof(struct ip6_hdr); dl->dl_icmp_ip_hlim = ip6->ip6_hlim; dl->dl_icmp_ip_flow = ntohl(ip6->ip6_flow) & 0xfffff; dl->dl_icmp_ip_src = (uint8_t *)&ip6->ip6_src; dl->dl_icmp_ip_dst = (uint8_t *)&ip6->ip6_dst; if(dl->dl_icmp_ip_proto == IPPROTO_UDP) { udp = (struct udphdr *)pkt; dl->dl_icmp_udp_sport = ntohs(udp->uh_sport); dl->dl_icmp_udp_dport = ntohs(udp->uh_dport); dl->dl_icmp_udp_sum = udp->uh_sum; } else if(dl->dl_icmp_ip_proto == IPPROTO_ICMPV6) { icmp6 = (struct icmp6_hdr *)pkt; dl->dl_icmp_icmp_type = icmp6->icmp6_type; dl->dl_icmp_icmp_code = icmp6->icmp6_code; dl->dl_icmp_icmp_id = ntohs(icmp6->icmp6_id); dl->dl_icmp_icmp_seq = ntohs(icmp6->icmp6_seq); } else if(dl->dl_icmp_ip_proto == IPPROTO_TCP) { tcp = (struct tcphdr *)pkt; dl->dl_icmp_tcp_sport = ntohs(tcp->th_sport); dl->dl_icmp_tcp_dport = ntohs(tcp->th_dport); dl->dl_icmp_tcp_seq = ntohl(tcp->th_seq); } break; case ICMP6_ECHO_REPLY: case ICMP6_ECHO_REQUEST: dl->dl_icmp_id = ntohs(icmp6->icmp6_id); dl->dl_icmp_seq = ntohs(icmp6->icmp6_seq); break; case ND_NEIGHBOR_ADVERT: dl->dl_icmp6_nd_target = pkt; dl->dl_icmp6_nd_opts = pkt + 16; dl->dl_icmp6_nd_opts_len = len - 16; break; default: return 0; } dl->dl_flags |= SCAMPER_DL_REC_FLAG_TRANS; } else { return 0; } return 1; } /* * dlt_raw_cb * * handle raw IP frames. * i'm not sure how many of these interface types there are, but the linux * sit interface is an example of one that is... * */ static int dlt_raw_cb(scamper_dl_rec_t *dl, uint8_t *pkt, size_t len) { int ret; if((ret = dl_parse_ip(dl, pkt, len)) != 0) { dl->dl_type = SCAMPER_DL_TYPE_RAW; dl->dl_net_raw = pkt; dl->dl_net_rawlen = len; } return ret; } /* * dlt_null_cb * * handle the BSD loopback encapsulation. the first 4 bytes say what protocol * family is used. filter out anything that is not IPv4 / IPv6 * */ #ifdef HAVE_BPF static int dlt_null_cb(scamper_dl_rec_t *dl, uint8_t *pkt, size_t len) { uint32_t pf; int ret; /* ensure the packet holds at least 4 bytes for the psuedo header */ if(len <= 4) { return 0; } memcpy(&pf, pkt, 4); if(pf == PF_INET || pf == PF_INET6) { if((ret = dl_parse_ip(dl, pkt+4, len-4)) != 0) { dl->dl_type = SCAMPER_DL_TYPE_NULL; dl->dl_net_raw = pkt+4; dl->dl_net_rawlen = len-4; } return ret; } return 0; } #endif /* * dlt_en10mb_cb * * handle ethernet frames. * * an ethernet frame consists of * - 6 bytes dst mac * - 6 bytes src mac * - 2 bytes type * */ static int dlt_en10mb_cb(scamper_dl_rec_t *dl, uint8_t *pkt, size_t len) { uint16_t u16; size_t off; /* ensure the packet holds at least the length of the ethernet header */ if(len <= 14) return 0; u16 = bytes_ntohs(pkt+12); if(u16 == ETHERTYPE_IP || u16 == ETHERTYPE_IPV6) { if(dl_parse_ip(dl, pkt+14, len-14) == 0) return 0; } else if(u16 == ETHERTYPE_ARP) { /* need to at least have a header */ if(14 + 8 >= len) return 0; off = 14; dl->dl_arp_hrd = bytes_ntohs(pkt+off); off += 2; dl->dl_arp_pro = bytes_ntohs(pkt+off); off += 2; dl->dl_arp_hln = pkt[off++]; dl->dl_arp_pln = pkt[off++]; dl->dl_arp_op = bytes_ntohs(pkt+off); off += 2; /* make sure all the bits are found after the arp header */ if(14 + 8 + (dl->dl_arp_hln*2) + (dl->dl_arp_pln*2) > len) return 0; dl->dl_arp_sha = pkt+off; off += dl->dl_arp_hln; dl->dl_arp_spa = pkt+off; off += dl->dl_arp_pln; dl->dl_arp_tha = pkt+off; off += dl->dl_arp_hln; dl->dl_arp_tpa = pkt+off; /* completed record is an arp frame */ dl->dl_net_type = SCAMPER_DL_REC_NET_TYPE_ARP; } else return 0; dl->dl_type = SCAMPER_DL_TYPE_ETHERNET; dl->dl_lladdr_dst = pkt; dl->dl_lladdr_src = pkt+6; dl->dl_net_raw = pkt+14; dl->dl_net_rawlen = len-14; return 1; } /* * dlt_firewire_cb * * handle IP frames on firewire devices. a firewire layer-2 frame consists * of two 8 byte EUI64 addresses which represent the dst and the src * addresses, and a 2 byte ethertype */ #ifdef HAVE_FIREWIRE static int dlt_firewire_cb(scamper_dl_rec_t *dl, uint8_t *pkt, size_t len) { int ret; uint16_t type; /* ensure the packet holds at least the length of the firewire header */ if(len <= 18) { return 0; } memcpy(&type, pkt+16, 2); type = ntohs(type); if(type == ETHERTYPE_IP || type == ETHERTYPE_IPV6) { if((ret = dl_parse_ip(dl, pkt+18, len-18)) != 0) { dl->dl_type = SCAMPER_DL_TYPE_FIREWIRE; dl->dl_lladdr_dst = pkt; dl->dl_lladdr_src = pkt + 8; dl->dl_net_raw = pkt + 18; dl->dl_net_rawlen = len - 18; } return ret; } return 0; } #endif #if defined(HAVE_BPF) static int dl_bpf_open_dev(char *dev, const size_t len) { int i=0, fd; do { snprintf(dev, len, "/dev/bpf%d", i); if((fd = open(dev, O_RDWR)) == -1) { if(errno == EBUSY) { continue; } else { printerror(__func__, "could not open %s", dev); return -1; } } else break; } while(++i < 32768); return fd; } static int dl_bpf_open(const int ifindex) { struct ifreq ifreq; char dev[16]; u_int blen; int fd = -1; /* work out the name corresponding to the ifindex */ memset(&ifreq, 0, sizeof(ifreq)); if(if_indextoname((unsigned int)ifindex, ifreq.ifr_name) == NULL) { printerror(__func__, "if_indextoname failed"); goto err; } if((fd = dl_bpf_open_dev(dev, sizeof(dev))) == -1) { goto err; } /* get the suggested read buffer size */ if(ioctl(fd, BIOCGBLEN, &blen) == -1) { printerror(__func__, "BIOCGBLEN %s", ifreq.ifr_name); goto err; } /* * try and get the system to use a larger buffer. need to do this * before the call to BIOCSETIF. */ if(blen < 65536) { blen = 65536; if(ioctl(fd, BIOCSBLEN, &blen) == -1) { printerror(__func__, "BIOCSBLEN %s: %d", ifreq.ifr_name, blen); goto err; } } /* set the interface that will be sniffed */ if(ioctl(fd, BIOCSETIF, &ifreq) == -1) { printerror(__func__, "%s BIOCSETIF %s failed", dev, ifreq.ifr_name); goto err; } return fd; err: if(fd != -1) close(fd); return -1; } static int dl_bpf_node_init(const scamper_fd_t *fdn, scamper_dl_t *node) { char ifname[IFNAMSIZ]; u_int tmp; int ifindex, fd; uint8_t *buf; /* get the file descriptor associated with the fd node */ if((fd = scamper_fd_fd_get(fdn)) < 0) { goto err; } /* get the interface index */ if(scamper_fd_ifindex(fdn, &ifindex) != 0) { goto err; } /* convert the interface index to a name */ if(if_indextoname((unsigned int)ifindex, ifname) == NULL) { printerror(__func__,"if_indextoname %d failed", ifindex); goto err; } /* get the read buffer size */ if(ioctl(fd, BIOCGBLEN, &node->readbuf_len) == -1) { printerror(__func__, "bpf BIOCGBLEN %s failed", ifname); goto err; } /* get the DLT type for the interface */ if(ioctl(fd, BIOCGDLT, &tmp) == -1) { printerror(__func__, "bpf BIOCGDLT %s failed", ifname); goto err; } node->type = tmp; switch(node->type) { case DLT_NULL: node->dlt_cb = dlt_null_cb; if(osinfo->os_id == SCAMPER_OSINFO_OS_FREEBSD && osinfo->os_rel_dots > 0 && osinfo->os_rel[0] >= 6) { node->tx_type = SCAMPER_DL_TX_NULL; } else { node->tx_type = SCAMPER_DL_TX_UNSUPPORTED; } break; case DLT_EN10MB: node->dlt_cb = dlt_en10mb_cb; node->tx_type = SCAMPER_DL_TX_ETHERNET; break; case DLT_RAW: node->dlt_cb = dlt_raw_cb; node->tx_type = SCAMPER_DL_TX_UNSUPPORTED; break; #if defined(DLT_APPLE_IP_OVER_IEEE1394) case DLT_APPLE_IP_OVER_IEEE1394: node->dlt_cb = dlt_firewire_cb; node->tx_type = SCAMPER_DL_TX_UNSUPPORTED; break; #endif default: scamper_debug(__func__, "%s unhandled datalink %d", ifname, node->type); goto err; } scamper_debug(__func__, "bpf if %s index %d buflen %d datalink %d", ifname, ifindex, node->readbuf_len, node->type); tmp = 1; if(ioctl(fd, BIOCIMMEDIATE, &tmp) == -1) { printerror(__func__, "bpf BIOCIMMEDIATE failed"); goto err; } if(readbuf_len < node->readbuf_len) { if((buf = realloc(readbuf, node->readbuf_len)) == NULL) { printerror(__func__, "could not realloc"); return -1; } readbuf = buf; readbuf_len = node->readbuf_len; } return 0; err: return -1; } static int dl_bpf_init(void) { struct bpf_version bv; int fd; char buf[16]; int err; if((fd = dl_bpf_open_dev(buf, sizeof(buf))) == -1) { if(errno == ENXIO) { return 0; } return -1; } err = ioctl(fd, BIOCVERSION, &bv); close(fd); if(err == -1) { printerror(__func__, "BIOCVERSION failed"); return -1; } scamper_debug(__func__, "bpf version %d.%d", bv.bv_major, bv.bv_minor); if(bv.bv_major != BPF_MAJOR_VERSION || bv.bv_minor < BPF_MINOR_VERSION) { printerror_msg(__func__, "bpf ver %d.%d is incompatible with %d.%d", bv.bv_major, bv.bv_minor, BPF_MAJOR_VERSION, BPF_MINOR_VERSION); return -1; } osinfo = scamper_osinfo_get(); if(osinfo->os_id == SCAMPER_OSINFO_OS_FREEBSD && osinfo->os_rel_dots >= 2 && osinfo->os_rel[0] == 4 && (osinfo->os_rel[1] == 3 || osinfo->os_rel[1] == 4)) { printerror_msg(__func__, "BPF file descriptors do not work with " "select in FreeBSD 4.3 or 4.4"); return -1; } return 0; } static int dl_bpf_read(const int fd, scamper_dl_t *node) { struct bpf_hdr *bpf_hdr; scamper_dl_rec_t dl; ssize_t len; uint8_t *buf = readbuf; while((len = read(fd, buf, node->readbuf_len)) == -1) { if(errno == EINTR) continue; if(errno == EWOULDBLOCK) return 0; printerror(__func__, "read %d bytes from fd %d failed", node->readbuf_len, fd); return -1; } /* record the ifindex now, as the cb may need it */ if(scamper_fd_ifindex(node->fdn, &dl.dl_ifindex) != 0) { return -1; } while(buf < readbuf + len) { bpf_hdr = (struct bpf_hdr *)buf; /* reset the datalink record */ memset(&dl, 0, sizeof(dl)); if(node->dlt_cb(&dl, buf + bpf_hdr->bh_hdrlen, bpf_hdr->bh_caplen)) { /* bpf always supplies a timestamp */ dl.dl_flags |= SCAMPER_DL_REC_FLAG_TIMESTAMP; dl.dl_tv.tv_sec = bpf_hdr->bh_tstamp.tv_sec; dl.dl_tv.tv_usec = bpf_hdr->bh_tstamp.tv_usec; scamper_task_handledl(&dl); } buf += BPF_WORDALIGN(bpf_hdr->bh_caplen + bpf_hdr->bh_hdrlen); } return 0; } static int dl_bpf_tx(const scamper_dl_t *node, const uint8_t *pkt, const size_t len) { ssize_t wb; if((wb = write(scamper_fd_fd_get(node->fdn), pkt, len)) < (ssize_t)len) { if(wb == -1) printerror(__func__, "%d bytes failed", len); else scamper_debug(__func__, "%d bytes sent of %d total", wb, len); return -1; } return 0; } static int dl_bpf_filter(scamper_dl_t *node, struct bpf_insn *insns, int len) { struct bpf_program prog; prog.bf_len = len; prog.bf_insns = insns; if(ioctl(scamper_fd_fd_get(node->fdn), BIOCSETF, (caddr_t)&prog) == -1) { printerror(__func__, "BIOCSETF failed"); return -1; } return 0; } #elif defined(__linux__) static int dl_linux_open(const int ifindex) { struct sockaddr_ll sll; int fd; /* open the socket in non cooked mode for now */ if((fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL))) == -1) { printerror(__func__, "could not open PF_PACKET"); return -1; } /* scamper only wants packets on this interface */ memset(&sll, 0, sizeof(sll)); sll.sll_family = AF_PACKET; sll.sll_ifindex = ifindex; sll.sll_protocol = htons(ETH_P_ALL); if(bind(fd, (struct sockaddr *)&sll, sizeof(sll)) == -1) { printerror(__func__, "could not bind to %d", ifindex); close(fd); return -1; } return fd; } static int dl_linux_node_init(const scamper_fd_t *fdn, scamper_dl_t *node) { struct ifreq ifreq; char ifname[IFNAMSIZ]; int fd, ifindex; if(scamper_fd_ifindex(fdn, &ifindex) != 0) { goto err; } if((fd = scamper_fd_fd_get(fdn)) < 0) { goto err; } if(if_indextoname(ifindex, ifname) == NULL) { printerror(__func__, "if_indextoname %d failed", ifindex); goto err; } /* find out what type of datalink the interface has */ memcpy(ifreq.ifr_name, ifname, sizeof(ifreq.ifr_name)); if(ioctl(fd, SIOCGIFHWADDR, &ifreq) == -1) { printerror(__func__, "%s SIOCGIFHWADDR failed", ifname); goto err; } node->type = ifreq.ifr_hwaddr.sa_family; /* scamper can only deal with ethernet datalinks at this time */ switch(node->type) { case ARPHRD_ETHER: node->dlt_cb = dlt_en10mb_cb; node->tx_type = SCAMPER_DL_TX_ETHERNET; break; case ARPHRD_LOOPBACK: node->dlt_cb = dlt_en10mb_cb; node->tx_type = SCAMPER_DL_TX_ETHLOOP; break; #if defined(ARPHRD_SIT) case ARPHRD_SIT: node->dlt_cb = dlt_raw_cb; node->tx_type = SCAMPER_DL_TX_RAW; break; #endif #if defined(ARPHRD_IEEE1394) case ARPHRD_IEEE1394: node->dlt_cb = dlt_firewire_cb; node->tx_type = SCAMPER_DL_TX_UNSUPPORTED; break; #endif #if defined(ARPHRD_VOID) case ARPHRD_VOID: node->dlt_cb = dlt_raw_cb; node->tx_type = SCAMPER_DL_TX_UNSUPPORTED; break; #endif default: scamper_debug(__func__, "%s unhandled datalink %d", ifname, node->type); goto err; } return 0; err: return -1; } static int dl_linux_read(const int fd, scamper_dl_t *node) { scamper_dl_rec_t dl; ssize_t len; struct sockaddr_ll from; socklen_t fromlen; fromlen = sizeof(from); while((len = recvfrom(fd, readbuf, readbuf_len, MSG_TRUNC, (struct sockaddr *)&from, &fromlen)) == -1) { if(errno == EINTR) { fromlen = sizeof(from); continue; } if(errno == EAGAIN) { return 0; } printerror(__func__, "read %d bytes from fd %d failed", readbuf_len, fd); return -1; } /* sanity check the packet length */ if(len > readbuf_len) len = readbuf_len; /* reset the datalink record */ memset(&dl, 0, sizeof(dl)); /* record the ifindex now, as the cb routine may need it */ if(scamper_fd_ifindex(node->fdn, &dl.dl_ifindex) != 0) { return -1; } /* if the packet passes the filter, we need to get the time it was rx'd */ if(node->dlt_cb(&dl, readbuf, len)) { /* scamper treats the failure of this ioctl as non-fatal */ if(ioctl(fd, SIOCGSTAMP, &dl.dl_tv) == 0) { dl.dl_flags |= SCAMPER_DL_REC_FLAG_TIMESTAMP; } else { printerror(__func__, "could not SIOCGSTAMP on fd %d", fd); } scamper_task_handledl(&dl); } return 0; } static int dl_linux_tx(const scamper_dl_t *node, const uint8_t *pkt, const size_t len) { struct sockaddr_ll sll; struct sockaddr *sa = (struct sockaddr *)&sll; ssize_t wb; int fd, ifindex; if(scamper_fd_ifindex(node->fdn, &ifindex) != 0) { return -1; } memset(&sll, 0, sizeof(sll)); sll.sll_family = AF_PACKET; sll.sll_ifindex = ifindex; if(node->type == ARPHRD_SIT) sll.sll_protocol = htons(ETH_P_IPV6); else sll.sll_protocol = htons(ETH_P_ALL); fd = scamper_fd_fd_get(node->fdn); if((wb = sendto(fd, pkt, len, 0, sa, sizeof(sll))) < (ssize_t)len) { if(wb == -1) printerror(__func__, "%d bytes failed", len); else scamper_debug(__func__, "%d bytes sent of %d total", wb, len); return -1; } return 0; } static int dl_linux_filter(scamper_dl_t *node, struct sock_filter *insns, int len) { struct sock_fprog prog; int i; for(i=0; i 0) { insns[i].k = 65535; } } prog.len = len; prog.filter = insns; if(setsockopt(scamper_fd_fd_get(node->fdn), SOL_SOCKET, SO_ATTACH_FILTER, (caddr_t)&prog, sizeof(prog)) == -1) { printerror(__func__, "SO_ATTACH_FILTER failed"); return -1; } return 0; } #elif defined(HAVE_DLPI) static int dl_dlpi_open(const int ifindex) { char ifname[5+IFNAMSIZ]; int fd; strncpy(ifname, "/dev/", sizeof(ifname)); if(if_indextoname(ifindex, ifname+5) == NULL) { printerror(__func__, "if_indextoname %d failed", ifindex); return -1; } if((fd = open(ifname, O_RDWR)) == -1) { printerror(__func__, "could not open %s", ifname); return -1; } return fd; } static int dl_dlpi_req(const int fd, void *req, size_t len) { union DL_primitives *dlp; struct strbuf ctl; ctl.maxlen = 0; ctl.len = len; ctl.buf = (char *)req; if(putmsg(fd, &ctl, NULL, 0) == -1) { dlp = req; printerror(__func__, "could not putmsg %d", dlp->dl_primitive); return -1; } return 0; } static int dl_dlpi_ack(const int fd, void *ack, int primitive) { union DL_primitives *dlp; struct strbuf ctl; int flags; flags = 0; ctl.maxlen = MAXDLBUF; ctl.len = 0; ctl.buf = (char *)ack; if(getmsg(fd, &ctl, NULL, &flags) == -1) { printerror(__func__, "could not getmsg %d", primitive); return -1; } dlp = ack; if(dlp->dl_primitive != primitive) { scamper_debug(__func__, "expected %d, got %d", primitive, dlp->dl_primitive); return -1; } return 0; } static int dl_dlpi_promisc(const int fd, const int level) { dl_promiscon_req_t promiscon_req; uint32_t buf[MAXDLBUF]; promiscon_req.dl_primitive = DL_PROMISCON_REQ; promiscon_req.dl_level = level; if(dl_dlpi_req(fd, &promiscon_req, sizeof(promiscon_req)) == -1) { return -1; } /* check for an ack to the promisc req */ if(dl_dlpi_ack(fd, buf, DL_OK_ACK) == -1) { return -1; } return 0; } static int strioctl(int fd, int cmd, void *dp, int len) { struct strioctl str; str.ic_cmd = cmd; str.ic_timout = -1; str.ic_len = len; str.ic_dp = (char *)dp; if(ioctl(fd, I_STR, &str) == -1) { return -1; } return str.ic_len; } static int dl_dlpi_node_init(const scamper_fd_t *fdn, scamper_dl_t *node) { uint32_t buf[MAXDLBUF]; struct timeval tv; dl_info_req_t info_req; dl_info_ack_t *info_ack; dl_attach_req_t attach_req; dl_bind_req_t bind_req; int i, fd; #ifndef NDEBUG char ifname[IFNAMSIZ]; int ifindex; #endif if((fd = scamper_fd_fd_get(fdn)) < 0) { return -1; } /* * send an information request to the datalink to determine what type * of packets they supply */ info_req.dl_primitive = DL_INFO_REQ; if(dl_dlpi_req(fd, &info_req, sizeof(info_req)) == -1) { return -1; } /* * read the information acknowledgement, which contains details on the * type of the interface, etc. */ if(dl_dlpi_ack(fd, buf, DL_INFO_ACK) == -1) { return -1; } info_ack = (dl_info_ack_t *)buf; /* record the mac type with the node */ node->type = info_ack->dl_mac_type; /* determine how to handle the datalink */ switch(node->type) { case DL_CSMACD: case DL_ETHER: node->dlt_cb = dlt_en10mb_cb; node->tx_type = SCAMPER_DL_TX_ETHERNET; break; default: node->tx_type = SCAMPER_DL_TX_UNSUPPORTED; scamper_debug(__func__, "unhandled datalink %d", node->type); return -1; } /* attach to the interface */ if(info_ack->dl_provider_style == DL_STYLE2) { attach_req.dl_primitive = DL_ATTACH_REQ; attach_req.dl_ppa = 0; if(dl_dlpi_req(fd, &attach_req, sizeof(attach_req)) == -1) { return -1; } /* check for a generic ack */ if(dl_dlpi_ack(fd, buf, DL_OK_ACK) == -1) { return -1; } } /* bind the interface */ memset(&bind_req, 0, sizeof(bind_req)); bind_req.dl_primitive = DL_BIND_REQ; bind_req.dl_service_mode = DL_CLDLS; if(dl_dlpi_req(fd, &bind_req, sizeof(bind_req)) == -1) { return -1; } /* check for an ack to the bind */ if(dl_dlpi_ack(fd, buf, DL_BIND_ACK) == -1) { return -1; } /* * turn on phys and sap promisc modes. dlpi will not supply outbound * probe packets unless in phys promisc mode. */ if(dl_dlpi_promisc(fd, DL_PROMISC_PHYS) == -1 || dl_dlpi_promisc(fd, DL_PROMISC_SAP) == -1) { return -1; } /* get full link layer */ if(strioctl(fd, DLIOCRAW, NULL, 0) == -1) { printerror(__func__, "could not DLIOCRAW"); return -1; } /* push bufmod */ if(ioctl(fd, I_PUSH, "bufmod") == -1) { printerror(__func__, "could not push bufmod"); return -1; } /* we need the first 1500 bytes of the packet */ i = 1500; if(strioctl(fd, SBIOCSSNAP, &i, sizeof(i)) == -1) { printerror(__func__, "could not SBIOCSSNAP %d", i); return -1; } /* send the data every 50ms */ tv.tv_sec = 0; tv.tv_usec = 50000; if(strioctl(fd, SBIOCSTIME, &tv, sizeof(tv)) == -1) { printerror(__func__, "could not SBIOCSTIME %d.%06d", tv.tv_sec, tv.tv_usec); return -1; } /* set the chunk length */ i = 65535; if(strioctl(fd, SBIOCSCHUNK, &i, sizeof(i)) == -1) { printerror(__func__, "could not SBIOCSCHUNK %d", i); return -1; } if(ioctl(fd, I_FLUSH, FLUSHR) == -1) { printerror(__func__, "could not flushr"); return -1; } #ifndef NDEBUG if(scamper_fd_ifindex(fdn, &ifindex) != 0 || if_indextoname(ifindex, ifname) == NULL) { strncpy(ifname, "", sizeof(ifname)-1); ifname[sizeof(ifname)-1] = '\0'; } scamper_debug(__func__, "dlpi if %s index %d datalink %d", ifname, ifindex, node->type); #endif return 0; } static int dl_dlpi_read(const int fd, scamper_dl_t *node) { scamper_dl_rec_t dl; struct strbuf data; struct sb_hdr *sbh; uint8_t *buf = readbuf; int flags; flags = 0; data.buf = (void *)readbuf; data.maxlen = readbuf_len; data.len = 0; if(getmsg(fd, NULL, &data, &flags) == -1) { printerror(__func__, "could not getmsg"); return -1; } while(buf < readbuf + data.len) { sbh = (struct sb_hdr *)buf; memset(&dl, 0, sizeof(dl)); dl.dl_flags = SCAMPER_DL_REC_FLAG_TIMESTAMP; if(node->dlt_cb(&dl, buf + sizeof(struct sb_hdr), sbh->sbh_msglen)) { dl.dl_tv.tv_sec = sbh->sbh_timestamp.tv_sec; dl.dl_tv.tv_usec = sbh->sbh_timestamp.tv_usec; scamper_task_handledl(&dl); } buf += sbh->sbh_totlen; } return -1; } static int dl_dlpi_tx(const scamper_dl_t *node, const uint8_t *pkt, const size_t len) { struct strbuf data; int fd; if((fd = scamper_fd_fd_get(node->fdn)) < 0) return -1; memset(&data, 0, sizeof(data)); data.buf = (void *)pkt; data.len = len; if(putmsg(fd, NULL, &data, 0) != 0) { printerror(__func__, "could not putmsg"); return -1; } return 0; } #endif #if defined(HAVE_BPF_FILTER) #if defined(HAVE_BPF) static void bpf_stmt(struct bpf_insn *insn, uint16_t code, uint32_t k) #else static void bpf_stmt(struct sock_filter *insn, uint16_t code, uint32_t k) #endif { insn->code = code; insn->jt = 0; insn->jf = 0; insn->k = k; return; } static int dl_filter(scamper_dl_t *node) { #if defined(HAVE_BPF) struct bpf_insn insns[1]; #else struct sock_filter insns[1]; #endif bpf_stmt(&insns[0], BPF_RET+BPF_K, 65535); #if defined(HAVE_BPF) if(dl_bpf_filter(node, insns, 1) == -1) #elif defined(__linux__) if(dl_linux_filter(node, insns, 1) == -1) #endif { return -1; } return 0; } #endif int scamper_dl_rec_src(scamper_dl_rec_t *dl, scamper_addr_t *addr) { if(dl->dl_af == AF_INET) addr->type = SCAMPER_ADDR_TYPE_IPV4; else if(dl->dl_af == AF_INET6) addr->type = SCAMPER_ADDR_TYPE_IPV6; else return -1; addr->addr = dl->dl_ip_src; return 0; } int scamper_dl_rec_icmp_ip_dst(scamper_dl_rec_t *dl, scamper_addr_t *addr) { if(dl->dl_af == AF_INET) addr->type = SCAMPER_ADDR_TYPE_IPV4; else if(dl->dl_af == AF_INET6) addr->type = SCAMPER_ADDR_TYPE_IPV6; else return -1; addr->addr = dl->dl_icmp_ip_dst; return 0; } #if !defined(NDEBUG) && !defined(WITHOUT_DEBUGFILE) void scamper_dl_rec_frag_print(const scamper_dl_rec_t *dl) { char addr[64]; uint32_t id; assert(dl->dl_af == AF_INET || dl->dl_af == AF_INET6); if(dl->dl_af == AF_INET) id = dl->dl_ip_id; else id = dl->dl_ip6_id; scamper_debug(NULL, "from %s len %d ipid %u off %u", addr_tostr(dl->dl_af, dl->dl_ip_src, addr, sizeof(addr)), dl->dl_ip_size, id, dl->dl_ip_off); return; } void scamper_dl_rec_udp_print(const scamper_dl_rec_t *dl) { char addr[64], ipid[16]; assert(dl->dl_af == AF_INET || dl->dl_af == AF_INET6); assert(dl->dl_ip_proto == IPPROTO_UDP); if(dl->dl_af == AF_INET) snprintf(ipid, sizeof(ipid), "ipid 0x%04x ", dl->dl_ip_id); else ipid[0] = '\0'; scamper_debug(NULL, "from %s %sudp %d:%d len %d", addr_tostr(dl->dl_af, dl->dl_ip_src, addr, sizeof(addr)), ipid, dl->dl_tcp_sport, dl->dl_tcp_dport, dl->dl_ip_size); return; } void scamper_dl_rec_tcp_print(const scamper_dl_rec_t *dl) { static const char *tcpflags[] = { "fin", "syn", "rst", "psh", "ack", "urg", "ece", "cwr" }; uint8_t u8; size_t off; char addr[64]; char fbuf[32], *flags; char pos[32]; char ipid[16]; int i; assert(dl->dl_af == AF_INET || dl->dl_af == AF_INET6); assert(dl->dl_ip_proto == IPPROTO_TCP); if((u8 = dl->dl_tcp_flags) != 0) { flags = fbuf; for(i=0; i<8; i++) { if((dl->dl_tcp_flags & (1<dl_tcp_seq); if(dl->dl_tcp_flags & TH_ACK) string_concat(pos, sizeof(pos), &off, ":%u", dl->dl_tcp_ack); if(dl->dl_af == AF_INET) snprintf(ipid, sizeof(ipid), "ipid 0x%04x ", dl->dl_ip_id); else ipid[0] = '\0'; scamper_debug(NULL, "from %s %stcp %d:%d %s %s len %d", addr_tostr(dl->dl_af, dl->dl_ip_src, addr, sizeof(addr)), ipid, dl->dl_tcp_sport, dl->dl_tcp_dport, flags, pos, dl->dl_ip_size); return; } void scamper_dl_rec_icmp_print(const scamper_dl_rec_t *dl) { char *t = NULL, tbuf[64]; char *c = NULL, cbuf[64]; char addr[64]; char ip[256]; char icmp[256]; char inner_ip[256]; char inner_transport[256]; size_t off; assert(dl->dl_af == AF_INET || dl->dl_af == AF_INET6); if(dl->dl_af == AF_INET) { addr_tostr(AF_INET, dl->dl_ip_src, addr, sizeof(addr)); snprintf(ip, sizeof(ip), "from %s size %d ttl %d tos 0x%02x ipid 0x%04x", addr, dl->dl_ip_size, dl->dl_ip_ttl, dl->dl_ip_tos, dl->dl_ip_id); switch(dl->dl_icmp_type) { case ICMP_UNREACH: t = "unreach"; switch(dl->dl_icmp_code) { case ICMP_UNREACH_NET: c = "net"; break; case ICMP_UNREACH_HOST: c = "host"; break; case ICMP_UNREACH_PROTOCOL: c = "protocol"; break; case ICMP_UNREACH_PORT: c = "port"; break; case ICMP_UNREACH_SRCFAIL: c = "src-rt failed"; break; case ICMP_UNREACH_NET_UNKNOWN: c = "net unknown"; break; case ICMP_UNREACH_HOST_UNKNOWN: c = "host unknown"; break; case ICMP_UNREACH_ISOLATED: c = "isolated"; break; case ICMP_UNREACH_NET_PROHIB: c = "net prohib"; break; case ICMP_UNREACH_HOST_PROHIB: c = "host prohib"; break; case ICMP_UNREACH_TOSNET: c = "tos net"; break; case ICMP_UNREACH_TOSHOST: c = "tos host"; break; case ICMP_UNREACH_FILTER_PROHIB: c = "admin prohib"; break; case ICMP_UNREACH_NEEDFRAG: /* * use the type buf to be consistent with the ICMP6 * fragmentation required message */ snprintf(tbuf, sizeof(tbuf), "need frag %d", dl->dl_icmp_nhmtu); t = tbuf; break; default: snprintf(cbuf, sizeof(cbuf), "code %d", dl->dl_icmp_code); c = cbuf; break; } break; case ICMP_TIMXCEED: t = "time exceeded"; switch(dl->dl_icmp_code) { case ICMP_TIMXCEED_INTRANS: c = "in trans"; break; case ICMP_TIMXCEED_REASS: c = "in reass"; break; default: snprintf(cbuf, sizeof(cbuf), "code %d", dl->dl_icmp_code); c = cbuf; break; } break; case ICMP_ECHOREPLY: t = "echo reply"; snprintf(cbuf, sizeof(cbuf), "id %d seq %d", dl->dl_icmp_id, dl->dl_icmp_seq); c = cbuf; break; case ICMP_TSTAMPREPLY: t = "time reply"; snprintf(cbuf, sizeof(cbuf), "id %d seq %d", dl->dl_icmp_id, dl->dl_icmp_seq); c = cbuf; break; } } else { addr_tostr(AF_INET6, dl->dl_ip_src, addr, sizeof(addr)); off = 0; string_concat(ip, sizeof(ip), &off, "from %s size %d hlim %d", addr, dl->dl_ip_size, dl->dl_ip_hlim); if(dl->dl_ip_flags & SCAMPER_DL_IP_FLAG_FRAG) string_concat(ip, sizeof(ip), &off, " ipid 0x%08x", dl->dl_ip6_id); switch(dl->dl_icmp_type) { case ICMP6_DST_UNREACH: t = "unreach"; switch(dl->dl_icmp_code) { case ICMP6_DST_UNREACH_NOROUTE: c = "no route"; break; case ICMP6_DST_UNREACH_ADMIN: c = "admin prohib"; break; case ICMP6_DST_UNREACH_BEYONDSCOPE: c = "beyond scope"; break; case ICMP6_DST_UNREACH_ADDR: c = "addr"; break; case ICMP6_DST_UNREACH_NOPORT: c = "port"; break; default: snprintf(cbuf, sizeof(cbuf), "code %d", dl->dl_icmp_code); c = cbuf; break; } break; case ICMP6_TIME_EXCEEDED: t = "time exceeded"; switch(dl->dl_icmp_code) { case ICMP6_TIME_EXCEED_TRANSIT: c = "in trans"; break; case ICMP6_TIME_EXCEED_REASSEMBLY: c = "in reass"; break; default: snprintf(cbuf, sizeof(cbuf), "code %d", dl->dl_icmp_code); c = cbuf; break; } break; case ICMP6_PACKET_TOO_BIG: snprintf(tbuf, sizeof(tbuf), "need frag %d", dl->dl_icmp_nhmtu); t = tbuf; break; case ICMP6_ECHO_REPLY: t = "echo reply"; snprintf(cbuf, sizeof(cbuf), "id %d seq %d", dl->dl_icmp_id, dl->dl_icmp_seq); c = cbuf; break; } } if(t == NULL) { snprintf(icmp, sizeof(icmp), "icmp %d code %d", dl->dl_icmp_type, dl->dl_icmp_code); } else if(c == NULL) { snprintf(icmp, sizeof(icmp), "icmp %s", t); } else { snprintf(icmp, sizeof(icmp), "icmp %s %s", t, c); } if(dl->dl_icmp_ip_dst != NULL) { if(dl->dl_af == AF_INET) { addr_tostr(AF_INET, dl->dl_icmp_ip_dst, addr, sizeof(addr)); snprintf(inner_ip, sizeof(inner_ip), " to %s size %d ttl %d tos 0x%02x ipid 0x%04x", addr, dl->dl_icmp_ip_size, dl->dl_icmp_ip_ttl, dl->dl_icmp_ip_tos, dl->dl_icmp_ip_id); } else { addr_tostr(AF_INET6, dl->dl_icmp_ip_dst, addr, sizeof(addr)); snprintf(inner_ip, sizeof(inner_ip), " to %s size %d hlim %d flow 0x%05x", addr, dl->dl_icmp_ip_size, dl->dl_icmp_ip_hlim, dl->dl_icmp_ip_flow); } switch(dl->dl_icmp_ip_proto) { case IPPROTO_UDP: snprintf(inner_transport, sizeof(inner_transport), " proto UDP sport %d dport %d sum 0x%04x", dl->dl_icmp_udp_sport, dl->dl_icmp_udp_dport, ntohs(dl->dl_icmp_udp_sum)); break; case IPPROTO_ICMP: case IPPROTO_ICMPV6: snprintf(inner_transport, sizeof(inner_transport), " proto ICMP type %d code %d id %04x seq %d", dl->dl_icmp_icmp_type, dl->dl_icmp_icmp_code, dl->dl_icmp_icmp_id, dl->dl_icmp_icmp_seq); break; case IPPROTO_TCP: snprintf(inner_transport, sizeof(inner_transport), " proto TCP sport %d dport %d seq %08x", dl->dl_icmp_tcp_sport, dl->dl_icmp_tcp_dport, dl->dl_icmp_tcp_seq); break; default: inner_transport[0] = '\0'; break; } } else { inner_ip[0] = '\0'; inner_transport[0] = '\0'; } scamper_debug(NULL, "%s %s%s%s", ip, icmp, inner_ip, inner_transport); return; } #endif /* * dl_read_cb * * this function is called by scamper_fds when a BPF fd fires as being * available to read from. */ void scamper_dl_read_cb(const int fd, void *param) { assert(param != NULL); #if defined(HAVE_BPF) dl_bpf_read(fd, (scamper_dl_t *)param); #elif defined(__linux__) dl_linux_read(fd, (scamper_dl_t *)param); #elif defined(HAVE_DLPI) dl_dlpi_read(fd, (scamper_dl_t *)param); #endif return; } void scamper_dl_state_free(scamper_dl_t *dl) { assert(dl != NULL); free(dl); return; } /* * scamper_dl_state_alloc * * given the scamper_fd_t supplied, initialise the file descriptor and do * initial setup tasks, then compile and set a filter to pick up the packets * scamper is responsible for transmitting. */ scamper_dl_t *scamper_dl_state_alloc(scamper_fd_t *fdn) { scamper_dl_t *dl = NULL; if((dl = malloc_zero(sizeof(scamper_dl_t))) == NULL) { printerror(__func__, "malloc node failed"); goto err; } dl->fdn = fdn; #if defined(HAVE_BPF) if(dl_bpf_node_init(fdn, dl) == -1) #elif defined(__linux__) if(dl_linux_node_init(fdn, dl) == -1) #elif defined(HAVE_DLPI) if(dl_dlpi_node_init(fdn, dl) == -1) #endif { goto err; } #if defined(HAVE_BPF_FILTER) dl_filter(dl); #endif return dl; err: scamper_dl_state_free(dl); return NULL; } int scamper_dl_tx(const scamper_dl_t *node, const uint8_t *pkt, const size_t len) { #if defined(HAVE_BPF) if(dl_bpf_tx(node, pkt, len) == -1) #elif defined(__linux__) if(dl_linux_tx(node, pkt, len) == -1) #elif defined(HAVE_DLPI) if(dl_dlpi_tx(node, pkt, len) == -1) #endif { return -1; } return 0; } int scamper_dl_tx_type(scamper_dl_t *dl) { return dl->tx_type; } void scamper_dl_close(int fd) { #ifndef _WIN32 close(fd); #endif return; } /* * scamper_dl_open_fd * * routine to actually open a datalink. called by scamper_dl_open below, * as well as by the privsep code. */ int scamper_dl_open_fd(const int ifindex) { #if defined(HAVE_BPF) return dl_bpf_open(ifindex); #elif defined(__linux__) return dl_linux_open(ifindex); #elif defined(HAVE_DLPI) return dl_dlpi_open(ifindex); #elif defined(_WIN32) return -1; #endif } /* * scamper_dl_open * * return a file descriptor for the datalink for the interface specified. * use privilege separation if required, otherwise open fd directly. */ int scamper_dl_open(const int ifindex) { int fd; #if defined(WITHOUT_PRIVSEP) if((fd = scamper_dl_open_fd(ifindex)) == -1) #else if((fd = scamper_privsep_open_datalink(ifindex)) == -1) #endif { scamper_debug(__func__, "could not open ifindex %d", ifindex); return -1; } return fd; } void scamper_dl_cleanup() { if(readbuf != NULL) { free(readbuf); readbuf = NULL; } return; } int scamper_dl_init() { #if defined(HAVE_BPF) if(dl_bpf_init() == -1) { return -1; } #elif defined(__linux__) readbuf_len = 128; if((readbuf = malloc_zero(readbuf_len)) == NULL) { printerror(__func__, "could not malloc readbuf"); readbuf_len = 0; return -1; } #elif defined(HAVE_DLPI) readbuf_len = 65536; /* magic obtained from pcap-dlpi.c */ if((readbuf = malloc_zero(readbuf_len)) == NULL) { printerror(__func__, "could not malloc readbuf"); readbuf_len = 0; return -1; } #endif return 0; } scamper-cvs-20171204/scamper/scamper_dl.h000644 001751 000000 00000046445 12575721502 020052 0ustar00mjlwheel000000 000000 /* * scamper_dl.h * * $Id: scamper_dl.h,v 1.62 2015/09/15 04:49:06 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012 Matthew Luckie * Copyright (c) 2013-2015 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DL_H #define __SCAMPER_DL_H /* * these flags are set in scamper_dl_rec.dl_flags * * SCAMPER_DL_REC_FLAG_TIMESTAMP: if set, the datalink record has a timestamp * obtained from the datalink. * * SCAMPER_DL_REC_FLAG_IP: if set, the datalink record has an IP header * obtained from the datalink, and it is complete. * * SCAMPER_DL_REC_FLAG_TRANS: if set, the datalink record has a IP transport * header (ICMP, UDP, TCP) obtained from the datalink, and it is complete * for the purposes it is designed for. */ #define SCAMPER_DL_REC_FLAG_TIMESTAMP 0x01 #define SCAMPER_DL_REC_FLAG_NET 0x02 #define SCAMPER_DL_REC_FLAG_TRANS 0x04 #define SCAMPER_DL_REC_NET_TYPE_IP 0x01 #define SCAMPER_DL_REC_NET_TYPE_ARP 0x02 /* * these types are set in scamper_dl_rec.dl_type * * SCAMPER_DL_TYPE_RAW: datalink record off a raw interface, no L2 header * SCAMPER_DL_TYPE_NULL: datalink record off a null interface, no L2 recorded * SCAMPER_DL_TYPE_ETHERNET: datalink record off an ethernet interface * SCAMPER_DL_TYPE_FIREWIRE: datalink record off a firewire interface */ #define SCAMPER_DL_TYPE_RAW 0x01 #define SCAMPER_DL_TYPE_NULL 0x02 #define SCAMPER_DL_TYPE_ETHERNET 0x03 #define SCAMPER_DL_TYPE_FIREWIRE 0x04 #define SCAMPER_DL_IP_FLAG_DF 0x01 #define SCAMPER_DL_IP_FLAG_MF 0x02 #define SCAMPER_DL_IP_FLAG_FRAG 0x04 #define SCAMPER_DL_IP_FLAG_REASS 0x08 #define SCAMPER_DL_TCP_OPT_SACKP 0x01 #define SCAMPER_DL_TCP_OPT_TS 0x02 #define SCAMPER_DL_TCP_OPT_FO 0x04 #define SCAMPER_DL_TCP_OPT_FO_EXP 0x08 #define SCAMPER_DL_IS_IP(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP) #define SCAMPER_DL_IS_IPV4(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_af == AF_INET) #define SCAMPER_DL_IS_IPV6(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_af == AF_INET6) #define SCAMPER_DL_IS_ICMP(dl) ( \ ((dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP) && \ (((dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1) || \ ((dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58))) #define SCAMPER_DL_IS_UDP(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_ip_proto == 17) #define SCAMPER_DL_IS_TCP(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_ip_proto == 6) #define SCAMPER_DL_IS_TCP_SYNACK(dl) ( \ SCAMPER_DL_IS_TCP(dl) && \ ((dl)->dl_tcp_flags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK)) #define SCAMPER_DL_IS_ICMPV4(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1) #define SCAMPER_DL_IS_ICMPV6(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58) #define SCAMPER_DL_IS_ICMP_Q_ICMP(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ ((dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1 && \ (dl)->dl_icmp_ip_proto == 1) || \ ((dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58 && \ (dl)->dl_icmp_ip_proto == 58))) #define SCAMPER_DL_IS_ICMP_Q_UDP(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (((dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1) || \ ((dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58)) && \ (dl)->dl_icmp_ip_proto == 17) #define SCAMPER_DL_IS_ICMP_Q_TCP(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (((dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1) || \ ((dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58)) && \ (dl)->dl_icmp_ip_proto == 6) #define SCAMPER_DL_IS_ICMP_Q_ICMP_ECHO_REQ(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (((dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1 && \ (dl)->dl_icmp_ip_proto == 1 && (dl)->dl_icmp_icmp_type == 8) || \ ((dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58 && \ (dl)->dl_icmp_ip_proto == 58 && (dl)->dl_icmp_icmp_type == 128))) #define SCAMPER_DL_IS_ICMP_Q_ICMP_TIME_REQ(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1 && \ (dl)->dl_icmp_ip_proto == 1 && (dl)->dl_icmp_icmp_type == 13) #define SCAMPER_DL_IS_ICMP_Q_ICMP_ECHO(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (((dl)->dl_af == AF_INET && \ (dl)->dl_ip_proto == 1 && (dl)->dl_icmp_ip_proto == 1 && \ ((dl)->dl_icmp_icmp_type == 8 || (dl)->dl_icmp_icmp_type == 0)) || \ ((dl)->dl_af == AF_INET6 && \ (dl)->dl_ip_proto == 58 && (dl)->dl_icmp_ip_proto == 58 && \ ((dl)->dl_icmp_icmp_type == 128 || (dl)->dl_icmp_icmp_type == 129)))) #define SCAMPER_DL_IS_ICMP_ECHO_REQUEST(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (((dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1 && \ (dl)->dl_icmp_type == 8) || \ ((dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58 && \ (dl)->dl_icmp_type == 128))) #define SCAMPER_DL_IS_ICMP_ECHO_REPLY(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (((dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1 && \ (dl)->dl_icmp_type == 0) || \ ((dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58 && \ (dl)->dl_icmp_type == 129))) #define SCAMPER_DL_IS_ICMP_ECHO(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (((dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1 && \ ((dl)->dl_icmp_type == 0 || (dl)->dl_icmp_type == 8)) || \ ((dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58 && \ ((dl)->dl_icmp_type == 128 || (dl)->dl_icmp_type == 129)))) #define SCAMPER_DL_IS_ICMP_TIME_REPLY(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1 && \ (dl)->dl_icmp_icmp_type == 14) #define SCAMPER_DL_IS_ICMP_TTL_EXP(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (((dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1 && \ (dl)->dl_icmp_type == 11) || \ ((dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58 && \ (dl)->dl_icmp_type == 3))) #define SCAMPER_DL_IS_ICMP_UNREACH(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (((dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1 && \ (dl)->dl_icmp_type == 3) || \ ((dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58 && \ (dl)->dl_icmp_type == 1))) #define SCAMPER_DL_IS_ICMP_PACKET_TOO_BIG(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (((dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1 && \ (dl)->dl_icmp_type == 3 && (dl)->dl_icmp_code == 4) || \ ((dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58 && \ (dl)->dl_icmp_type == 2))) #define SCAMPER_DL_IS_ICMP_PARAMPROB(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_af == AF_INET && (dl)->dl_ip_proto == 1 && \ (dl)->dl_icmp_type == 12) #define SCAMPER_DL_IS_ICMP6_ND_NADV(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58 && \ (dl)->dl_icmp_type == 136) #define SCAMPER_DL_IS_ICMP6_ND_NSOL(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_af == AF_INET6 && (dl)->dl_ip_proto == 58 && \ (dl)->dl_icmp_type == 135) #define SCAMPER_DL_IS_ARP(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_ARP) #define SCAMPER_DL_IS_ARP_OP_REQ(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_ARP && \ (dl)->dl_arp_op == 1) #define SCAMPER_DL_IS_ARP_OP_REPLY(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_ARP && \ (dl)->dl_arp_op == 2) #define SCAMPER_DL_IS_ARP_HRD_ETHERNET(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_ARP && \ (dl)->dl_arp_hrd == 1) #define SCAMPER_DL_IS_ARP_PRO_IPV4(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_ARP && \ (dl)->dl_arp_pro == 0x0800) #define SCAMPER_DL_IS_IP_DF(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ (dl)->dl_af == AF_INET && ((dl)->dl_ip_flags & SCAMPER_DL_IP_FLAG_DF) != 0) #define SCAMPER_DL_IS_IP_MF(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ ((dl)->dl_ip_flags & SCAMPER_DL_IP_FLAG_MF) != 0) #define SCAMPER_DL_IS_IP_FRAG(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ ((dl)->dl_ip_flags & SCAMPER_DL_IP_FLAG_FRAG) != 0) #define SCAMPER_DL_IS_IP_REASS(dl) ( \ (dl)->dl_net_type == SCAMPER_DL_REC_NET_TYPE_IP && \ ((dl)->dl_ip_flags & SCAMPER_DL_IP_FLAG_REASS) != 0) /* * scamper_dl_rec * * this structure summarises details provided by the datalink of packets * that passed the filter. */ typedef struct scamper_dl_rec { /* flags, meanings defined above */ uint32_t dl_flags; /* type of the datalink which passed the packet */ uint32_t dl_type; /* the time that the packet was seen on the datalink */ struct timeval dl_tv; /* * the index assigned by the OS that identifies the interface the * packet was pulled off */ int dl_ifindex; /* * category 1: the datalink frame header, if any. * * scamper records the source and destination link local addresses if the * frame is ethernet or firewire; otherwise these fields are null; */ uint8_t *dl_lladdr_src; uint8_t *dl_lladdr_dst; /* * category 2: the network layer * * scamper records the network headers found. either IPv4/IPv6, or ARP. * */ uint8_t dl_net_type; uint8_t *dl_net_raw; size_t dl_net_rawlen; union { struct dl_ip { int af; /* AF_INET or AF_INET6 */ uint8_t hl; /* header length */ uint8_t *src; /* pointer to raw source IP address */ uint8_t *dst; /* pointer to raw destination IP address */ uint16_t size; /* size of IP packet including header */ uint16_t off; /* fragment offset */ uint16_t ipid; /* IPv4 IP-ID */ uint32_t id; /* IPv6 frag ID */ uint32_t flow; /* IPv6 flowid (20 bits) */ uint8_t tos; /* 8 bits formerly known as type of service */ uint8_t ttl; /* time to live */ uint8_t proto; /* IP protocol */ uint8_t flags; /* flags */ uint8_t *data; /* payload after the IP header */ uint16_t len; /* length of data after the IP header */ } net_ip; struct dl_arp { uint16_t hrd; /* hardware address space */ uint16_t pro; /* protocol address space */ uint8_t hln; /* hardware address length */ uint8_t pln; /* protocol address length */ uint16_t op; /* opcode */ uint8_t *sha; /* hardware address of sender */ uint8_t *spa; /* protocol address of sender */ uint8_t *tha; /* hardware address of target */ uint8_t *tpa; /* protocol address of target */ } net_arp; } dl_net_un; /* * category 3: the transport header * * scamper records the details of the datalink in the following union * [if it understands it] */ union { struct dl_udp { uint16_t sport; uint16_t dport; uint16_t sum; } udp; struct dl_tcp { uint16_t sport; uint16_t dport; uint32_t seq; uint32_t ack; uint8_t hl; uint8_t flags; uint16_t win; uint16_t mss; uint8_t opts; int8_t sack_edgec; uint32_t sack_edges[8]; uint32_t tsval; uint32_t tsecr; uint8_t *data; uint16_t datalen; uint8_t fo_cookie[16]; uint8_t fo_cookielen; } tcp; struct dl_icmp { uint8_t type; uint8_t code; union { struct dl_icmp6_nd { uint8_t *target; uint8_t *opts; uint16_t opts_len; } nd; struct dl_icmp_echo { uint16_t id; uint16_t seq; } echo; struct dl_icmp_err { uint16_t nhmtu; uint8_t *ip_src; uint8_t *ip_dst; uint16_t ip_size; uint16_t ip_id; /* IPv4 ID */ uint32_t ip_flow; /* IPv6 flow */ uint8_t ip_tos; uint8_t ip_ttl; uint8_t ip_proto; union { struct icmp_udp { uint16_t sport; uint16_t dport; uint16_t sum; } udp; struct icmp_tcp { uint16_t sport; uint16_t dport; uint32_t seq; } tcp; struct icmp_icmp { uint8_t type; uint8_t code; uint16_t id; uint16_t seq; } icmp; } trans; } err; } un; } icmp; } dl_trans_un; } scamper_dl_rec_t; #define dl_flags dl_flags #define dl_ifindex dl_ifindex #define dl_lladdr_src dl_lladdr_src #define dl_lladdr_dst dl_lladdr_dst #define dl_net_type dl_net_type #define dl_net_raw dl_net_raw #define dl_net_rawlen dl_net_rawlen #define dl_arp_hrd dl_net_un.net_arp.hrd #define dl_arp_pro dl_net_un.net_arp.pro #define dl_arp_hln dl_net_un.net_arp.hln #define dl_arp_pln dl_net_un.net_arp.pln #define dl_arp_op dl_net_un.net_arp.op #define dl_arp_sha dl_net_un.net_arp.sha #define dl_arp_spa dl_net_un.net_arp.spa #define dl_arp_tha dl_net_un.net_arp.tha #define dl_arp_tpa dl_net_un.net_arp.tpa #define dl_af dl_net_un.net_ip.af #define dl_ip_hl dl_net_un.net_ip.hl #define dl_ip_src dl_net_un.net_ip.src #define dl_ip_dst dl_net_un.net_ip.dst #define dl_ip_size dl_net_un.net_ip.size #define dl_ip_id dl_net_un.net_ip.ipid #define dl_ip6_id dl_net_un.net_ip.id #define dl_ip_off dl_net_un.net_ip.off #define dl_ip_tos dl_net_un.net_ip.tos #define dl_ip_ttl dl_net_un.net_ip.ttl #define dl_ip_hlim dl_net_un.net_ip.ttl #define dl_ip_proto dl_net_un.net_ip.proto #define dl_ip_flow dl_net_un.net_ip.flow #define dl_ip_flags dl_net_un.net_ip.flags #define dl_ip_data dl_net_un.net_ip.data #define dl_ip_datalen dl_net_un.net_ip.len #define dl_udp_sport dl_trans_un.udp.sport #define dl_udp_dport dl_trans_un.udp.dport #define dl_udp_sum dl_trans_un.udp.sum #define dl_tcp_sport dl_trans_un.tcp.sport #define dl_tcp_dport dl_trans_un.tcp.dport #define dl_tcp_seq dl_trans_un.tcp.seq #define dl_tcp_ack dl_trans_un.tcp.ack #define dl_tcp_hl dl_trans_un.tcp.hl #define dl_tcp_flags dl_trans_un.tcp.flags #define dl_tcp_win dl_trans_un.tcp.win #define dl_tcp_mss dl_trans_un.tcp.mss #define dl_tcp_opts dl_trans_un.tcp.opts #define dl_tcp_sack_edges dl_trans_un.tcp.sack_edges #define dl_tcp_sack_edgec dl_trans_un.tcp.sack_edgec #define dl_tcp_tsval dl_trans_un.tcp.tsval #define dl_tcp_tsecr dl_trans_un.tcp.tsecr #define dl_tcp_fo_cookie dl_trans_un.tcp.fo_cookie #define dl_tcp_fo_cookielen dl_trans_un.tcp.fo_cookielen #define dl_tcp_data dl_trans_un.tcp.data #define dl_tcp_datalen dl_trans_un.tcp.datalen #define dl_icmp_type dl_trans_un.icmp.type #define dl_icmp_code dl_trans_un.icmp.code #define dl_icmp_id dl_trans_un.icmp.un.echo.id #define dl_icmp_seq dl_trans_un.icmp.un.echo.seq #define dl_icmp_nhmtu dl_trans_un.icmp.un.err.nhmtu #define dl_icmp_ip_src dl_trans_un.icmp.un.err.ip_src #define dl_icmp_ip_dst dl_trans_un.icmp.un.err.ip_dst #define dl_icmp_ip_size dl_trans_un.icmp.un.err.ip_size #define dl_icmp_ip_id dl_trans_un.icmp.un.err.ip_id #define dl_icmp_ip_flow dl_trans_un.icmp.un.err.ip_flow #define dl_icmp_ip_tos dl_trans_un.icmp.un.err.ip_tos #define dl_icmp_ip_ttl dl_trans_un.icmp.un.err.ip_ttl #define dl_icmp_ip_hlim dl_trans_un.icmp.un.err.ip_ttl #define dl_icmp_ip_proto dl_trans_un.icmp.un.err.ip_proto #define dl_icmp_udp_sport dl_trans_un.icmp.un.err.trans.udp.sport #define dl_icmp_udp_dport dl_trans_un.icmp.un.err.trans.udp.dport #define dl_icmp_udp_sum dl_trans_un.icmp.un.err.trans.udp.sum #define dl_icmp_tcp_sport dl_trans_un.icmp.un.err.trans.tcp.sport #define dl_icmp_tcp_dport dl_trans_un.icmp.un.err.trans.tcp.dport #define dl_icmp_tcp_seq dl_trans_un.icmp.un.err.trans.tcp.seq #define dl_icmp_icmp_type dl_trans_un.icmp.un.err.trans.icmp.type #define dl_icmp_icmp_code dl_trans_un.icmp.un.err.trans.icmp.code #define dl_icmp_icmp_id dl_trans_un.icmp.un.err.trans.icmp.id #define dl_icmp_icmp_seq dl_trans_un.icmp.un.err.trans.icmp.seq #define dl_icmp6_nd_target dl_trans_un.icmp.un.nd.target #define dl_icmp6_nd_opts dl_trans_un.icmp.un.nd.opts #define dl_icmp6_nd_opts_len dl_trans_un.icmp.un.nd.opts_len #define SCAMPER_DL_TX_UNSUPPORTED 0x00 #define SCAMPER_DL_TX_ETHERNET 0x01 #define SCAMPER_DL_TX_NULL 0x02 #define SCAMPER_DL_TX_RAW 0x03 #define SCAMPER_DL_TX_ETHLOOP 0x04 typedef struct scamper_dl scamper_dl_t; /* * scamper_dl_init: initialise scamper's datalink structures * scamper_dl_cleanup: cleanup scamper's datalink structures */ int scamper_dl_init(void); void scamper_dl_cleanup(void); int scamper_dl_tx_type(scamper_dl_t *); /* * scamper_dl_open: open datalink interface, use privsep if required * scamper_dl_open_fd: open datalink interface. for the benefit of privsep code */ int scamper_dl_open(const int ifindex); int scamper_dl_open_fd(const int ifindex); void scamper_dl_close(int fd); /* * scamper_dl_state_alloc: allocate state to be held with fd * scamper_dl_state_free: deallocate state */ #ifdef __SCAMPER_FD_H scamper_dl_t *scamper_dl_state_alloc(scamper_fd_t *fdn); void scamper_dl_state_free(scamper_dl_t *dl); #endif /* * scamper_dl_read_cb: callback for read events */ void scamper_dl_read_cb(const int fd, void *param); /* * scamper_dl_tx: * transmit the packet, including relevant headers which are included, on * the datalink. */ int scamper_dl_tx(const scamper_dl_t *dl, const uint8_t *pkt, const size_t len); #ifdef __SCAMPER_ADDR_H int scamper_dl_rec_src(scamper_dl_rec_t *dl, scamper_addr_t *addr); int scamper_dl_rec_icmp_ip_dst(scamper_dl_rec_t *dl, scamper_addr_t *addr); #endif #if !defined(NDEBUG) && !defined(WITHOUT_DEBUGFILE) void scamper_dl_rec_tcp_print(const scamper_dl_rec_t *dl); void scamper_dl_rec_udp_print(const scamper_dl_rec_t *dl); void scamper_dl_rec_frag_print(const scamper_dl_rec_t *dl); void scamper_dl_rec_icmp_print(const scamper_dl_rec_t *dl); #else #define scamper_dl_rec_tcp_print(dl) ((void)0) #define scamper_dl_rec_udp_print(dl) ((void)0) #define scamper_dl_rec_frag_print(dl) ((void)0) #define scamper_dl_rec_icmp_print(dl) ((void)0) #endif #endif /* __SCAMPER_DL_H */ scamper-cvs-20171204/scamper/scamper_dlhdr.c000644 001751 000000 00000013167 12346403264 020534 0ustar00mjlwheel000000 000000 /* * scamper_dlhdr.c * * $Id: scamper_dlhdr.c,v 1.16 2014/06/12 19:59:48 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Copyright (C) 2014 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_dlhdr.c,v 1.16 2014/06/12 19:59:48 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_debug.h" #include "scamper_fds.h" #include "scamper_addr.h" #include "scamper_addr2mac.h" #include "scamper_task.h" #include "scamper_dl.h" #include "scamper_dlhdr.h" #include "scamper_if.h" #include "scamper_list.h" #include "neighbourdisc/scamper_neighbourdisc_do.h" #include "utils.h" static void dlhdr_ethmake(scamper_dlhdr_t *dlhdr, scamper_addr_t *mac) { if((dlhdr->buf = malloc_zero(14)) == NULL) { dlhdr->error = errno; return; } dlhdr->len = 14; /* copy the destination mac address to use */ memcpy(dlhdr->buf, mac->addr, 6); /* the source mac address to use */ if(scamper_if_getmac(dlhdr->ifindex, dlhdr->buf+6) != 0) { dlhdr->error = errno; scamper_debug(__func__, "could not get source mac"); return; } /* the ethertype */ if(SCAMPER_ADDR_TYPE_IS_IPV4(dlhdr->dst)) { dlhdr->buf[12] = 0x08; dlhdr->buf[13] = 0x00; } else if(SCAMPER_ADDR_TYPE_IS_IPV6(dlhdr->dst)) { dlhdr->buf[12] = 0x86; dlhdr->buf[13] = 0xDD; } else { dlhdr->error = EINVAL; scamper_debug(__func__, "unhandled ip->type %d", dlhdr->dst->type); } return; } /* * dlhdr_ethcb * * this callback is used by the neighbour discovery code. */ static void dlhdr_ethcb(void *param, scamper_addr_t *ip, scamper_addr_t *mac) { scamper_dlhdr_t *dlhdr = param; dlhdr->internal = NULL; if(mac != NULL) { scamper_addr2mac_add(dlhdr->ifindex, ip, mac); dlhdr_ethmake(dlhdr, mac); } else { dlhdr->error = ENOENT; } dlhdr->cb(dlhdr); return; } /* * dlhdr_ethernet * * form an ethernet header. as this requires mac addresses, and scamper * may not know the mac address of the relevant IP, this function deals with * doing a neighbour discovery. */ static int dlhdr_ethernet(scamper_dlhdr_t *dlhdr) { scamper_neighbourdisc_do_t *nd = NULL; scamper_addr_t *ip = NULL; scamper_addr_t *mac = NULL; int ifindex = dlhdr->ifindex; /* determine what we should be looking up */ if(dlhdr->gw == NULL) ip = dlhdr->dst; else if(dlhdr->gw->type == SCAMPER_ADDR_TYPE_ETHERNET) mac = dlhdr->gw; else ip = dlhdr->gw; /* if we need to get a mac address, then look it up */ if(mac == NULL && (mac = scamper_addr2mac_whohas(ifindex, ip)) == NULL) { nd = scamper_do_neighbourdisc_do(ifindex, ip, dlhdr, dlhdr_ethcb); if(nd == NULL) { dlhdr->error = errno; goto done; } dlhdr->internal = nd; return 0; } /* give the user what they asked for */ dlhdr_ethmake(dlhdr, mac); done: dlhdr->cb(dlhdr); return 0; } static int dlhdr_ethloop(scamper_dlhdr_t *dlhdr) { if((dlhdr->buf = malloc_zero(14)) == NULL) { dlhdr->error = errno; goto done; } dlhdr->len = 14; if(SCAMPER_ADDR_TYPE_IS_IPV4(dlhdr->dst)) { dlhdr->buf[12] = 0x08; dlhdr->buf[13] = 0x00; } else if(SCAMPER_ADDR_TYPE_IS_IPV6(dlhdr->dst)) { dlhdr->buf[12] = 0x86; dlhdr->buf[13] = 0xDD; } else { dlhdr->error = EINVAL; goto done; } done: dlhdr->cb(dlhdr); return 0; } static int dlhdr_null(scamper_dlhdr_t *dlhdr) { int af; if(SCAMPER_ADDR_TYPE_IS_IPV4(dlhdr->dst)) af = AF_INET; else if(SCAMPER_ADDR_TYPE_IS_IPV6(dlhdr->dst)) af = AF_INET6; else { dlhdr->error = EINVAL; goto done; } if((dlhdr->buf = memdup(&af, sizeof(af))) == NULL) { dlhdr->error = errno; goto done; } dlhdr->len = sizeof(af); done: dlhdr->cb(dlhdr); return 0; } static int dlhdr_raw(scamper_dlhdr_t *dlhdr) { dlhdr->cb(dlhdr); return 0; } static int dlhdr_unsupp(scamper_dlhdr_t *dlhdr) { return -1; } /* * scamper_dlhdr_get * * determine the datalink header to use when framing a packet. */ int scamper_dlhdr_get(scamper_dlhdr_t *dlhdr) { static int (*const func[])(scamper_dlhdr_t *dlhdr) = { dlhdr_unsupp, dlhdr_ethernet, dlhdr_null, dlhdr_raw, dlhdr_ethloop, }; if(dlhdr->txtype < 0 || dlhdr->txtype > 4) { dlhdr->error = EINVAL; return -1; } return func[dlhdr->txtype](dlhdr); } scamper_dlhdr_t *scamper_dlhdr_alloc(void) { return (scamper_dlhdr_t *)malloc_zero(sizeof(scamper_dlhdr_t)); } void scamper_dlhdr_free(scamper_dlhdr_t *dlhdr) { if(dlhdr == NULL) return; if(dlhdr->gw != NULL) scamper_addr_free(dlhdr->gw); if(dlhdr->dst != NULL) scamper_addr_free(dlhdr->dst); if(dlhdr->buf != NULL) free(dlhdr->buf); if(dlhdr->internal != NULL) scamper_neighbourdisc_do_free(dlhdr->internal); free(dlhdr); return; } scamper-cvs-20171204/scamper/scamper_dlhdr.h000644 001751 000000 00000004174 11737356726 020554 0ustar00mjlwheel000000 000000 /* * scamper_dlhdr.h * * $Id: scamper_dlhdr.h,v 1.5 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DLHDR_H #define __SCAMPER_DLHDR_H int scamper_dlhdr_init(void); void scamper_dlhdr_cleanup(void); typedef struct scamper_dlhdr scamper_dlhdr_t; scamper_dlhdr_t *scamper_dlhdr_alloc(void); void scamper_dlhdr_free(scamper_dlhdr_t *dlhdr); int scamper_dlhdr_get(scamper_dlhdr_t *dlhdr); #if defined(__SCAMPER_ADDR_H) /* * scamper_dlhdr * * this struct holds appropriate layer-2 headers to prepend on a packet * to be transmitted with a datalink socket. */ struct scamper_dlhdr { /* * parameters supplied on input: * - final destination of our packet, * - address of the gateway to use, * - interface index, * - type of interface, * - callback to use when we have a dlhdr result, * - parameter that the caller can set for its own use. */ scamper_addr_t *dst; scamper_addr_t *gw; int ifindex; int txtype; void (*cb)(scamper_dlhdr_t *); void *param; /* * result of dlhdr process: * - if there was no error (zero) or not, * - the header to include, and its length, if any. */ int error; uint8_t *buf; uint16_t len; /* a pointer that is used internally by the dlhdr code */ void *internal; }; #endif #endif /* __SCAMPER_DLHDR_H */ scamper-cvs-20171204/scamper/scamper_fds.c000644 001751 000000 00000131177 13210743022 020203 0ustar00mjlwheel000000 000000 /* * scamper_fds: manage events and file descriptors * * $Id: scamper_fds.c,v 1.96 2017/12/03 09:38:26 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2014 Matthew Luckie * Copyright (C) 2012-2015 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_fds.c,v 1.96 2017/12/03 09:38:26 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_fds.h" #include "scamper_debug.h" #include "scamper_icmp4.h" #include "scamper_icmp6.h" #include "scamper_udp4.h" #include "scamper_udp6.h" #include "scamper_tcp4.h" #include "scamper_tcp6.h" #include "scamper_ip4.h" #include "scamper_dl.h" #ifndef _WIN32 #include "scamper_rtsock.h" #endif #include "utils.h" #include "mjl_list.h" #include "mjl_splaytree.h" /* * scamper_fd_poll * * node to hold callback details for the fd. */ typedef struct scamper_fd_poll { scamper_fd_t *fdn; /* back pointer to the fd struct */ scamper_fd_cb_t cb; /* callback to use when event arises */ void *param; /* user-defined parameter to pass to callback */ dlist_t *list; /* which list the node is in */ dlist_node_t *node; /* node in the poll list */ uint8_t flags; /* flags associated with structure */ } scamper_fd_poll_t; /* * scamper_fd * * a file descriptor, details of its type and other identifying information, * and what to do when read/write events are found. */ struct scamper_fd { int fd; /* the file descriptor being polled */ scamper_fd_t *raw; /* if udp4, the raw udp socket */ int type; /* the type of the file descriptor */ int refcnt; /* number of references to this structure */ scamper_fd_poll_t read; /* if monitored for read events */ scamper_fd_poll_t write; /* if monitored for write events */ splaytree_node_t *fd_tree_node; /* node for this fd in the fd_tree */ dlist_node_t *fd_list_node; /* node for this fd in the fd_list */ struct timeval tv; /* when this node should be expired */ dlist_node_t *rc0; /* node in refcnt_0 list */ union { struct fd_t_tcp { void *addr; uint16_t sport; } fd_t_tcp; struct fd_t_udp { void *addr; uint16_t sport; } fd_t_udp; struct fd_t_icmp { void *addr; } fd_t_icmp; struct fd_t_dl { int ifindex; scamper_dl_t *dl; } fd_t_dl; } fd_t_un; }; #define SCAMPER_FD_TYPE_PRIVATE 0x00 #define SCAMPER_FD_TYPE_ICMP4 0x01 #define SCAMPER_FD_TYPE_ICMP6 0x02 #define SCAMPER_FD_TYPE_UDP4 0x03 #define SCAMPER_FD_TYPE_UDP4DG 0x04 #define SCAMPER_FD_TYPE_UDP6 0x05 #define SCAMPER_FD_TYPE_TCP4 0x06 #define SCAMPER_FD_TYPE_TCP6 0x07 #define SCAMPER_FD_TYPE_DL 0x08 #define SCAMPER_FD_TYPE_IP4 0x09 #define SCAMPER_FD_TYPE_FILE 0x0a #ifndef _WIN32 #define SCAMPER_FD_TYPE_RTSOCK 0x0b #define SCAMPER_FD_TYPE_IFSOCK 0x0c #endif #define SCAMPER_FD_TYPE_IS_UDP(fd) ( \ (fd)->type == SCAMPER_FD_TYPE_UDP4 || \ (fd)->type == SCAMPER_FD_TYPE_UDP4DG || \ (fd)->type == SCAMPER_FD_TYPE_UDP6) #define SCAMPER_FD_TYPE_IS_ICMP(fd) ( \ (fd)->type == SCAMPER_FD_TYPE_ICMP4 || \ (fd)->type == SCAMPER_FD_TYPE_ICMP6) #define SCAMPER_FD_TYPE_IS_TCP(fd) ( \ (fd)->type == SCAMPER_FD_TYPE_TCP4 || \ (fd)->type == SCAMPER_FD_TYPE_TCP6) #define SCAMPER_FD_TYPE_IS_IPV4(fd) ( \ (fd)->type == SCAMPER_FD_TYPE_ICMP4 || \ (fd)->type == SCAMPER_FD_TYPE_UDP4 || \ (fd)->type == SCAMPER_FD_TYPE_UDP4DG || \ (fd)->type == SCAMPER_FD_TYPE_TCP4) #define SCAMPER_FD_TYPE_IS_IPV6(fd) ( \ (fd)->type == SCAMPER_FD_TYPE_ICMP6 || \ (fd)->type == SCAMPER_FD_TYPE_UDP6 || \ (fd)->type == SCAMPER_FD_TYPE_TCP6) #define SCAMPER_FD_TYPE_IS_DL(fd) ( \ (fd)->type == SCAMPER_FD_TYPE_DL) #define SCAMPER_FD_POLL_FLAG_INACTIVE 0x01 /* the fd should not be polled */ #define fd_tcp_sport fd_t_un.fd_t_tcp.sport #define fd_tcp_addr fd_t_un.fd_t_tcp.addr #define fd_udp_sport fd_t_un.fd_t_udp.sport #define fd_udp_addr fd_t_un.fd_t_udp.addr #define fd_icmp_addr fd_t_un.fd_t_icmp.addr #define fd_dl_ifindex fd_t_un.fd_t_dl.ifindex #define fd_dl_dl fd_t_un.fd_t_dl.dl static scamper_fd_t **fd_array = NULL; static int fd_array_s = 0; static splaytree_t *fd_tree = NULL; static dlist_t *fd_list = NULL; static dlist_t *read_fds = NULL; static dlist_t *write_fds = NULL; static dlist_t *read_queue = NULL; static dlist_t *write_queue = NULL; static dlist_t *refcnt_0 = NULL; static int (*pollfunc)(struct timeval *timeout) = NULL; #ifdef HAVE_SCAMPER_DEBUG static char *fd_addr_tostr(char *buf, size_t len, int af, void *addr) { char tmp[128]; if(addr == NULL || addr_tostr(af, addr, tmp, sizeof(tmp)) == NULL) return ""; snprintf(buf, len, " %s", tmp); return buf; } static char *fd_tostr(scamper_fd_t *fdn) { static char buf[144]; char addr[128]; switch(fdn->type) { case SCAMPER_FD_TYPE_PRIVATE: return "private"; case SCAMPER_FD_TYPE_IP4: return "ip4"; case SCAMPER_FD_TYPE_FILE: return "file"; case SCAMPER_FD_TYPE_ICMP4: snprintf(buf, sizeof(buf), "icmp4%s", fd_addr_tostr(addr, sizeof(addr), AF_INET, fdn->fd_icmp_addr)); return buf; case SCAMPER_FD_TYPE_ICMP6: snprintf(buf, sizeof(buf), "icmp6%s", fd_addr_tostr(addr, sizeof(addr), AF_INET6, fdn->fd_icmp_addr)); return buf; case SCAMPER_FD_TYPE_UDP4: snprintf(buf, sizeof(buf), "udp4%s", fd_addr_tostr(addr, sizeof(addr), AF_INET, fdn->fd_udp_addr)); return buf; case SCAMPER_FD_TYPE_UDP4DG: snprintf(buf, sizeof(buf), "udp4dg%s %d", fd_addr_tostr(addr, sizeof(addr), AF_INET, fdn->fd_udp_addr), fdn->fd_udp_sport); return buf; case SCAMPER_FD_TYPE_UDP6: snprintf(buf, sizeof(buf), "udp6%s %d", fd_addr_tostr(addr, sizeof(addr), AF_INET6, fdn->fd_udp_addr), fdn->fd_udp_sport); return buf; case SCAMPER_FD_TYPE_TCP4: snprintf(buf, sizeof(buf), "tcp4%s %d", fd_addr_tostr(addr, sizeof(addr), AF_INET, fdn->fd_tcp_addr), fdn->fd_tcp_sport); return buf; case SCAMPER_FD_TYPE_TCP6: snprintf(buf, sizeof(buf), "tcp6%s %d", fd_addr_tostr(addr, sizeof(addr), AF_INET6, fdn->fd_tcp_addr), fdn->fd_tcp_sport); return buf; case SCAMPER_FD_TYPE_DL: snprintf(buf, sizeof(buf), "dl %d", fdn->fd_dl_ifindex); return buf; #ifdef SCAMPER_FD_TYPE_RTSOCK case SCAMPER_FD_TYPE_RTSOCK: return "rtsock"; #endif #ifdef SCAMPER_FD_TYPE_IFSOCK case SCAMPER_FD_TYPE_IFSOCK: return "ifsock"; #endif } return "?"; } #endif static void fd_close(scamper_fd_t *fdn) { switch(fdn->type) { case SCAMPER_FD_TYPE_PRIVATE: case SCAMPER_FD_TYPE_FILE: break; case SCAMPER_FD_TYPE_ICMP4: scamper_icmp4_close(fdn->fd); break; case SCAMPER_FD_TYPE_ICMP6: scamper_icmp6_close(fdn->fd); break; case SCAMPER_FD_TYPE_UDP4: case SCAMPER_FD_TYPE_UDP4DG: scamper_udp4_close(fdn->fd); break; case SCAMPER_FD_TYPE_UDP6: scamper_udp6_close(fdn->fd); break; case SCAMPER_FD_TYPE_TCP4: scamper_tcp4_close(fdn->fd); break; case SCAMPER_FD_TYPE_TCP6: scamper_tcp6_close(fdn->fd); break; case SCAMPER_FD_TYPE_DL: scamper_dl_close(fdn->fd); break; #ifdef SCAMPER_FD_TYPE_RTSOCK case SCAMPER_FD_TYPE_RTSOCK: scamper_rtsock_close(fdn->fd); break; #endif #ifdef SCAMPER_FD_TYPE_IFSOCK case SCAMPER_FD_TYPE_IFSOCK: close(fdn->fd); break; #endif } return; } /* * fd_free * * free up memory allocated to scamper's monitoring of the file descriptor. */ static void fd_free(scamper_fd_t *fdn) { scamper_debug(__func__, "fd %d type %s", fdn->fd, fd_tostr(fdn)); if(fdn->fd >= 0 && fdn->fd < fd_array_s && fd_array != NULL) fd_array[fdn->fd] = NULL; if(fdn->read.node != NULL) dlist_node_pop(fdn->read.list, fdn->read.node); if(fdn->write.node != NULL) dlist_node_pop(fdn->write.list, fdn->write.node); if(fdn->rc0 != NULL) dlist_node_pop(refcnt_0, fdn->rc0); if(fdn->fd_tree_node != NULL) splaytree_remove_node(fd_tree, fdn->fd_tree_node); if(fdn->fd_list_node != NULL) dlist_node_pop(fd_list, fdn->fd_list_node); if(SCAMPER_FD_TYPE_IS_ICMP(fdn)) { if(fdn->fd_icmp_addr != NULL) free(fdn->fd_icmp_addr); } else if(SCAMPER_FD_TYPE_IS_UDP(fdn)) { if(fdn->fd_udp_addr != NULL) free(fdn->fd_udp_addr); } else if(SCAMPER_FD_TYPE_IS_TCP(fdn)) { if(fdn->fd_tcp_addr != NULL) free(fdn->fd_tcp_addr); } else if(SCAMPER_FD_TYPE_IS_DL(fdn)) { if(fdn->fd_dl_dl != NULL) scamper_dl_state_free(fdn->fd_dl_dl); } free(fdn); return; } /* * fd_refcnt_0 * * this function is called whenever a fdn with a refcnt field of zero is * found. */ static void fd_refcnt_0(scamper_fd_t *fdn) { /* * if the fd is in a list that is currently locked, then it can't be * removed just yet */ if(dlist_islocked(fd_list) != 0 || (fdn->read.list != NULL && dlist_islocked(fdn->read.list) != 0) || (fdn->write.list != NULL && dlist_islocked(fdn->write.list) != 0)) { return; } /* * if this is a private fd and the reference count has reached zero, * then the scamper_fd structure can be freed up completely now */ if(fdn->type == SCAMPER_FD_TYPE_PRIVATE || fdn->type == SCAMPER_FD_TYPE_FILE) { fd_free(fdn); return; } /* if it is not possible to put the node on a list, just free it */ if((fdn->rc0 = dlist_tail_push(refcnt_0, fdn)) == NULL) { fd_close(fdn); fd_free(fdn); return; } /* * set this fd to be closed in ten seconds unless something else comes * along and wants to use it. */ gettimeofday_wrap(&fdn->tv); fdn->tv.tv_sec += 10; return; } static int fd_poll_setlist(void *item, void *param) { ((scamper_fd_poll_t *)item)->list = (dlist_t *)param; return 0; } /* * fds_select_assemble * * given a list of scamper_fd_poll_t structures held in a list, compose an * fd_set for them to pass to select. */ static int fds_select_assemble(dlist_t *fds, slist_t **file_list, fd_set *fdset, fd_set **fdsp, int *nfds) { scamper_fd_poll_t *fdp; dlist_node_t *node; int count = 0; FD_ZERO(fdset); node = dlist_head_node(fds); while(node != NULL) { /* file descriptor associated with the node */ fdp = (scamper_fd_poll_t *)dlist_node_item(node); /* get the next node incase this node is subsequently removed */ node = dlist_node_next(node); /* if there is nothing using this fdn any longer, then stop polling it */ if(fdp->fdn->refcnt == 0 && fdp->fdn->rc0 == NULL) { fd_refcnt_0(fdp->fdn); continue; } /* if the inactive flag is set, then skip over this file descriptor */ if((fdp->flags & SCAMPER_FD_POLL_FLAG_INACTIVE) != 0) { dlist_node_eject(fds, fdp->node); fdp->list = NULL; continue; } if(fdp->fdn->type == SCAMPER_FD_TYPE_FILE) { if((*file_list == NULL && (*file_list = slist_alloc()) == NULL) || slist_tail_push(*file_list, fdp) == NULL) return -1; continue; } /* monitor this file descriptor */ FD_SET(fdp->fdn->fd, fdset); count++; /* update the maxfd seen if appropriate */ if(*nfds < fdp->fdn->fd) *nfds = fdp->fdn->fd; } /* * if there are no fds in the set to monitor, then return a null pointer * to pass to select */ if(count == 0) *fdsp = NULL; else *fdsp = fdset; return 0; } /* * fds_select_check * * given an fd_set that has been passed to select, as well as a list of * fds that are being monitored, figure out which ones have an event and * use the callback provided to deal with the event. */ static void fds_select_check(fd_set *fdset, dlist_t *fds, int *count) { scamper_fd_poll_t *fdp; dlist_node_t *node; /* stop now if there is nothing to check */ if(fdset == NULL || *count == 0) { return; } /* nodes in this list should not be removed while this function is called */ dlist_lock(fds); /* loop through */ node = dlist_head_node(fds); while(node != NULL && *count > 0) { fdp = (scamper_fd_poll_t *)dlist_node_item(node); node = dlist_node_next(node); if(FD_ISSET(fdp->fdn->fd, fdset)) { fdp->cb(fdp->fdn->fd, fdp->param); (*count)--; } } /* can modify the list now */ dlist_unlock(fds); return; } static void fds_files_check(dlist_t *fds, slist_t *list) { scamper_fd_poll_t *fdp; if(list == NULL) return; dlist_lock(fds); while((fdp = slist_head_pop(list)) != NULL) fdp->cb(fdp->fdn->fd, fdp->param); dlist_unlock(fds); return; } static int fds_select(struct timeval *timeout) { struct timeval tv; fd_set rfds, *rfdsp; fd_set wfds, *wfdsp; slist_t *rfiles = NULL, *wfiles = NULL; int count, nfds = -1; /* concat any new fds to monitor now */ dlist_foreach(read_queue, fd_poll_setlist, read_fds); dlist_concat(read_fds, read_queue); dlist_foreach(write_queue, fd_poll_setlist, write_fds); dlist_concat(write_fds, write_queue); /* compose the sets of file descriptors to monitor */ if(fds_select_assemble(read_fds, &rfiles, &rfds, &rfdsp, &nfds) != 0) goto err; if(fds_select_assemble(write_fds, &wfiles, &wfds, &wfdsp, &nfds) != 0) goto err; if(rfiles != NULL || wfiles != NULL) { tv.tv_sec = 0; tv.tv_usec = 0; timeout = &tv; } /* find out which file descriptors have an event */ #ifdef _WIN32 if(nfds == -1 && rfiles == NULL && wfiles == NULL) { if(timeout != NULL && timeout->tv_sec >= 0 && timeout->tv_usec >= 0) Sleep((timeout->tv_sec * 1000) + (timeout->tv_usec / 1000)); count = 0; } else #endif if((count = select(nfds+1, rfdsp, wfdsp, NULL, timeout)) < 0) { printerror(__func__, "select failed"); goto err; } /* read and write to files outside of select */ if(rfiles != NULL) { fds_files_check(read_fds, rfiles); slist_free(rfiles); rfiles = NULL; } if(wfiles != NULL) { fds_files_check(write_fds, wfiles); slist_free(wfiles); wfiles = NULL; } /* if there are fds to check, then check them */ if(count > 0) { fds_select_check(rfdsp, read_fds, &count); fds_select_check(wfdsp, write_fds, &count); } return 0; err: if(rfiles != NULL) slist_free(rfiles); if(wfiles != NULL) slist_free(wfiles); return -1; } #ifdef HAVE_POLL static struct pollfd *poll_fds = NULL; static int poll_fdc = 0; static void fds_poll_check(short event, int rc, int count) { scamper_fd_t *fd; int i; for(i=0; i= 0 && poll_fds[i].fd < fd_array_s && (fd = fd_array[poll_fds[i].fd]) != NULL) { if(event == POLLIN) fd->read.cb(fd->fd, fd->read.param); else fd->write.cb(fd->fd, fd->write.param); } if(--rc == 0) break; } return; } static int fds_poll(struct timeval *tv) { scamper_fd_t *fd; dlist_node_t *n; int timeout; int rc, count = 0, in = 0, out = 0; size_t size; n = dlist_head_node(fd_list); while(n != NULL) { fd = dlist_node_item(n); n = dlist_node_next(n); /* if there is nothing using this fdn any longer, then stop polling it */ if(fd->refcnt == 0 && fd->rc0 == NULL) { fd_refcnt_0(fd); continue; } /* don't poll an inactive fd */ if((fd->read.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) != 0 && (fd->write.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) != 0) continue; if(count + 1 > poll_fdc) { size = (count+1) * sizeof(struct pollfd); if(realloc_wrap((void **)&poll_fds, size) != 0) { printerror(__func__, "could not realloc poll_fds"); return -1; } poll_fdc = count + 1; } poll_fds[count].fd = fd->fd; poll_fds[count].events = 0; poll_fds[count].revents = 0; if((fd->read.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) == 0) { poll_fds[count].events |= POLLIN; in++; } if((fd->write.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) == 0) { poll_fds[count].events |= POLLOUT; out++; } count++; } if(tv != NULL) { timeout = (tv->tv_sec * 1000) + (tv->tv_usec / 1000); if(timeout == 0 && tv->tv_usec != 0) timeout++; } else { timeout = -1; } if((rc = poll(poll_fds, count, timeout)) < 0) { printerror(__func__, "could not poll"); return -1; } if(rc > 0) { if(in != 0) fds_poll_check(POLLIN, rc < in ? rc : in, count); if(out != 0) fds_poll_check(POLLOUT, rc < out ? rc : out, count); } return 0; } #endif #ifdef HAVE_KQUEUE static struct kevent *kevlist = NULL; static int kevlistlen = 0; static int kq = -1; static int fds_kqueue_init(void) { if((kq = kqueue()) == -1) { printerror(__func__, "could not create kqueue"); return -1; } scamper_debug(__func__, "fd %d", kq); return 0; } static void fds_kqueue_set(scamper_fd_t *fd, short filter, u_short flags) { struct kevent kev; EV_SET(&kev, fd->fd, filter, flags, 0, 0, fd); if(kevent(kq, &kev, 1, NULL, 0, NULL) != 0) { printerror(__func__, "fd %d %s %s", fd->fd, filter == EVFILT_READ ? "EVFILT_READ" : "EVFILT_WRITE", flags == EV_ADD ? "EV_ADD" : "EV_DELETE"); } return; } static int fds_kqueue(struct timeval *tv) { scamper_fd_t *fdp; struct timespec ts, *tsp = NULL; struct kevent *kev; int fd, i, c; if((c = dlist_count(read_fds) + dlist_count(write_fds)) >= kevlistlen) { c += 8; if(realloc_wrap((void **)&kevlist, sizeof(struct kevent) * c) != 0) { if(kevlistlen == 0) { printerror(__func__, "could not alloc kevlist"); return -1; } } else { kevlistlen = c; } } if(tv != NULL) { ts.tv_sec = tv->tv_sec; ts.tv_nsec = tv->tv_usec * 1000; tsp = &ts; } if((c = kevent(kq, NULL, 0, kevlist, kevlistlen, tsp)) == -1) { printerror(__func__, "kevent failed"); return -1; } for(i=0; iident; if(fd < 0 || fd >= fd_array_s) continue; if((fdp = fd_array[fd]) == NULL) continue; if(kev->filter == EVFILT_READ) fdp->read.cb(fd, fdp->read.param); else if(kev->filter == EVFILT_WRITE) fdp->write.cb(fd, fdp->write.param); } return 0; } #endif #ifdef HAVE_EPOLL static struct epoll_event *ep_events = NULL; static int ep_event_c = 0; static int ep = -1; static int ep_fdc = 0; static int fds_epoll_init(void) { if((ep = epoll_create(10)) == -1) { printerror(__func__, "could not epoll_create"); return -1; } scamper_debug(__func__, "fd %d", ep); return 0; } static void fds_epoll_ctl(scamper_fd_t *fd, uint32_t ev, int op) { struct epoll_event epev; if(op == EPOLL_CTL_ADD && ((ev == EPOLLIN && (fd->write.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) == 0) || (ev == EPOLLOUT && (fd->read.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) == 0))) { op = EPOLL_CTL_MOD; ev = EPOLLIN | EPOLLOUT; } else if(op == EPOLL_CTL_DEL && ev == EPOLLIN && (fd->write.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) == 0) { op = EPOLL_CTL_MOD; ev = EPOLLOUT; } else if(op == EPOLL_CTL_DEL && ev == EPOLLOUT && (fd->read.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) == 0) { op = EPOLL_CTL_MOD; ev = EPOLLIN; } if(op == EPOLL_CTL_ADD) ep_fdc++; else if(op == EPOLL_CTL_DEL) ep_fdc--; epev.data.fd = fd->fd; epev.events = ev; if(epoll_ctl(ep, op, fd->fd, &epev) != 0) printerror(__func__, "fd %d op %d ev %u", fd->fd, op, ev); return; } static int fds_epoll(struct timeval *tv) { int i, fd, rc, timeout; scamper_fd_t *fdp; size_t size; if(ep_fdc >= ep_event_c) { rc = ep_fdc + 8; size = sizeof(struct epoll_event) * rc; if(realloc_wrap((void **)&ep_events, size) != 0) { if(ep_event_c == 0) { printerror(__func__, "could not alloc events"); return -1; } } else { ep_event_c = rc; } } if(tv != NULL) { timeout = (tv->tv_sec * 1000) + (tv->tv_usec / 1000); if(timeout == 0 && tv->tv_usec != 0) timeout++; } else { timeout = -1; } if((rc = epoll_wait(ep, ep_events, ep_event_c, timeout)) == -1) { printerror(__func__, "could not epoll_wait"); return -1; } for(i=0; i= fd_array_s) continue; if(ep_events[i].events & EPOLLIN) { if((fdp = fd_array[fd]) == NULL) continue; fdp->read.cb(fd, fdp->read.param); } if(ep_events[i].events & EPOLLOUT) { if((fdp = fd_array[fd]) == NULL) continue; fdp->write.cb(fd, fdp->write.param); } } return 0; } #endif static int fd_addr_cmp(int type, void *a, void *b) { assert(type == SCAMPER_FD_TYPE_TCP4 || type == SCAMPER_FD_TYPE_TCP6 || type == SCAMPER_FD_TYPE_UDP4 || type == SCAMPER_FD_TYPE_UDP6 || type == SCAMPER_FD_TYPE_UDP4DG || type == SCAMPER_FD_TYPE_ICMP4 || type == SCAMPER_FD_TYPE_ICMP6); if(a == NULL && b != NULL) return -1; if(a != NULL && b == NULL) return 1; if(a == NULL && b == NULL) return 0; if(type == SCAMPER_FD_TYPE_TCP4 || type == SCAMPER_FD_TYPE_UDP4 || type == SCAMPER_FD_TYPE_UDP4DG || type == SCAMPER_FD_TYPE_ICMP4) return addr4_cmp(a, b); else return addr6_cmp(a, b); } /* * fd_cmp * * given two scamper_fd_t structures, determine if their properties are * the same. used to maintain the splaytree of existing file descriptors * held by scamper. */ static int fd_cmp(const scamper_fd_t *a, const scamper_fd_t *b) { if(a->type < b->type) return -1; if(a->type > b->type) return 1; switch(a->type) { case SCAMPER_FD_TYPE_TCP4: case SCAMPER_FD_TYPE_TCP6: if(a->fd_tcp_sport < b->fd_tcp_sport) return -1; if(a->fd_tcp_sport > b->fd_tcp_sport) return 1; return fd_addr_cmp(a->type, a->fd_tcp_addr, b->fd_tcp_addr); case SCAMPER_FD_TYPE_UDP4: return fd_addr_cmp(a->type, a->fd_udp_addr, b->fd_udp_addr); case SCAMPER_FD_TYPE_UDP4DG: case SCAMPER_FD_TYPE_UDP6: if(a->fd_udp_sport < b->fd_udp_sport) return -1; if(a->fd_udp_sport > b->fd_udp_sport) return 1; return fd_addr_cmp(a->type, a->fd_udp_addr, b->fd_udp_addr); case SCAMPER_FD_TYPE_DL: if(a->fd_dl_ifindex < b->fd_dl_ifindex) return -1; if(a->fd_dl_ifindex > b->fd_dl_ifindex) return 1; return 0; case SCAMPER_FD_TYPE_ICMP4: case SCAMPER_FD_TYPE_ICMP6: return fd_addr_cmp(a->type, a->fd_icmp_addr, b->fd_icmp_addr); } return 0; } /* * fd_alloc * * allocate a scamper_fd_t structure and do generic setup tasks. */ #ifndef DMALLOC static scamper_fd_t *fd_alloc(int type, int fd) #else #define fd_alloc(type, fd) fd_alloc_dm((type), (fd), __FILE__, __LINE__) static scamper_fd_t *fd_alloc_dm(int type, int fd, const char *file, const int line) #endif { scamper_fd_t *fdn = NULL; size_t size; int i; #ifndef DMALLOC if((fdn = malloc_zero(sizeof(scamper_fd_t))) == NULL) #else if((fdn = malloc_zero_dm(sizeof(scamper_fd_t), file, line)) == NULL) #endif { goto err; } fdn->type = type; fdn->fd = fd; fdn->refcnt = 1; /* set up to poll read ability */ if((fdn->read.node = dlist_node_alloc(&fdn->read)) == NULL) { goto err; } fdn->read.fdn = fdn; fdn->read.flags = SCAMPER_FD_POLL_FLAG_INACTIVE; /* set up to poll write ability */ if((fdn->write.node = dlist_node_alloc(&fdn->write)) == NULL) { goto err; } fdn->write.fdn = fdn; fdn->write.flags = SCAMPER_FD_POLL_FLAG_INACTIVE; /* store the fd in an array indexed by the fd number */ if(fd+1 > fd_array_s) { size = sizeof(scamper_fd_t *) * (fd+1); if(realloc_wrap((void **)&fd_array, size) != 0) goto err; for(i=fd_array_s; irefcnt == 0 && fdn->rc0 != NULL) { dlist_node_pop(refcnt_0, fdn->rc0); fdn->rc0 = NULL; } fdn->refcnt++; } return fdn; } /* * fd_null * * allocate a file descriptor of a specified type. */ static scamper_fd_t *fd_null(int type) { scamper_fd_t *fdn = NULL, findme; int fd = -1; /* first check if a sharable fd exists for this type */ findme.type = type; if((fdn = fd_find(&findme)) != NULL) { return fdn; } switch(type) { #if defined(SCAMPER_FD_TYPE_RTSOCK) case SCAMPER_FD_TYPE_RTSOCK: fd = scamper_rtsock_open(); break; #endif #if defined(SCAMPER_FD_TYPE_IFSOCK) case SCAMPER_FD_TYPE_IFSOCK: fd = socket(AF_INET, SOCK_DGRAM, 0); break; #endif case SCAMPER_FD_TYPE_IP4: fd = scamper_ip4_openraw(); break; } if(fd == -1 || (fdn = fd_alloc(type, fd)) == NULL || (fdn->fd_tree_node = splaytree_insert(fd_tree, fdn)) == NULL || (fdn->fd_list_node = dlist_tail_push(fd_list, fdn)) == NULL) { goto err; } scamper_debug(__func__, "fd %d type %s", fdn->fd, fd_tostr(fdn)); return fdn; err: if(fd != -1) { switch(type) { #if defined(SCAMPER_FD_TYPE_RTSOCK) case SCAMPER_FD_TYPE_RTSOCK: scamper_rtsock_close(fd); break; #endif #if defined(SCAMPER_FD_TYPE_IFSOCK) case SCAMPER_FD_TYPE_IFSOCK: close(fd); break; #endif case SCAMPER_FD_TYPE_IP4: scamper_ip4_close(fd); break; } } if(fdn != NULL) fd_free(fdn); return NULL; } static scamper_fd_t *fd_icmp(int type, void *addr) { scamper_fd_t *fdn = NULL, findme; size_t len = 0; int fd = -1; findme.type = type; findme.fd_icmp_addr = addr; if((fdn = fd_find(&findme)) != NULL) { return fdn; } if(type == SCAMPER_FD_TYPE_ICMP4) { fd = scamper_icmp4_open(addr); len = sizeof(struct in_addr); } else if(type == SCAMPER_FD_TYPE_ICMP6) { fd = scamper_icmp6_open(addr); len = sizeof(struct in6_addr); } if(fd == -1 || (fdn = fd_alloc(type, fd)) == NULL || (addr != NULL && (fdn->fd_icmp_addr = memdup(addr, len)) == NULL) || (fdn->fd_tree_node = splaytree_insert(fd_tree, fdn)) == NULL || (fdn->fd_list_node = dlist_tail_push(fd_list, fdn)) == NULL) { goto err; } scamper_debug(__func__, "fd %d type %s", fdn->fd, fd_tostr(fdn)); return fdn; err: if(fd != -1) { if(type == SCAMPER_FD_TYPE_ICMP4) scamper_icmp4_close(fd); else if(type == SCAMPER_FD_TYPE_ICMP6) scamper_icmp6_close(fd); } if(fdn != NULL) fd_free(fdn); return NULL; } static scamper_fd_t *fd_tcp(int type, void *addr, uint16_t sport) { scamper_fd_t *fdn, findme; size_t len = 0; int fd = -1; assert(type == SCAMPER_FD_TYPE_TCP4 || type == SCAMPER_FD_TYPE_TCP6); findme.type = type; findme.fd_tcp_addr = addr; findme.fd_tcp_sport = sport; if((fdn = fd_find(&findme)) != NULL) return fdn; if(type == SCAMPER_FD_TYPE_TCP4) { fd = scamper_tcp4_open(addr, sport); len = sizeof(struct in_addr); } else if(type == SCAMPER_FD_TYPE_TCP6) { fd = scamper_tcp6_open(addr, sport); len = sizeof(struct in6_addr); } if(fd == -1 || (fdn = fd_alloc(type, fd)) == NULL || (addr != NULL && (fdn->fd_tcp_addr = memdup(addr, len)) == NULL)) { goto err; } fdn->fd_tcp_sport = sport; if((fdn->fd_tree_node = splaytree_insert(fd_tree, fdn)) == NULL || (fdn->fd_list_node = dlist_tail_push(fd_list, fdn)) == NULL) { goto err; } scamper_debug(__func__, "fd %d type %s", fdn->fd, fd_tostr(fdn)); return fdn; err: if(fd != -1) { if(type == SCAMPER_FD_TYPE_TCP4) scamper_tcp4_close(fd); else if(type == SCAMPER_FD_TYPE_TCP6) scamper_tcp6_close(fd); } if(fdn != NULL) fd_free(fdn); return NULL; } static scamper_fd_t *fd_udp(int type, void *addr, uint16_t sport) { scamper_fd_t *fdn, findme; size_t len = 0; int fd = -1; findme.type = type; findme.fd_udp_addr = addr; findme.fd_udp_sport = sport; if((fdn = fd_find(&findme)) != NULL) return fdn; if(type == SCAMPER_FD_TYPE_UDP4) { fd = scamper_udp4_openraw(addr); len = sizeof(struct in_addr); } else if(type == SCAMPER_FD_TYPE_UDP6) { fd = scamper_udp6_open(addr, sport); len = sizeof(struct in6_addr); } else if(type == SCAMPER_FD_TYPE_UDP4DG) { fd = scamper_udp4_opendgram(addr, sport); len = sizeof(struct in_addr); } if(fd == -1 || (fdn = fd_alloc(type, fd)) == NULL || (addr != NULL && (fdn->fd_udp_addr = memdup(addr, len)) == NULL)) { printerror(__func__, "could not open socket"); goto err; } fdn->fd_udp_sport = sport; if((fdn->fd_tree_node = splaytree_insert(fd_tree, fdn)) == NULL) { printerror(__func__, "could not add socket to tree"); goto err; } if((fdn->fd_list_node = dlist_tail_push(fd_list, fdn)) == NULL) { printerror(__func__, "could not add socket to list"); goto err; } scamper_debug(__func__, "fd %d type %s", fdn->fd, fd_tostr(fdn)); return fdn; err: if(fd != -1) { if(type == SCAMPER_FD_TYPE_UDP4 || type == SCAMPER_FD_TYPE_UDP4DG) scamper_udp4_close(fd); else if(type == SCAMPER_FD_TYPE_UDP6) scamper_udp6_close(fd); } if(fdn != NULL) fd_free(fdn); return NULL; } /* * scamper_fds_poll * * the money function: this function polls the file descriptors held by * scamper. for each fd with an event, it calls the callback registered * with the fd. */ int scamper_fds_poll(struct timeval *timeout) { scamper_fd_t *fdn; struct timeval tv; /* * if there are fds that can be reaped, then do so. * if there are fds left over after, use that to guide the select timeout. */ if(dlist_count(refcnt_0) > 0) { gettimeofday_wrap(&tv); while((fdn = (scamper_fd_t *)dlist_head_item(refcnt_0)) != NULL) { assert(fdn->refcnt == 0); if(timeval_cmp(&fdn->tv, &tv) > 0) break; fd_close(fdn); fd_free(fdn); } if(fdn != NULL) { timeval_diff_tv(&tv, &tv, &fdn->tv); if(timeout == NULL || timeval_cmp(&tv, timeout) < 0) timeout = &tv; } } return pollfunc(timeout); } /* * scamper_fd_fd_get * * return the actual file descriptor associated with the scamper_fd_t */ int scamper_fd_fd_get(const scamper_fd_t *fdn) { if(fdn->raw == NULL) return fdn->fd; return fdn->raw->fd; } /* * scamper_fd_fd_set * * set the file descriptor being monitored with the scamper_fd_t */ int scamper_fd_fd_set(scamper_fd_t *fdn, int fd) { fdn->fd = fd; return 0; } /* * scamper_fd_read_pause * * ignore any read events on the fd. */ void scamper_fd_read_pause(scamper_fd_t *fdn) { #ifdef HAVE_KQUEUE if(kq != -1 && (fdn->read.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) == 0) fds_kqueue_set(fdn, EVFILT_READ, EV_DELETE); #endif #ifdef HAVE_EPOLL if(ep != -1 && (fdn->read.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) == 0) fds_epoll_ctl(fdn, EPOLLIN, EPOLL_CTL_DEL); #endif fdn->read.flags |= SCAMPER_FD_POLL_FLAG_INACTIVE; return; } /* * scamper_fd_read_unpause * * monitor read events on the fd. unset the inactive flag, and push the * node back onto the read list */ void scamper_fd_read_unpause(scamper_fd_t *fdn) { assert(fdn->read.cb != NULL); if((fdn->read.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) != 0) { fdn->read.flags &= ~(SCAMPER_FD_POLL_FLAG_INACTIVE); #ifdef HAVE_KQUEUE if(kq != -1) fds_kqueue_set(fdn, EVFILT_READ, EV_ADD); #endif #ifdef HAVE_EPOLL if(ep != -1) fds_epoll_ctl(fdn, EPOLLIN, EPOLL_CTL_ADD); #endif /* * the fd may still be on the read fds list, just with the inactive bit * set. if it isn't, then we have to put it on the queue. */ if(fdn->read.list != read_fds) { dlist_node_head_push(read_queue, fdn->read.node); fdn->read.list = read_queue; } } return; } /* * scamper_fd_write_pause * * ignore any write events on the fd */ void scamper_fd_write_pause(scamper_fd_t *fdn) { #ifdef HAVE_KQUEUE if(kq != -1 && (fdn->write.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) == 0) fds_kqueue_set(fdn, EVFILT_WRITE, EV_DELETE); #endif #ifdef HAVE_EPOLL if(ep != -1 && (fdn->write.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) == 0) fds_epoll_ctl(fdn, EPOLLOUT, EPOLL_CTL_DEL); #endif fdn->write.flags |= SCAMPER_FD_POLL_FLAG_INACTIVE; return; } /* * scamper_fd_write_unpause * * monitor write events on the fd. unset the inactive flag, and push the * node back onto the write list */ void scamper_fd_write_unpause(scamper_fd_t *fdn) { assert(fdn->write.cb != NULL); if((fdn->write.flags & SCAMPER_FD_POLL_FLAG_INACTIVE) != 0) { fdn->write.flags &= ~(SCAMPER_FD_POLL_FLAG_INACTIVE); #ifdef HAVE_KQUEUE if(kq != -1) fds_kqueue_set(fdn, EVFILT_WRITE, EV_ADD); #endif #ifdef HAVE_EPOLL if(ep != -1) fds_epoll_ctl(fdn, EPOLLOUT, EPOLL_CTL_ADD); #endif /* * the fd may still be on the write fds list, just with the inactive bit * set. if it isn't, then we have to put it on the queue. */ if(fdn->write.list != write_fds) { dlist_node_head_push(write_queue, fdn->write.node); fdn->write.list = write_queue; } } return; } void scamper_fd_read_set(scamper_fd_t *fdn, scamper_fd_cb_t cb, void *param) { assert(fdn->type == SCAMPER_FD_TYPE_PRIVATE); fdn->read.cb = cb; fdn->read.param = param; return; } void scamper_fd_write_set(scamper_fd_t *fdn, scamper_fd_cb_t cb, void *param) { assert(fdn->type == SCAMPER_FD_TYPE_PRIVATE); fdn->write.cb = cb; fdn->write.param = param; return; } scamper_fd_t *scamper_fd_icmp4(void *addr) { scamper_fd_t *fdn; if((fdn = fd_icmp(SCAMPER_FD_TYPE_ICMP4, addr)) != NULL) { fdn->read.cb = scamper_icmp4_read_cb; scamper_fd_read_unpause(fdn); } return fdn; } scamper_fd_t *scamper_fd_icmp6(void *addr) { scamper_fd_t *fdn; if((fdn = fd_icmp(SCAMPER_FD_TYPE_ICMP6, addr)) != NULL) { fdn->read.cb = scamper_icmp6_read_cb; scamper_fd_read_unpause(fdn); } return fdn; } #ifndef _WIN32 scamper_fd_t *scamper_fd_rtsock(void) { scamper_fd_t *fdn; if((fdn = fd_null(SCAMPER_FD_TYPE_RTSOCK)) != NULL) { fdn->read.cb = scamper_rtsock_read_cb; scamper_fd_read_unpause(fdn); } return fdn; } #endif scamper_fd_t *scamper_fd_tcp4(void *addr, uint16_t sport) { return fd_tcp(SCAMPER_FD_TYPE_TCP4, addr, sport); } scamper_fd_t *scamper_fd_tcp6(void *addr, uint16_t sport) { return fd_tcp(SCAMPER_FD_TYPE_TCP6, addr, sport); } scamper_fd_t *scamper_fd_udp4(void *addr, uint16_t sport) { scamper_fd_t *fd; if((fd = fd_udp(SCAMPER_FD_TYPE_UDP4DG, addr, sport)) == NULL) return NULL; if(fd->raw == NULL) { if((fd->raw = fd_udp(SCAMPER_FD_TYPE_UDP4, addr, sport)) == NULL) { scamper_fd_free(fd); return NULL; } } return fd; } scamper_fd_t *scamper_fd_udp6(void *addr, uint16_t sport) { return fd_udp(SCAMPER_FD_TYPE_UDP6, addr, sport); } scamper_fd_t *scamper_fd_ip4(void) { return fd_null(SCAMPER_FD_TYPE_IP4); } #ifndef _WIN32 scamper_fd_t *scamper_fd_ifsock(void) { return fd_null(SCAMPER_FD_TYPE_IFSOCK); } #endif scamper_fd_t *scamper_fd_dl(int ifindex) { scamper_fd_t *fdn = NULL, findme; int fd = -1; findme.type = SCAMPER_FD_TYPE_DL; findme.fd_dl_ifindex = ifindex; if((fdn = fd_find(&findme)) != NULL) { scamper_fd_read_unpause(fdn); return fdn; } /* * open the file descriptor for the ifindex, and then allocate a scamper_fd * for the file descriptor */ if((fd = scamper_dl_open(ifindex)) == -1 || (fdn = fd_alloc(SCAMPER_FD_TYPE_DL, fd)) == NULL) { goto err; } /* * record the ifindex for the file descriptor, and then allocate the state * that is maintained with it */ fdn->fd_dl_ifindex = ifindex; /* * 1. add the file descriptor to the splay tree * 2. allocate state for the datalink file descriptor */ if((fdn->fd_tree_node = splaytree_insert(fd_tree, fdn)) == NULL || (fdn->fd_list_node = dlist_tail_push(fd_list, fdn)) == NULL || (fdn->fd_dl_dl = scamper_dl_state_alloc(fdn)) == NULL) { goto err; } /* set the file descriptor up for reading */ fdn->read.cb = scamper_dl_read_cb; fdn->read.param = fdn->fd_dl_dl; fdn->write.cb = NULL; fdn->write.param = NULL; scamper_fd_read_unpause(fdn); scamper_debug(__func__, "fd %d type %s", fdn->fd, fd_tostr(fdn)); return fdn; err: if(fdn != NULL) free(fdn); if(fd != -1) scamper_dl_close(fd); return NULL; } /* * scamper_fd_private * * allocate a private fd for scamper to manage. this fd is not shared amongst * scamper. */ scamper_fd_t *scamper_fd_private(int fd, void *param, scamper_fd_cb_t read_cb, scamper_fd_cb_t write_cb) { scamper_fd_t *fdn = NULL; if((fdn = fd_alloc(SCAMPER_FD_TYPE_PRIVATE, fd)) == NULL) { goto err; } if((fdn->fd_list_node = dlist_tail_push(fd_list, fdn)) == NULL) goto err; if(read_cb != NULL) { scamper_fd_read_set(fdn, read_cb, param); scamper_fd_read_unpause(fdn); } if(write_cb != NULL) { scamper_fd_write_set(fdn, write_cb, param); scamper_fd_write_unpause(fdn); } return fdn; err: if(fdn != NULL) fd_free(fdn); return NULL; } scamper_fd_t *scamper_fd_file(int fd, scamper_fd_cb_t read_cb, void *param) { scamper_fd_t *fdn = NULL; if((fdn = fd_alloc(SCAMPER_FD_TYPE_FILE, fd)) == NULL || (fdn->fd_list_node = dlist_tail_push(fd_list, fdn)) == NULL) goto err; fdn->read.cb = read_cb; fdn->read.param = param; scamper_fd_read_unpause(fdn); return fdn; err: if(fdn != NULL) fd_free(fdn); return NULL; } /* * scamper_fd_ifindex * * if the file descriptor is associated with a known ifindex, return details * of it. */ int scamper_fd_ifindex(const scamper_fd_t *fdn, int *ifindex) { if(fdn->type == SCAMPER_FD_TYPE_DL) { *ifindex = fdn->fd_dl_ifindex; return 0; } return -1; } scamper_dl_t *scamper_fd_dl_get(const scamper_fd_t *fdn) { assert(fdn != NULL); assert(fdn->type == SCAMPER_FD_TYPE_DL); return fdn->fd_dl_dl; } /* * scamper_fd_addr * * if the file descriptor is bound to an address, return details of it. * -1 if invalid parameters. 0 if not bound. 1 if bound. */ int scamper_fd_addr(const scamper_fd_t *fdn, void *addr, size_t len) { void *a; size_t l; switch(fdn->type) { case SCAMPER_FD_TYPE_UDP4: a = fdn->fd_udp_addr; l = 4; break; case SCAMPER_FD_TYPE_UDP4DG: a = fdn->fd_udp_addr; l = 4; break; case SCAMPER_FD_TYPE_UDP6: a = fdn->fd_udp_addr; l = 16; break; case SCAMPER_FD_TYPE_TCP4: a = fdn->fd_tcp_addr; l = 4; break; case SCAMPER_FD_TYPE_TCP6: a = fdn->fd_tcp_addr; l = 16; break; case SCAMPER_FD_TYPE_ICMP4: a = fdn->fd_icmp_addr; l = 4; break; case SCAMPER_FD_TYPE_ICMP6: a = fdn->fd_icmp_addr; l = 16; break; default: return -1; } if(len < l) return -1; if(a == NULL) return 0; memcpy(addr, a, l); return 1; } /* * scamper_fd_sport * * if the file descriptor has a known source port, return details of it. */ int scamper_fd_sport(const scamper_fd_t *fdn, uint16_t *sport) { if(SCAMPER_FD_TYPE_IS_UDP(fdn)) { *sport = fdn->fd_udp_sport; return 0; } else if(SCAMPER_FD_TYPE_IS_TCP(fdn)) { *sport = fdn->fd_tcp_sport; return 0; } return -1; } /* * scamper_fd_free * * this function reduces the reference count for a given file descriptor. * * if zero is reached, the fd will be dealt with when scamper_fd_poll is next * called. the fd cannot be summarily removed here without the potential * to screw up any current call to scamper_fd_poll as that function assumes * the list remains intact for the duration of any events found with select. * */ void scamper_fd_free(scamper_fd_t *fdn) { assert(fdn != NULL); assert(fdn->refcnt > 0); if(--fdn->refcnt == 0) { if(fdn->raw != NULL) { scamper_fd_free(fdn->raw); fdn->raw = NULL; } fd_refcnt_0(fdn); } return; } /* * alloc_list * * helper function to allocate a list for scamper_fds_init */ static dlist_t *alloc_list(char *name) { dlist_t *list; if((list = dlist_alloc()) == NULL) printerror(__func__, "alloc %s failed", name); return list; } /* * scamper_fds_init * * setup the global data structures necessary for scamper to manage a set of * file descriptors */ int scamper_fds_init() { #ifdef HAVE_GETDTABLESIZE scamper_debug(__func__, "fd table size: %d", getdtablesize()); #endif #ifdef HAVE_POLL pollfunc = fds_poll; #endif #ifdef HAVE_KQUEUE if(scamper_option_kqueue()) { pollfunc = fds_kqueue; if(fds_kqueue_init() != 0) return -1; } #endif #ifdef HAVE_EPOLL if(scamper_option_epoll()) { pollfunc = fds_epoll; if(fds_epoll_init() != 0) return -1; } #endif if(scamper_option_select() || pollfunc == NULL) pollfunc = fds_select; if((fd_list = alloc_list("fd_list")) == NULL || (read_fds = alloc_list("read_fds")) == NULL || (read_queue = alloc_list("read_queue")) == NULL || (write_fds = alloc_list("write_fds")) == NULL || (write_queue = alloc_list("write_queue")) == NULL || (refcnt_0 = alloc_list("refcnt_0")) == NULL) { return -1; } if((fd_tree = splaytree_alloc((splaytree_cmp_t)fd_cmp)) == NULL) { printerror(__func__, "alloc fd tree failed"); return -1; } return 0; } /* * cleanup_list * * helper function to remove scamper_fd_poll structures from any lists. */ static void cleanup_list(dlist_t *list) { scamper_fd_poll_t *poll; if(list == NULL) return; while((poll = dlist_head_pop(list)) != NULL) { poll->list = NULL; poll->node = NULL; } dlist_free(list); return; } /* * scamper_fds_cleanup * * tidy up the state allocated to maintain fd records. */ void scamper_fds_cleanup() { scamper_fd_t *fdn; /* clean up the lists */ cleanup_list(read_fds); read_fds = NULL; cleanup_list(write_fds); write_fds = NULL; cleanup_list(read_queue); read_queue = NULL; cleanup_list(write_queue); write_queue = NULL; /* reap anything on the reap list */ if(refcnt_0 != NULL) { while((fdn = (scamper_fd_t *)dlist_head_item(refcnt_0)) != NULL) { fd_close(fdn); fd_free(fdn); } dlist_free(refcnt_0); refcnt_0 = NULL; } /* clean up the tree */ if(fd_tree != NULL) { splaytree_free(fd_tree, NULL); fd_tree = NULL; } /* clean up the list */ if(fd_list != NULL) { dlist_free(fd_list); fd_list = NULL; } /* clean up the array */ if(fd_array != NULL) { free(fd_array); fd_array = NULL; } #ifdef HAVE_POLL if(poll_fds != NULL) { free(poll_fds); poll_fds = NULL; } #endif #ifdef HAVE_KQUEUE if(kq != -1) { close(kq); kq = -1; } if(kevlist != NULL) { free(kevlist); kevlist = NULL; } #endif #ifdef HAVE_EPOLL if(ep != -1) { close(ep); ep = -1; } if(ep_events != NULL) { free(ep_events); ep_events = NULL; } #endif return; } scamper-cvs-20171204/scamper/scamper_fds.h000644 001751 000000 00000006553 12452155637 020227 0ustar00mjlwheel000000 000000 /* * scamper_fds: manage events for file descriptors * * $Id: scamper_fds.h,v 1.22 2015/01/04 06:20:15 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2014 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_FD_H #define __SCAMPER_FD_H /* data structure type */ typedef struct scamper_fd scamper_fd_t; /* when an event occurs, this is the format of the callback used */ typedef void (*scamper_fd_cb_t)(const int fd, void *param); /* these functions allocate reference to a socket shared throughout scamper */ scamper_fd_t *scamper_fd_icmp4(void *addr); scamper_fd_t *scamper_fd_icmp6(void *addr); scamper_fd_t *scamper_fd_udp4(void *addr, uint16_t sport); scamper_fd_t *scamper_fd_udp6(void *addr, uint16_t sport); scamper_fd_t *scamper_fd_tcp4(void *addr, uint16_t sport); scamper_fd_t *scamper_fd_tcp6(void *addr, uint16_t sport); scamper_fd_t *scamper_fd_dl(int ifindex); scamper_fd_t *scamper_fd_ip4(void); #ifndef _WIN32 scamper_fd_t *scamper_fd_rtsock(void); scamper_fd_t *scamper_fd_ifsock(void); #endif /* return information on what the socket is bound to */ int scamper_fd_ifindex(const scamper_fd_t *fdn, int *ifindex); int scamper_fd_sport(const scamper_fd_t *fdn, uint16_t *sport); int scamper_fd_addr(const scamper_fd_t *fdn, void *addr, size_t len); /* this function allocates a socket that is exclusively held by the caller */ scamper_fd_t *scamper_fd_private(int fd, void *param, scamper_fd_cb_t read_cb, scamper_fd_cb_t write_cb); scamper_fd_t *scamper_fd_file(int fd, scamper_fd_cb_t read_cb, void *param); /* * this function reduces the reference count of the fdn, and closes the fd * if there are no remaining references */ void scamper_fd_free(scamper_fd_t *fdn); /* get/set the fd associated with the structure */ int scamper_fd_fd_get(const scamper_fd_t *fdn); int scamper_fd_fd_set(scamper_fd_t *fdn, int fd); /* functions to temporarily unmonitor a fd, and then have it rejoin */ void scamper_fd_read_pause(scamper_fd_t *fdn); void scamper_fd_read_unpause(scamper_fd_t *fdn); void scamper_fd_write_pause(scamper_fd_t *fdn); void scamper_fd_write_unpause(scamper_fd_t *fdn); /* functions to set the callbacks used. only works for private fds */ void scamper_fd_read_set(scamper_fd_t *fdn, scamper_fd_cb_t cb, void *param); void scamper_fd_write_set(scamper_fd_t *fdn, scamper_fd_cb_t cb, void *param); #ifdef __SCAMPER_DL_H scamper_dl_t *scamper_fd_dl_get(const scamper_fd_t *fdn); #endif /* function to check the status of all file descriptors managed */ int scamper_fds_poll(struct timeval *timeout); /* functions used to initialise or cleanup the fd monitoring state */ int scamper_fds_init(void); void scamper_fds_cleanup(void); #endif /* __SCAMPER_FD_H */ scamper-cvs-20171204/scamper/scamper_file.c000644 001751 000000 00000051200 13130372145 020337 0ustar00mjlwheel000000 000000 /* * scamper_file.c * * $Id: scamper_file.c,v 1.71 2017/07/09 09:16:21 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_file.c,v 1.71 2017/07/09 09:16:21 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_file.h" #include "scamper_file_warts.h" #include "scamper_file_text.h" #include "scamper_file_arts.h" #include "scamper_file_json.h" #include "trace/scamper_trace.h" #include "trace/scamper_trace_text.h" #include "trace/scamper_trace_warts.h" #include "trace/scamper_trace_json.h" #include "ping/scamper_ping.h" #include "ping/scamper_ping_text.h" #include "ping/scamper_ping_warts.h" #include "ping/scamper_ping_json.h" #include "sting/scamper_sting.h" #include "sting/scamper_sting_text.h" #include "sting/scamper_sting_warts.h" #include "tracelb/scamper_tracelb.h" #include "tracelb/scamper_tracelb_text.h" #include "tracelb/scamper_tracelb_warts.h" #include "dealias/scamper_dealias.h" #include "dealias/scamper_dealias_text.h" #include "dealias/scamper_dealias_warts.h" #include "dealias/scamper_dealias_json.h" #include "neighbourdisc/scamper_neighbourdisc.h" #include "neighbourdisc/scamper_neighbourdisc_warts.h" #include "tbit/scamper_tbit.h" #include "tbit/scamper_tbit_text.h" #include "tbit/scamper_tbit_warts.h" #include "tbit/scamper_tbit_json.h" #include "sniff/scamper_sniff.h" #include "sniff/scamper_sniff_warts.h" #include "utils.h" #define SCAMPER_FILE_NONE (-1) #define SCAMPER_FILE_TEXT 0 #define SCAMPER_FILE_ARTS 1 #define SCAMPER_FILE_WARTS 2 #define SCAMPER_FILE_JSON 3 typedef int (*write_obj_func_t)(scamper_file_t *sf, const void *); struct scamper_file { char *filename; int fd; void *state; int type; char error_str[256]; uint32_t capability; int eof; scamper_file_writefunc_t writefunc; void *writeparam; scamper_file_readfunc_t readfunc; void *readparam; }; struct scamper_file_filter { uint32_t *flags; uint16_t max; }; struct handler { char *type; int (*detect)(const scamper_file_t *sf); int (*init_read)(scamper_file_t *sf); int (*init_write)(scamper_file_t *sf); int (*init_append)(scamper_file_t *sf); int (*read)(scamper_file_t *sf, scamper_file_filter_t *filter, uint16_t *type, void **data); int (*write_trace)(const scamper_file_t *sf, const struct scamper_trace *trace); int (*write_cycle_start)(const scamper_file_t *sf, scamper_cycle_t *cycle); int (*write_cycle_stop)(const scamper_file_t *sf, scamper_cycle_t *cycle); int (*write_ping)(const scamper_file_t *sf, const struct scamper_ping *ping); int (*write_tracelb)(const scamper_file_t *sf, const struct scamper_tracelb *trace); int (*write_sting)(const scamper_file_t *sf, const struct scamper_sting *sting); int (*write_dealias)(const scamper_file_t *sf, const struct scamper_dealias *dealias); int (*write_neighbourdisc)(const scamper_file_t *sf, const struct scamper_neighbourdisc *nd); int (*write_tbit)(const scamper_file_t *sf, const struct scamper_tbit *tbit); int (*write_sniff)(const scamper_file_t *sf, const struct scamper_sniff *sniff); void (*free_state)(scamper_file_t *sf); }; static struct handler handlers[] = { {"text", /* type */ NULL, /* detect */ NULL, /* init_read */ NULL, /* init_write */ NULL, /* init_append */ NULL, /* read */ scamper_file_text_trace_write, /* write_trace */ NULL, /* write_cycle_start */ NULL, /* write_cycle_stop */ scamper_file_text_ping_write, /* write_ping */ scamper_file_text_tracelb_write, /* write_tracelb */ scamper_file_text_sting_write, /* write_sting */ scamper_file_text_dealias_write, /* write_dealias */ NULL, /* write_neighbourdisc */ scamper_file_text_tbit_write, /* write_tbit */ NULL, /* write_sniff */ NULL, /* free_state */ }, {"arts", /* type */ scamper_file_arts_is, /* detect */ scamper_file_arts_init_read, /* init_read */ NULL, /* init_write */ NULL, /* init_append */ scamper_file_arts_read, /* read */ NULL, /* write_trace */ NULL, /* write_cycle_start */ NULL, /* write_cycle_stop */ NULL, /* write_ping */ NULL, /* write_tracelb */ NULL, /* write_sting */ NULL, /* write_dealias */ NULL, /* write_neighbourdisc */ NULL, /* write_tbit */ NULL, /* write_sniff */ scamper_file_arts_free_state, /* free_state */ }, {"warts", /* type */ scamper_file_warts_is, /* detect */ scamper_file_warts_init_read, /* init_read */ scamper_file_warts_init_write, /* init_write */ scamper_file_warts_init_append, /* init_append */ scamper_file_warts_read, /* read */ scamper_file_warts_trace_write, /* write_trace */ scamper_file_warts_cyclestart_write, /* write_cycle_start */ scamper_file_warts_cyclestop_write, /* write_cycle_stop */ scamper_file_warts_ping_write, /* write_ping */ scamper_file_warts_tracelb_write, /* write_tracelb */ scamper_file_warts_sting_write, /* write_sting */ scamper_file_warts_dealias_write, /* write_dealias */ scamper_file_warts_neighbourdisc_write, /* write_neighbourdisc */ scamper_file_warts_tbit_write, /* write_tbit */ scamper_file_warts_sniff_write, /* write_sniff */ scamper_file_warts_free_state, /* free_state */ }, {"json", /* type */ NULL, /* detect */ NULL, /* init_read */ scamper_file_json_init_write, /* init_write */ NULL, /* init_append */ NULL, /* read */ scamper_file_json_trace_write, /* write_trace */ scamper_file_json_cyclestart_write, /* write_cycle_start */ scamper_file_json_cyclestop_write, /* write_cycle_stop */ scamper_file_json_ping_write, /* write_ping */ NULL, /* write_tracelb */ NULL, /* write_sting */ scamper_file_json_dealias_write, /* write_dealias */ NULL, /* write_neighbourdisc */ scamper_file_json_tbit_write, /* write_tbit */ NULL, /* write_sniff */ scamper_file_json_free_state, /* free_state */ }, }; static int handler_cnt = sizeof(handlers) / sizeof(struct handler); int scamper_file_getfd(const scamper_file_t *sf) { return sf->fd; } void *scamper_file_getstate(const scamper_file_t *sf) { return sf->state; } char *scamper_file_getfilename(scamper_file_t *sf) { return sf->filename; } void scamper_file_setstate(scamper_file_t *sf, void *state) { sf->state = state; return; } void scamper_file_setreadfunc(scamper_file_t *sf, void *param, scamper_file_readfunc_t rf) { sf->readfunc = rf; sf->readparam = param; return; } scamper_file_readfunc_t scamper_file_getreadfunc(const scamper_file_t *sf) { return sf->readfunc; } void *scamper_file_getreadparam(const scamper_file_t *sf) { return sf->readparam; } void scamper_file_setwritefunc(scamper_file_t *sf, void *param, scamper_file_writefunc_t wf) { sf->writefunc = wf; sf->writeparam = param; return; } scamper_file_writefunc_t scamper_file_getwritefunc(const scamper_file_t *sf) { return sf->writefunc; } void *scamper_file_getwriteparam(const scamper_file_t *sf) { return sf->writeparam; } int scamper_file_write_trace(scamper_file_t *sf, const struct scamper_trace *trace) { int rc = -1; if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].write_trace != NULL) { rc = handlers[sf->type].write_trace(sf, trace); } return rc; } int scamper_file_write_ping(scamper_file_t *sf, const struct scamper_ping *ping) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].write_ping != NULL) { return handlers[sf->type].write_ping(sf, ping); } return -1; } int scamper_file_write_tracelb(scamper_file_t *sf, const struct scamper_tracelb *trace) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].write_tracelb != NULL) { return handlers[sf->type].write_tracelb(sf, trace); } return -1; } int scamper_file_write_sting(scamper_file_t *sf, const struct scamper_sting *sting) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].write_sting != NULL) { return handlers[sf->type].write_sting(sf, sting); } return -1; } int scamper_file_write_dealias(scamper_file_t *sf, const struct scamper_dealias *dealias) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].write_dealias != NULL) { return handlers[sf->type].write_dealias(sf, dealias); } return -1; } int scamper_file_write_neighbourdisc(scamper_file_t *sf, const struct scamper_neighbourdisc *nd) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].write_neighbourdisc != NULL) { return handlers[sf->type].write_neighbourdisc(sf, nd); } return -1; } int scamper_file_write_tbit(scamper_file_t *sf, const struct scamper_tbit *tbit) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].write_tbit != NULL) { return handlers[sf->type].write_tbit(sf, tbit); } return -1; } int scamper_file_write_sniff(scamper_file_t *sf, const struct scamper_sniff *sniff) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].write_sniff != NULL) { return handlers[sf->type].write_sniff(sf, sniff); } return -1; } int scamper_file_write_obj(scamper_file_t *sf, uint16_t type, const void *data) { static int (*const func[])(scamper_file_t *sf, const void *) = { NULL, NULL, /* SCAMPER_FILE_OBJ_LIST */ (write_obj_func_t)scamper_file_write_cycle_start, NULL, /* SCAMPER_FILE_OBJ_CYCLE_DEF */ (write_obj_func_t)scamper_file_write_cycle_stop, NULL, /* SCAMPER_FILE_OBJ_ADDR */ (write_obj_func_t)scamper_file_write_trace, (write_obj_func_t)scamper_file_write_ping, (write_obj_func_t)scamper_file_write_tracelb, (write_obj_func_t)scamper_file_write_dealias, (write_obj_func_t)scamper_file_write_neighbourdisc, (write_obj_func_t)scamper_file_write_tbit, (write_obj_func_t)scamper_file_write_sting, (write_obj_func_t)scamper_file_write_sniff, }; if(type > 13 || func[type] == NULL) return -1; return func[type](sf, data); } /* * scamper_file_read * * */ int scamper_file_read(scamper_file_t *sf, scamper_file_filter_t *filter, uint16_t *type, void **object) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].read != NULL) { return handlers[sf->type].read(sf, filter, type, object); } return -1; } /* * scamper_file_filter_isset * * check to see if the particular type is set in the filter or not */ int scamper_file_filter_isset(scamper_file_filter_t *filter, uint16_t type) { if(filter == NULL || type > filter->max) { return 0; } if((filter->flags[type/32] & (0x1 << ((type%32)-1))) == 0) { return 0; } return 1; } /* * scamper_file_filter_alloc * * allocate a filter for reading data objects from scamper files based on an * array of types the caller is interested in. */ scamper_file_filter_t *scamper_file_filter_alloc(uint16_t *types, uint16_t num) { scamper_file_filter_t *filter = NULL; size_t size; int i, j, k; /* sanity checks */ if(types == NULL || num == 0) { goto err; } /* allocate filter structure which will be returned to caller */ if((filter = malloc_zero(sizeof(scamper_file_filter_t))) == NULL) { goto err; } /* first, figure out the maximum type value of interest */ for(i=0; i filter->max) { filter->max = types[i]; } } /* sanity check */ if(filter->max == 0) { goto err; } /* allocate the flags array */ size = sizeof(uint32_t) * filter->max / 32; if((filter->max % 32) != 0) size += sizeof(uint32_t); if((filter->flags = malloc_zero(size)) == NULL) { goto err; } /* go through each type and set the appropriate flag */ for(i=0; iflags[j] |= (0x1 << (k-1)); } return filter; err: if(filter != NULL) { if(filter->flags != NULL) free(filter->flags); free(filter); } return NULL; } void scamper_file_filter_free(scamper_file_filter_t *filter) { if(filter != NULL) { if(filter->flags != NULL) free(filter->flags); free(filter); } return; } int scamper_file_write_cycle_start(scamper_file_t *sf, scamper_cycle_t *cycle) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].write_cycle_start != NULL) { return handlers[sf->type].write_cycle_start(sf, cycle); } return -1; } int scamper_file_write_cycle_stop(scamper_file_t *sf, scamper_cycle_t *cycle) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].write_cycle_stop != NULL) { return handlers[sf->type].write_cycle_stop(sf, cycle); } return -1; } /* * scamper_file_geteof * */ int scamper_file_geteof(scamper_file_t *sf) { if(sf == NULL || sf->fd == -1) return -1; return sf->eof; } /* * scamper_file_seteof * */ void scamper_file_seteof(scamper_file_t *sf) { if(sf != NULL && sf->fd != -1) sf->eof = 1; return; } /* * scamper_file_free * */ void scamper_file_free(scamper_file_t *sf) { if(sf != NULL) { if(sf->filename) free(sf->filename); free(sf); } return; } /* * scamper_file_close * */ void scamper_file_close(scamper_file_t *sf) { /* free state associated with the type of scamper_file_t */ if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].free_state != NULL) { handlers[sf->type].free_state(sf); } /* close the file descriptor */ if(sf->fd != -1) { close(sf->fd); } /* free general state associated */ scamper_file_free(sf); return; } char *scamper_file_type_tostr(scamper_file_t *sf, char *buf, size_t len) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].type != NULL) { strncpy(buf, handlers[sf->type].type, len); return buf; } return NULL; } static int file_type_get(char *type) { int i; if(type == NULL) return SCAMPER_FILE_NONE; for(i=0; ifd != -1) { if(fstat(sf->fd, &sb) != 0) { return -1; } if(sb.st_size != 0 && (sb.st_mode & S_IFIFO) == 0 && (sf->type = file_type_detect(sf)) == SCAMPER_FILE_NONE) { return -1; } } if(handlers[sf->type].init_read == NULL) return -1; return handlers[sf->type].init_read(sf); } static int file_open_write(scamper_file_t *sf) { if(sf->type != SCAMPER_FILE_NONE && handlers[sf->type].init_write != NULL) return handlers[sf->type].init_write(sf); return 0; } static int file_open_append(scamper_file_t *sf) { struct stat sb; if(fstat(sf->fd, &sb) != 0) return -1; if(sb.st_size == 0) { if(sf->type == SCAMPER_FILE_WARTS) return handlers[sf->type].init_write(sf); else if(sf->type == SCAMPER_FILE_TEXT || sf->type == SCAMPER_FILE_JSON) return 0; return -1; } /* can't append to pipes */ if((sb.st_mode & S_IFIFO) != 0) return -1; sf->type = file_type_detect(sf); if(handlers[sf->type].init_append != NULL) return handlers[sf->type].init_append(sf); else if(sf->type != SCAMPER_FILE_TEXT && sf->type != SCAMPER_FILE_JSON) return -1; return 0; } static scamper_file_t *file_open(int fd, char *fn, char mode, int type) { scamper_file_t *sf; int (*open_func)(scamper_file_t *); if(mode == 'r') open_func = file_open_read; else if(mode == 'w') open_func = file_open_write; else if(mode == 'a') open_func = file_open_append; else return NULL; if((sf = (scamper_file_t *)malloc_zero(sizeof(scamper_file_t))) == NULL) { return NULL; } if(fn != NULL && (sf->filename = strdup(fn)) == NULL) { free(sf); return NULL; } sf->type = type; sf->fd = fd; if(open_func(sf) == -1) { scamper_file_close(sf); return NULL; } return sf; } scamper_file_t *scamper_file_opennull(char mode, char *format) { uint8_t file_type; if(strcasecmp(format, "warts") == 0) file_type = SCAMPER_FILE_WARTS; else if(strcasecmp(format, "json") == 0) file_type = SCAMPER_FILE_JSON; else return NULL; return file_open(-1, NULL, mode, file_type); } scamper_file_t *scamper_file_openfd(int fd, char *fn, char mode, char *type) { return file_open(fd, fn, mode, file_type_get(type)); } /* * scamper_file_open * * open the file specified with the appropriate mode. * the modes that we know about are 'r' read-only, 'w' write-only on a * brand new file, and 'a' for appending. * * in 'w' mode [and conditionally for 'a'] an optional parameter may be * supplied that says what type of file should be written. * 'w' for warts * 't' for text * 'a' for arts [not implemented] * * when a file is opened for appending, this second parameter is only * used when the file is empty so that writes will be written in the * format expected. */ scamper_file_t *scamper_file_open(char *filename, char mode, char *type) { scamper_file_t *sf; mode_t mo; int ft = file_type_get(type); int flags = 0; int fd = -1; #ifndef _WIN32 mo = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; #else mo = _S_IREAD | _S_IWRITE; #endif if(mode == 'r') { if(strcmp(filename, "-") == 0) { fd = STDIN_FILENO; } else { flags = O_RDONLY; } } else if(mode == 'w' || mode == 'a') { /* sanity check the type of file to be written */ if(ft == SCAMPER_FILE_NONE || ft == SCAMPER_FILE_ARTS) { return NULL; } if(strcmp(filename, "-") == 0) { fd = STDIN_FILENO; } else { if(mode == 'w') flags = O_WRONLY | O_TRUNC | O_CREAT; else flags = O_RDWR | O_APPEND | O_CREAT; } } else { return NULL; } #ifdef _WIN32 flags |= O_BINARY; #endif if(fd == -1) { if(mode == 'r') fd = open(filename, flags); else fd = open(filename, flags, mo); if(fd == -1) { return NULL; } } sf = file_open(fd, filename, mode, ft); return sf; } scamper-cvs-20171204/scamper/scamper_file.h000644 001751 000000 00000011323 13130372145 020346 0ustar00mjlwheel000000 000000 /* * scamper_file.c * * $Id: scamper_file.h,v 1.31 2017/07/09 09:16:21 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_FILE_H #define __SCAMPER_FILE_H /* handle for reading / writing files that scamper understands */ typedef struct scamper_file scamper_file_t; /* handle for filtering objects from a file when reading */ typedef struct scamper_file_filter scamper_file_filter_t; typedef int (*scamper_file_writefunc_t)(void *param, const void *data, size_t len); typedef int (*scamper_file_readfunc_t)(void *param, uint8_t **data, size_t len); /* types of objects that scamper understands */ #define SCAMPER_FILE_OBJ_LIST 0x01 #define SCAMPER_FILE_OBJ_CYCLE_START 0x02 #define SCAMPER_FILE_OBJ_CYCLE_DEF 0x03 #define SCAMPER_FILE_OBJ_CYCLE_STOP 0x04 #define SCAMPER_FILE_OBJ_ADDR 0x05 #define SCAMPER_FILE_OBJ_TRACE 0x06 #define SCAMPER_FILE_OBJ_PING 0x07 #define SCAMPER_FILE_OBJ_TRACELB 0x08 #define SCAMPER_FILE_OBJ_DEALIAS 0x09 #define SCAMPER_FILE_OBJ_NEIGHBOURDISC 0x0a #define SCAMPER_FILE_OBJ_TBIT 0x0b #define SCAMPER_FILE_OBJ_STING 0x0c #define SCAMPER_FILE_OBJ_SNIFF 0x0d scamper_file_t *scamper_file_open(char *fn, char mode, char *type); scamper_file_t *scamper_file_openfd(int fd, char *fn, char mode, char *type); scamper_file_t *scamper_file_opennull(char mode, char *format); void scamper_file_close(scamper_file_t *sf); void scamper_file_free(scamper_file_t *sf); scamper_file_filter_t *scamper_file_filter_alloc(uint16_t *types,uint16_t num); void scamper_file_filter_free(scamper_file_filter_t *filter); int scamper_file_filter_isset(scamper_file_filter_t *filter, uint16_t type); int scamper_file_read(scamper_file_t *sf, scamper_file_filter_t *filter, uint16_t *obj_type, void **obj_data); int scamper_file_write_obj(scamper_file_t *sf,uint16_t type,const void *data); struct scamper_cycle; int scamper_file_write_cycle_start(scamper_file_t *sf, struct scamper_cycle *cycle); int scamper_file_write_cycle_stop(scamper_file_t *sf, struct scamper_cycle *cycle); struct scamper_trace; int scamper_file_write_trace(scamper_file_t *sf, const struct scamper_trace *trace); struct scamper_tracelb; int scamper_file_write_tracelb(scamper_file_t *sf, const struct scamper_tracelb *trace); struct scamper_ping; int scamper_file_write_ping(scamper_file_t *sf, const struct scamper_ping *ping); struct scamper_sting; int scamper_file_write_sting(scamper_file_t *sf, const struct scamper_sting *sting); struct scamper_dealias; int scamper_file_write_dealias(scamper_file_t *sf, const struct scamper_dealias *dealias); struct scamper_neighbourdisc; int scamper_file_write_neighbourdisc(scamper_file_t *sf, const struct scamper_neighbourdisc *nd); struct scamper_tbit; int scamper_file_write_tbit(scamper_file_t *sf, const struct scamper_tbit *tbit); struct scamper_sniff; int scamper_file_write_sniff(scamper_file_t *sf, const struct scamper_sniff *sniff); char *scamper_file_type_tostr(scamper_file_t *sf, char *buf, size_t len); char *scamper_file_getfilename(scamper_file_t *sf); int scamper_file_geteof(scamper_file_t *sf); void scamper_file_seteof(scamper_file_t *sf); void scamper_file_setreadfunc(scamper_file_t *sf, void *param, scamper_file_readfunc_t readfunc); scamper_file_readfunc_t scamper_file_getreadfunc(const scamper_file_t *sf); void *scamper_file_getreadparam(const scamper_file_t *sf); void scamper_file_setwritefunc(scamper_file_t *sf, void *param, scamper_file_writefunc_t writefunc); scamper_file_writefunc_t scamper_file_getwritefunc(const scamper_file_t *sf); void *scamper_file_getwriteparam(const scamper_file_t *sf); int scamper_file_getfd(const scamper_file_t *sf); void *scamper_file_getstate(const scamper_file_t *sf); void scamper_file_setstate(scamper_file_t *sf, void *state); #endif /* __SCAMPER_FILE_H */ scamper-cvs-20171204/scamper/scamper_file_arts.c000644 001751 000000 00000041501 13022467213 021374 0ustar00mjlwheel000000 000000 /* * scamper_file_arts.c * * $Id: scamper_file_arts.c,v 1.63 2016/12/09 08:42:51 mjl Exp $ * * code to read the legacy arts data file format into scamper_hop structures. * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2014 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_file_arts.c,v 1.63 2016/12/09 08:42:51 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "mjl_splaytree.h" #include "scamper_addr.h" #include "scamper_list.h" #include "trace/scamper_trace.h" #include "scamper_file.h" #include "scamper_file_arts.h" #include "utils.h" typedef struct arts_state { int ispipe; splaytree_t *list_tree; splaytree_t *cycle_tree; } arts_state_t; typedef struct arts_header { uint8_t ver; uint32_t id; uint32_t flags; uint32_t data_length; uint32_t creation; } arts_header_t; #define ARTS_MAGIC 0xdfb0 #define ARTS_IP_PATH 0x00003000 #define ARTS_IP_PATH_RTT 0x01 #define ARTS_ATTR_CREATION 2 #define ARTS_FORMAT_UNIXDATE 13 #define ARTS_STOP_NOHALT 0x00 #define ARTS_STOP_ICMPUNREACH 0x01 #define ARTS_STOP_LOOP 0x02 #define ARTS_STOP_GAPLIMIT 0x03 /* * arts_read_hdr: * * read the 20 byte header that is written out before each arts object * and parse it into ah */ static int arts_read_hdr(const scamper_file_t *sf, arts_header_t *ah) { int fd = scamper_file_getfd(sf); uint8_t buf[20], *tmp = buf; uint32_t junk32; uint32_t i, attr_len; uint16_t junk16; int ret; size_t rc; memset(ah, 0, sizeof(arts_header_t)); /* read the arts header */ if((ret = read_wrap(fd, buf, &rc, 20)) != 0) { /* have we hit the eof? */ if(ret == -2 && rc == 0) { return 0; } fprintf(stderr, "arts_read_hdr: read %d of 20 bytes\n", (int)rc); goto err; } /* read the magic section of the header */ memcpy(&junk16, buf, 2); if((junk16 = ntohs(junk16)) != ARTS_MAGIC) { fprintf(stderr, "arts_read_hdr: expected magic 0x%02x got 0x%02x\n", ARTS_MAGIC, junk16); goto err; } /* * the arts id field is stored in the upper 28 bits of the 32 bit field. * the arts version field takes the lower 4. */ memcpy(&junk32, buf+2, 4); junk32 = ntohl(junk32); ah->id = junk32 >> 4; ah->ver = junk32 & 0x0f; /* arts flags */ memcpy(&junk32, buf+6, 4); ah->flags = ntohl(junk32); /* length of data in the arts record */ memcpy(&junk32, buf+16, 4); ah->data_length = ntohl(junk32); /* figure out the length of the arts attributes */ memcpy(&junk32, buf+12, 4); attr_len = ntohl(junk32); /* allocate a large enough buffer, if necessary */ if(attr_len > sizeof(buf) && (tmp = malloc_zero(attr_len)) == NULL) goto err; /* read the arts attributes into a buffer */ if(attr_len > 0 && (ret = read_wrap(fd, tmp, &rc, attr_len)) != 0) { goto err; } /* parse the buffer for recognised arts attributes */ for(i = 0; i < attr_len; i += junk32) { /* make sure there is enough left for a complete attribute */ if(attr_len - i < 8) { goto err; } /* read the type / identifier field */ memcpy(&junk32, tmp + i, 4); junk32 = ntohl(junk32); /* extract the identifier field */ switch(junk32 >> 8) { case ARTS_ATTR_CREATION: /* make sure the type of this field is a unix date */ if((junk32 & 0xff) != ARTS_FORMAT_UNIXDATE || attr_len - i < 12) { goto err; } memcpy(&junk32, tmp + i + 8, 4); ah->creation = ntohl(junk32); break; } /* read the length field */ memcpy(&junk32, tmp + i + 4, 4); junk32 = ntohl(junk32); if(junk32 < 8 || attr_len - i < junk32) { goto err; } } /* free the buffer allocated, if there was one */ if(tmp != buf) free(tmp); return 1; err: if(tmp != NULL && tmp != buf) free(tmp); return -1; } static void arts_hop_list_free(scamper_trace_hop_t *head) { scamper_trace_hop_t *hop = head; while(hop != NULL) { head = hop->hop_next; scamper_trace_hop_free(hop); hop = head; } return; } static scamper_trace_hop_t *arts_hop_reply(scamper_addr_t *addr, uint32_t rtt, uint8_t distance) { scamper_trace_hop_t *hop = scamper_trace_hop_alloc(); if(hop != NULL) { hop->hop_addr = scamper_addr_use(addr); hop->hop_flags = 0; hop->hop_probe_id = 0; hop->hop_probe_ttl = distance; hop->hop_probe_size = 0; hop->hop_reply_ttl = 0; hop->hop_reply_size = 0; hop->hop_icmp_type = ICMP_ECHOREPLY; hop->hop_icmp_code = 0; hop->hop_rtt.tv_sec = rtt / 1000000; hop->hop_rtt.tv_usec = rtt % 1000000; } return hop; } static int arts_hop_read(scamper_trace_hop_t *hop, const uint8_t *buf, const arts_header_t *ah) { uint32_t junk32; int i = 0; /* set defaults for data items stored with this hop */ hop->hop_addr = NULL; hop->hop_flags = 0; hop->hop_probe_id = 0; hop->hop_probe_ttl = buf[i++]; hop->hop_probe_size = 0; hop->hop_reply_ttl = 0; hop->hop_reply_size = 0; hop->hop_icmp_type = ICMP_TIMXCEED; hop->hop_icmp_code = ICMP_TIMXCEED_INTRANS; hop->hop_rtt.tv_sec = 0; hop->hop_rtt.tv_usec = 0; /* read the 1 byte hop number this path entry refers to */ if(hop->hop_probe_ttl == 0) return -1; /* the IPv4 address of the hop that responded */ if((hop->hop_addr = scamper_addr_alloc_ipv4(buf+i)) == NULL) return -1; i += 4; /* arts 1 always stores RTT per hop; arts > 1 conditionally stores it */ if(ah->ver == 1 || (ah->flags & ARTS_IP_PATH_RTT && ah->ver > 1)) { /* RTT, stored in microseconds */ memcpy(&junk32, buf+i, 4); i += 4; junk32 = ntohl(junk32); hop->hop_rtt.tv_sec = junk32 / 1000000; hop->hop_rtt.tv_usec = junk32 % 1000000; /* num tries */ hop->hop_probe_id = buf[i++]; } return i; } static scamper_trace_hop_t *arts_hops_read(const arts_header_t *ah, const uint8_t *buf, int count, int *off) { scamper_trace_hop_t *head = NULL, *hop = NULL; int i = 0; int rc; if(count == 0) { return NULL; } while(count-- > 0) { if(hop != NULL) { hop->hop_next = scamper_trace_hop_alloc(); hop = hop->hop_next; } else { head = hop = scamper_trace_hop_alloc(); } if(hop == NULL) goto err; if((rc = arts_hop_read(hop, buf+i, ah)) <= 0) goto err; i += rc; } *off += i; return head; err: arts_hop_list_free(head); return NULL; } static int arts_list_cmp(const scamper_list_t *a, const scamper_list_t *b) { if(a->id < b->id) return -1; if(a->id > b->id) return 1; return 0; } static scamper_list_t *arts_list_get(arts_state_t *state, uint32_t id) { scamper_list_t findme, *list; findme.id = id; if((list = splaytree_find(state->list_tree, &findme)) == NULL) { if((list = scamper_list_alloc(id, NULL, NULL, NULL)) == NULL) return NULL; if(splaytree_insert(state->list_tree, list) == NULL) { scamper_list_free(list); return NULL; } } return list; } static int arts_cycle_cmp(const scamper_cycle_t *a, const scamper_cycle_t *b) { int i; if((i = arts_list_cmp(a->list, b->list)) != 0) return i; if(a->id < b->id) return -1; if(a->id > b->id) return 1; return 0; } static scamper_cycle_t *arts_cycle_get(arts_state_t *state, scamper_list_t *list, uint32_t id) { scamper_cycle_t findme, *cycle; findme.list = list; findme.id = id; if((cycle = splaytree_find(state->cycle_tree, &findme)) == NULL) { if((cycle = scamper_cycle_alloc(list)) == NULL) return NULL; cycle->id = id; if(splaytree_insert(state->cycle_tree, cycle) == NULL) { scamper_cycle_free(cycle); return NULL; } } return cycle; } static scamper_trace_t *arts_read_trace(const scamper_file_t *sf, const arts_header_t *ah) { int fd = scamper_file_getfd(sf); arts_state_t *state = scamper_file_getstate(sf); scamper_trace_t *trace = NULL; uint8_t *buf = NULL; int i; uint32_t junk32; uint8_t junk8; uint8_t hop_distance; uint8_t halt_reason; uint8_t halt_reason_data; uint8_t reply_ttl = 0; uint32_t rtt; scamper_trace_hop_t *hop, *hops = NULL; uint8_t num_hop_recs; uint8_t max_hop; uint8_t destination_replied; size_t rc; if((buf = malloc_zero(ah->data_length)) == NULL) { fprintf(stderr, "arts_read_trace: malloc %d for trace object failed\n", ah->data_length); goto err; } if(read_wrap(fd, buf, &rc, ah->data_length) != 0) { fprintf(stderr, "arts_read_trace: read %d expected %d\n", (int)rc, ah->data_length); goto err; } if((trace = scamper_trace_alloc()) == NULL) { fprintf(stderr, "arts_read_trace: scamper_trace_alloc failed\n"); goto err; } trace->start.tv_sec = ah->creation; trace->type = SCAMPER_TRACE_TYPE_ICMP_ECHO; trace->probe_size = 20 + 8 + 12; i = 0; if((trace->src = scamper_addr_alloc_ipv4(buf+i)) == NULL) goto err; i += 4; if((trace->dst = scamper_addr_alloc_ipv4(buf+i)) == NULL) goto err; i += 4; if(ah->ver >= 3) { /* list id */ memcpy(&junk32, buf+i, 4); i += 4; junk32 = ntohl(junk32); if((trace->list = arts_list_get(state, junk32)) == NULL) goto err; scamper_list_use(trace->list); /* cycle id */ memcpy(&junk32, buf+i, 4); i += 4; junk32 = ntohl(junk32); if((trace->cycle = arts_cycle_get(state, trace->list, junk32)) == NULL) goto err; scamper_cycle_use(trace->cycle); } /* * read the RTT of the last hop * arts prior to version 2 stores a timeval struct in the file for * recording RTT, which is wasteful */ memcpy(&junk32, buf+i, 4); i += 4; rtt = ntohl(junk32); if(ah->ver < 2) { rtt *= 1000000; memcpy(&junk32, buf+i, 4); i += 4; rtt += ntohl(junk32); } /* * the hop distance field tells us how many hops a packet takes to a * destination */ hop_distance = buf[i++]; /* * read the next 8 bit field. the first bit says if the trace was * successful in probing to the end host, and the other 7 bits say * how many hops actually responded to a probe. */ junk8 = buf[i++]; destination_replied = junk8 >> 7; if(destination_replied != 0) trace->stop_reason = SCAMPER_TRACE_STOP_COMPLETED; num_hop_recs = junk8 & 0x7f; /* * arts versions after 1 (and arts version 1 conditionally) store * data that tells us why the trace stopped */ if(ah->ver > 1 || (destination_replied != 0 && ah->ver == 1)) { halt_reason = buf[i++]; halt_reason_data = buf[i++]; switch(halt_reason) { case ARTS_STOP_NOHALT: trace->stop_reason = SCAMPER_TRACE_STOP_NONE; break; case ARTS_STOP_ICMPUNREACH: trace->stop_reason = SCAMPER_TRACE_STOP_UNREACH; break; case ARTS_STOP_LOOP: trace->stop_reason = SCAMPER_TRACE_STOP_LOOP; break; case ARTS_STOP_GAPLIMIT: trace->stop_reason = SCAMPER_TRACE_STOP_GAPLIMIT; break; } trace->stop_data = halt_reason_data; } if(num_hop_recs == 0 && destination_replied == 0) { free(buf); return trace; } /* * arts >= 2 stores the TTL of reply packet from a destination so we * can estimate the number of hops on the reverse path */ if(ah->ver >= 2) reply_ttl = buf[i++]; if(num_hop_recs > 0 && (hops = arts_hops_read(ah, buf+i, num_hop_recs, &i)) == NULL) { fprintf(stderr, "arts_read_trace: arts_hops_read %d failed\n", num_hop_recs); goto err; } if(destination_replied != 0) max_hop = hop_distance; else max_hop = 0; /* * make a pass through all ArtsIpPathEntry structures. figure out * the largest probe ttl used. if the trace stopped because an ICMP * unreachable was received, then associate the type/code with the last * structure read. */ if((hop = hops) != NULL) { for(;;) { if(max_hop < hop->hop_probe_ttl) max_hop = hop->hop_probe_ttl; if(hop->hop_next == NULL) { if(trace->stop_reason == SCAMPER_TRACE_STOP_UNREACH) { hop->hop_icmp_type = ICMP_UNREACH; hop->hop_icmp_code = trace->stop_data; } break; } hop = hop->hop_next; } } if((uint32_t)i != ah->data_length) goto err; free(buf); buf = NULL; if(max_hop == 0) return trace; if(scamper_trace_hops_alloc(trace, max_hop) == -1) goto err; trace->hop_count = max_hop; /* * now loop through the hops array stored in this procedure * and assemble the responses into trace->hops. order them based * on the probe's ttl then by attempt */ if(hops != NULL) { trace->hops[hops->hop_probe_ttl-1] = hop = hops; while(hop->hop_next != NULL) { if(hop->hop_probe_ttl != hop->hop_next->hop_probe_ttl) { i = hop->hop_next->hop_probe_ttl-1; trace->hops[i] = hop->hop_next; hop->hop_next = NULL; hop = trace->hops[i]; } else hop = hop->hop_next; } hops = NULL; } if(destination_replied != 0) { if((hop = arts_hop_reply(trace->dst, rtt, hop_distance)) == NULL) goto err; if(ah->ver >= 2) { hop->hop_reply_ttl = reply_ttl; hop->hop_flags |= SCAMPER_TRACE_HOP_FLAG_REPLY_TTL; } hop->hop_next = trace->hops[hop->hop_probe_ttl-1]; trace->hops[hop->hop_probe_ttl-1] = hop; } return trace; err: if(hops != NULL) arts_hop_list_free(hops); if(trace != NULL) scamper_trace_free(trace); if(buf != NULL) free(buf); return NULL; } static int arts_skip(scamper_file_t *sf, uint32_t bytes) { arts_state_t *state = scamper_file_getstate(sf); int fd = scamper_file_getfd(sf); uint8_t buf[512]; size_t len; if(state->ispipe == 0) { if(lseek(fd, bytes, SEEK_CUR) != -1) return 0; if(errno != ESPIPE) return -1; state->ispipe = 1; } while(bytes != 0) { len = (sizeof(buf) < bytes) ? sizeof(buf) : bytes; if(read_wrap(fd, buf, NULL, len) != 0) return -1; bytes -= len; } return 0; } /* * scamper_file_arts_read * * legacy arts only recognises IPv4 traces */ int scamper_file_arts_read(scamper_file_t *sf, scamper_file_filter_t *filter, uint16_t *type, void **data) { arts_header_t ah; int tmp; for(;;) { if((tmp = arts_read_hdr(sf, &ah)) == 0) { /* EOF */ *data = NULL; break; } else if(tmp == -1) { /* partial record */ return -1; } if(ah.data_length == 0) return -1; if(ah.id == ARTS_IP_PATH && scamper_file_filter_isset(filter, SCAMPER_FILE_OBJ_TRACE)) { if((*data = arts_read_trace(sf, &ah)) == NULL) return -1; *type = SCAMPER_FILE_OBJ_TRACE; return 0; } /* skip over */ if(arts_skip(sf, ah.data_length) != 0) return -1; } return 0; } int scamper_file_arts_is(const scamper_file_t *sf) { uint16_t magic16; int fd = scamper_file_getfd(sf); if(lseek(fd, 0, SEEK_SET) == -1) return 0; if(read_wrap(fd, &magic16, NULL, sizeof(magic16)) != 0) return 0; if(ntohs(magic16) == ARTS_MAGIC) { if(lseek(fd, 0, SEEK_SET) == -1) return 0; return 1; } return 0; } static void arts_state_free(arts_state_t *state) { if(state == NULL) return; if(state->list_tree != NULL) splaytree_free(state->list_tree, (splaytree_free_t)scamper_list_free); if(state->cycle_tree != NULL) splaytree_free(state->cycle_tree, (splaytree_free_t)scamper_cycle_free); free(state); return; } int scamper_file_arts_init_read(scamper_file_t *sf) { arts_state_t *s; if((s = (arts_state_t *)malloc_zero(sizeof(arts_state_t))) == NULL || (s->list_tree=splaytree_alloc((splaytree_cmp_t)arts_list_cmp)) == NULL || (s->cycle_tree=splaytree_alloc((splaytree_cmp_t)arts_cycle_cmp)) == NULL) { arts_state_free(s); return -1; } scamper_file_setstate(sf, s); return 0; } void scamper_file_arts_free_state(scamper_file_t *sf) { arts_state_free(scamper_file_getstate(sf)); return; } scamper-cvs-20171204/scamper/scamper_file_arts.h000644 001751 000000 00000002471 11634537540 021414 0ustar00mjlwheel000000 000000 /* * scamper_file_arts.h * * $Id: scamper_file_arts.h,v 1.8 2011/09/16 03:15:44 mjl Exp $ * * code to read the legacy arts data file format into scamper_trace structures. * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2008 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef _SCAMPER_FILE_ARTS_H #define _SCAMPER_FILE_ARTS_H int scamper_file_arts_read(scamper_file_t *sf, scamper_file_filter_t *filter, uint16_t *type, void **data); int scamper_file_arts_is(const scamper_file_t *file); int scamper_file_arts_init_read(scamper_file_t *file); void scamper_file_arts_free_state(scamper_file_t *file); #endif /* _SCAMPER_FILE_ARTS_H */ scamper-cvs-20171204/scamper/scamper_file_json.c000644 001751 000000 00000006464 13130370712 021402 0ustar00mjlwheel000000 000000 /* * scamper_file_json.c * * $Id: scamper_file_json.c,v 1.1 2017/07/09 09:05:14 mjl Exp $ * * Copyright (C) 2017 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_file_json.c,v 1.1 2017/07/09 09:05:14 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_list.h" #include "scamper_file.h" #include "scamper_file_json.h" #include "utils.h" int scamper_file_json_cyclestart_write(const scamper_file_t *sf, scamper_cycle_t *c) { char buf[1024]; size_t off = 0; string_concat(buf, sizeof(buf), &off, "{\"type\":\"cycle-start\", \"list_name\":\"%s\", \"id\":%u", c->list->name, c->id); if(c->hostname != NULL) string_concat(buf,sizeof(buf),&off, ", \"hostname\":\"%s\"", c->hostname); string_concat(buf,sizeof(buf),&off, ", \"start_time\":%u}\n",c->start_time); return json_write(sf, buf, off); } int scamper_file_json_cyclestop_write(const scamper_file_t *sf, scamper_cycle_t *c) { char buf[1024]; size_t off = 0; string_concat(buf, sizeof(buf), &off, "{\"type\":\"cycle-stop\", \"list_name\":\"%s\", \"id\":%u", c->list->name, c->id); if(c->hostname != NULL) string_concat(buf,sizeof(buf),&off, ", \"hostname\":\"%s\"", c->hostname); string_concat(buf,sizeof(buf),&off, ", \"stop_time\":%u}\n", c->stop_time); return json_write(sf, buf, off); } int json_write(const scamper_file_t *sf, const void *buf, size_t len) { scamper_file_writefunc_t wf = scamper_file_getwritefunc(sf); json_state_t *state = scamper_file_getstate(sf); off_t off = 0; void *param; int fd; if(wf != NULL) { param = scamper_file_getwriteparam(sf); return wf(param, buf, len); } fd = scamper_file_getfd(sf); if(state->isreg && (off = lseek(fd, 0, SEEK_CUR)) == (off_t)-1) return -1; if(write_wrap(fd, buf, NULL, len) != 0) { /* * if we could not write the buf out, then truncate the file at * the hdr we just wrote out above. */ if(state->isreg != 0) ftruncate(fd, off); return -1; } return 0; } int scamper_file_json_init_write(scamper_file_t *sf) { json_state_t *s = NULL; struct stat sb; int fd; if((s = malloc_zero(sizeof(json_state_t))) == NULL) goto err; if((fd = scamper_file_getfd(sf)) != -1) { if(fstat(fd, &sb) != 0) goto err; if(S_ISREG(sb.st_mode)) s->isreg = 1; } scamper_file_setstate(sf, s); return 0; err: if(s != NULL) free(s); return -1; } void scamper_file_json_free_state(scamper_file_t *sf) { json_state_t *state; if((state = scamper_file_getstate(sf)) == NULL) return; free(state); return; } scamper-cvs-20171204/scamper/scamper_file_json.h000644 001751 000000 00000002535 13130370712 021402 0ustar00mjlwheel000000 000000 /* * scamper_file_warts.h * * $Id: scamper_file_json.h,v 1.1 2017/07/09 09:05:14 mjl Exp $ * * Copyright (C) 2017 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_FILE_JSON_H #define __SCAMPER_FILE_JSON_H typedef struct json_state { int isreg; } json_state_t; int scamper_file_json_cyclestart_write(const scamper_file_t *sf, scamper_cycle_t *c); int scamper_file_json_cyclestop_write(const scamper_file_t *sf, scamper_cycle_t *c); int json_write(const scamper_file_t *sf, const void *buf, size_t len); int scamper_file_json_init_write(scamper_file_t *file); void scamper_file_json_free_state(scamper_file_t *file); #endif /* __SCAMPER_FILE_JSON_h */ scamper-cvs-20171204/scamper/scamper_file_text.c000644 001751 000000 00000003067 11634537540 021424 0ustar00mjlwheel000000 000000 /* * scamper_file_text.c * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * $Id: scamper_file_text.c,v 1.87 2011/09/16 03:15:44 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_file_text.c,v 1.87 2011/09/16 03:15:44 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_file.h" #include "scamper_file_text.h" #include "utils.h" int scamper_file_text_is(const scamper_file_t *sf) { char buf[10]; int fd; fd = scamper_file_getfd(sf); if(lseek(fd, 0, SEEK_SET) == -1) { return 0; } if(read_wrap(fd, buf, NULL, sizeof(buf)) != 0) { return 0; } if(strncmp(buf, "traceroute", 10) == 0) { if(lseek(fd, 0, SEEK_SET) == -1) { return 0; } return 1; } return 0; } scamper-cvs-20171204/scamper/scamper_file_text.h000644 001751 000000 00000003366 11634537540 021433 0ustar00mjlwheel000000 000000 /* * scamper_file_text.h * * $Id: scamper_file_text.h,v 1.16 2011/09/16 03:15:44 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef _SCAMPER_FILE_TEXT_H #define _SCAMPER_FILE_TEXT_H struct scamper_trace; int scamper_file_text_write_trace(const scamper_file_t *sf, const struct scamper_trace *trace); struct scamper_ping; int scamper_file_text_write_ping(const scamper_file_t *sf, const struct scamper_ping *ping); struct scamper_tracelb; int scamper_file_text_write_tracelb(const scamper_file_t *sf, const struct scamper_tracelb *trace); struct scamper_sting; int scamper_file_text_write_sting(const scamper_file_t *sf, const struct scamper_sting *sting); struct scamper_dealias; int scamper_file_text_write_dealias(const scamper_file_t *sf, const struct scamper_dealias *dealias); struct scamper_tbit; int scamper_file_text_write_tbit(const scamper_file_t *sf, const struct scamper_tbit *tbit); int scamper_file_text_is(const scamper_file_t *sf); #endif /* _SCAMPER_FILE_TEXT_H */ scamper-cvs-20171204/scamper/scamper_file_warts.c000644 001751 000000 00000152252 13022467213 021571 0ustar00mjlwheel000000 000000 /* * scamper_file_warts.c * * the warts file format * * $Id: scamper_file_warts.c,v 1.253 2016/12/09 08:42:51 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2015 The Regents of the University of California * Copyright (C) 2015-2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_file_warts.c,v 1.253 2016/12/09 08:42:51 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_file.h" #include "scamper_file_warts.h" #include "trace/scamper_trace.h" #include "trace/scamper_trace_warts.h" #include "ping/scamper_ping.h" #include "ping/scamper_ping_warts.h" #include "tracelb/scamper_tracelb.h" #include "tracelb/scamper_tracelb_warts.h" #include "dealias/scamper_dealias.h" #include "dealias/scamper_dealias_warts.h" #include "neighbourdisc/scamper_neighbourdisc.h" #include "neighbourdisc/scamper_neighbourdisc_warts.h" #include "tbit/scamper_tbit.h" #include "tbit/scamper_tbit_warts.h" #include "sting/scamper_sting.h" #include "sting/scamper_sting_warts.h" #include "sniff/scamper_sniff.h" #include "sniff/scamper_sniff_warts.h" #include "mjl_splaytree.h" #include "utils.h" #define WARTS_MAGIC 0x1205 #define WARTS_HDRLEN 8 /* how many entries to grow the table by each time */ #define WARTS_ADDR_TABLEGROW 1000 #define WARTS_LIST_TABLEGROW 1 #define WARTS_CYCLE_TABLEGROW 1 /* * the optional bits of a list structure */ #define WARTS_LIST_DESCR 1 /* description of list */ #define WARTS_LIST_MONITOR 2 /* canonical name of monitor */ static const warts_var_t list_vars[] = { {WARTS_LIST_DESCR, -1, -1}, {WARTS_LIST_MONITOR, -1, -1}, }; #define list_vars_mfb WARTS_VAR_MFB(list_vars) /* * the optional bits of a cycle start structure */ #define WARTS_CYCLE_STOP_TIME 1 /* time at which cycle ended */ #define WARTS_CYCLE_HOSTNAME 2 /* hostname at cycle point */ static const warts_var_t cycle_vars[] = { {WARTS_CYCLE_STOP_TIME, 4, -1}, {WARTS_CYCLE_HOSTNAME, -1, -1}, }; #define cycle_vars_mfb WARTS_VAR_MFB(cycle_vars) typedef int (*warts_obj_read_t)(scamper_file_t *,const warts_hdr_t *,void **); struct warts_addrtable { splaytree_t *tree; warts_addr_t **addrs; int addrc; }; void flag_ij(const int id, int *i, int *j) { int x = id - 1; *i = (x / 7); *j = id - (*i * 7); return; } /* * flag_set * * small routine to set a flag bit. this exists because the 8th bit of * each byte used for flags is used to indicate when another set of flags * follows the byte. */ void flag_set(uint8_t *flags, const int id, int *max_id) { int i, j; assert(id > 0); flag_ij(id, &i, &j); flags[i] |= (0x1 << (j-1)); if(max_id != NULL && *max_id < id) *max_id = id; return; } int flag_isset(const uint8_t *flags, const int id) { int i, j; assert(id > 0); flag_ij(id, &i, &j); if((flags[i] & (0x1 << (j-1))) == 0) return 0; return 1; } /* * fold_flags * * go through and set each link bit in the flag set, as appropriate. * conveniently return the count of the number of bytes required to store * the flags. */ uint16_t fold_flags(uint8_t *flags, const int max_id) { uint16_t i, j, k; /* if no flags are set, it is still a requirement to include a zero byte */ if(max_id == 0) { return 1; } /* figure out how many bytes have been used */ j = max_id / 7; if((max_id % 7) != 0) j++; /* * j has to be greater than zero by the above logic. however, the for * loop below will go bananas if it is not */ assert(j > 0); /* skip through and set the 'more flags' bit for all flag bytes necessary */ k = j-1; for(i=0; iaddr, b->addr); } static warts_addr_t *warts_addr_alloc(scamper_addr_t *addr, uint32_t id) { warts_addr_t *wa; if((wa = malloc(sizeof(warts_addr_t))) == NULL) return NULL; wa->addr = scamper_addr_use(addr); wa->id = id; wa->ondisk = 0; return wa; } static void warts_addr_free(warts_addr_t *wa) { if(wa == NULL) return; if(wa->addr != NULL) scamper_addr_free(wa->addr); free(wa); return; } uint32_t warts_addr_size(warts_addrtable_t *t, scamper_addr_t *addr) { warts_addr_t fm, *wa; fm.addr = addr; if(splaytree_find(t->tree, &fm) != NULL) return 1 + 4; if((wa = warts_addr_alloc(addr, splaytree_count(t->tree))) != NULL && splaytree_insert(t->tree, wa) == NULL) warts_addr_free(wa); return 1 + 1 + scamper_addr_size(addr); } warts_addrtable_t *warts_addrtable_alloc_byaddr(void) { warts_addrtable_t *table; if((table = malloc(sizeof(warts_addrtable_t))) == NULL) return NULL; table->addrs = NULL; table->addrc = 0; if((table->tree = splaytree_alloc((splaytree_cmp_t)warts_addr_cmp))==NULL) { free(table); return NULL; } return table; } warts_addrtable_t *warts_addrtable_alloc_byid(void) { warts_addrtable_t *table; if((table = malloc(sizeof(warts_addrtable_t))) == NULL) return NULL; table->addrs = NULL; table->addrc = 0; table->tree = NULL; return table; } void warts_addrtable_free(warts_addrtable_t *table) { int i; if(table == NULL) return; if(table->tree != NULL) { splaytree_free(table->tree, (splaytree_free_t)warts_addr_free); } if(table->addrs != NULL) { for(i=0; iaddrc; i++) warts_addr_free(table->addrs[i]); free(table->addrs); } free(table); return; } void insert_addr(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_addr_t *addr, void *param) { warts_addrtable_t *table = param; warts_addr_t *wa, f; uint32_t id; size_t size; assert(table != NULL); assert(len - *off >= 1 + 1); f.addr = (scamper_addr_t *)addr; wa = splaytree_find(table->tree, &f); assert(wa != NULL); if(wa->ondisk == 0) { size = scamper_addr_size(addr); buf[(*off)++] = (uint8_t)size; buf[(*off)++] = addr->type; memcpy(&buf[*off], addr->addr, size); /* make a record to say this address is now recorded */ if(wa != NULL) wa->ondisk = 1; } else { size = 4; id = htonl(wa->id); buf[(*off)++] = 0; memcpy(&buf[*off], &id, size); } *off += size; return; } void insert_uint16(uint8_t *buf, uint32_t *off, const uint32_t len, const uint16_t *in, void *param) { uint16_t tmp = htons(*in); assert(len - *off >= 2); memcpy(&buf[*off], &tmp, 2); *off += 2; return; } void insert_uint32(uint8_t *buf, uint32_t *off, const uint32_t len, const uint32_t *in, void *param) { uint32_t tmp = htonl(*in); assert(len - *off >= 4); memcpy(&buf[*off], &tmp, 4); *off += 4; return; } void insert_int32(uint8_t *buf, uint32_t *off, const uint32_t len, const int32_t *in, void *param) { uint32_t tmp = htonl((uint32_t)*in); assert(len - *off >= 4); memcpy(&buf[*off], &tmp, 4); *off += 4; return; } void insert_wartshdr(uint8_t *buf, uint32_t *off, uint32_t len, uint16_t hdr_type) { const uint16_t hdr_magic = WARTS_MAGIC; uint32_t hdr_len = len - 8; assert(len - *off >= 8); insert_uint16(buf, off, len, &hdr_magic, NULL); insert_uint16(buf, off, len, &hdr_type, NULL); insert_uint32(buf, off, len, &hdr_len, NULL); return; } void insert_byte(uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *in, void *param) { assert(len - *off >= 1); buf[(*off)++] = *in; return; } void insert_bytes_uint16(uint8_t *buf,uint32_t *off,const uint32_t len, const void *vin, uint16_t *count) { assert(len - *off >= *count); memcpy(buf + *off, vin, *count); *off += *count; return; } void insert_string(uint8_t *buf, uint32_t *off, const uint32_t len, const char *in, void *param) { uint8_t c; int i = 0; do { assert(len - *off > 0); assert(in != NULL); buf[(*off)++] = c = in[i++]; } while(c != '\0'); return; } /* * insert_timeval * * this function may cause trouble in the future with timeval struct members * changing types and so on. */ void insert_timeval(uint8_t *buf, uint32_t *off, const uint32_t len, const struct timeval *in, void *param) { uint32_t t32; assert(len - *off >= 8); t32 = htonl(in->tv_sec); memcpy(buf + *off, &t32, 4); *off += 4; t32 = htonl(in->tv_usec); memcpy(buf + *off, &t32, 4); *off += 4; return; } void insert_rtt(uint8_t *buf, uint32_t *off, const uint32_t len, const struct timeval *tv, void *param) { uint32_t t32 = (tv->tv_sec * 1000000) + tv->tv_usec; insert_uint32(buf, off, len, &t32, NULL); return; } int extract_addr(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_addr_t **out, void *param) { warts_addrtable_t *table = param; warts_addr_t *wa; uint32_t u32; uint8_t size; uint8_t type; assert(table != NULL); /* make sure the offset is sane */ if(*off >= len) return -1; /* make sure there is enough data left for the address header */ if(len - *off < 1) return -1; /* get the byte saying how large the record is */ size = buf[(*off)++]; /* * if the address length field is zero, then we have a 4 byte index value * following. */ if(size == 0) { if(len - *off < 4) return -1; /* load the index value out, and sanity check it */ memcpy(&u32, &buf[*off], 4); u32 = ntohl(u32); if(u32 >= table->addrc) return -1; *out = scamper_addr_use(table->addrs[u32]->addr); *off += 4; return 0; } /* * we have an address defined inline. extract the address out and store * it in a table, incase it is referenced shortly. sanity check the type * of address */ type = buf[(*off)++]; if(type == 0 || type > SCAMPER_ADDR_TYPE_MAX) return -1; if((wa = malloc_zero(sizeof(warts_addr_t))) == NULL || (wa->addr = scamper_addr_alloc(type, &buf[*off])) == NULL || array_insert((void ***)&table->addrs, &table->addrc, wa, NULL) != 0) { goto err; } *out = scamper_addr_use(wa->addr); *off += size; return 0; err: if(wa != NULL) { if(wa->addr != NULL) scamper_addr_free(wa->addr); free(wa); } return -1; } int extract_string(const uint8_t *buf, uint32_t *off, const uint32_t len, char **out, void *param) { uint32_t i; for(i=*off; i= len || len - *off < 2) return -1; memcpy(out, buf + *off, 2); *off += 2; *out = ntohs(*out); return 0; } int extract_uint32(const uint8_t *buf, uint32_t *off, const uint32_t len, uint32_t *out, void *param) { if(*off >= len || len - *off < 4) return -1; memcpy(out, buf + *off, 4); *off += 4; *out = ntohl(*out); return 0; } int extract_int32(const uint8_t *buf, uint32_t *off, const uint32_t len, int32_t *out, void *param) { uint32_t u32; if(*off >= len || len - *off < 4) return -1; memcpy(&u32, buf + *off, 4); *off += 4; *out = (int32_t)ntohl(u32); return 0; } int extract_byte(const uint8_t *buf, uint32_t *off, const uint32_t len, uint8_t *out, void *param) { if(*off >= len || len - *off < 1) return -1; *out = buf[(*off)++]; return 0; } int extract_bytes_ptr(const uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t **out, uint16_t *req) { if(*off >= len || len - *off < *req) return -1; if(*req > 0) *out = buf + *off; else *out = NULL; *off += *req; return 0; } int extract_bytes_alloc(const uint8_t *buf, uint32_t *off, const uint32_t len, uint8_t **out, uint16_t *req) { if(*off >= len || len - *off < *req) return -1; if(*req == 0) { *out = NULL; } else { if((*out = malloc_zero(*req)) == NULL) return -1; memcpy(*out, buf + *off, *req); *off += *req; } return 0; } /* * extract_bytes * * copy the number of requested bytes into the specified array */ int extract_bytes(const uint8_t *buf, uint32_t *off, const uint32_t len, uint8_t *out, uint16_t *req) { if(*off >= len || len - *off < *req) return -1; if(req == 0) return 0; memcpy(out, buf + *off, *req); *off += *req; return 0; } int extract_addr_gid(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_addr_t **addr, warts_state_t *state) { uint32_t id; if(extract_uint32(buf, off, len, &id, NULL) != 0) { return -1; } if(id >= state->addr_count) { return -1; } *addr = scamper_addr_use(state->addr_table[id]); return 0; } int extract_list(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_list_t **list, warts_state_t *state) { uint32_t id; if(extract_uint32(buf, off, len, &id, NULL) != 0) { return -1; } if(id >= state->list_count) { return -1; } *list = scamper_list_use(state->list_table[id]->list); return 0; } int extract_cycle(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_cycle_t **cycle, warts_state_t *state) { uint32_t id; if(extract_uint32(buf, off, len, &id, NULL) != 0) return -1; if(id >= state->cycle_count || state->cycle_table[id] == NULL) return -1; *cycle = scamper_cycle_use(state->cycle_table[id]->cycle); return 0; } int extract_timeval(const uint8_t *buf, uint32_t *off, const uint32_t len, struct timeval *tv, void *param) { uint32_t t32; if(extract_uint32(buf, off, len, &t32, NULL) != 0) { return -1; } tv->tv_sec = t32; if(extract_uint32(buf, off, len, &t32, NULL) != 0) { return -1; } tv->tv_usec = t32; return 0; } int extract_rtt(const uint8_t *buf, uint32_t *off, const uint32_t len, struct timeval *tv, void *param) { uint32_t t32; if(extract_uint32(buf, off, len, &t32, NULL) != 0) { return -1; } tv->tv_sec = t32 / 1000000; tv->tv_usec = t32 % 1000000; return 0; } int warts_params_read(const uint8_t *buf, uint32_t *off, uint32_t len, warts_param_reader_t *handlers, int handler_cnt) { warts_param_reader_t *handler; const uint8_t *flags = &buf[*off]; uint16_t flags_len, params_len; uint32_t final_off; uint16_t i, j; int id; /* if there are no flags set at all, then there's nothing left to do */ if(flags[0] == 0) { (*off)++; return 0; } /* figure out how long the flags block is */ flags_len = 0; while((buf[*off] & 0x80) != 0 && *off < len) { (*off)++; flags_len++; } flags_len++; (*off)++; if(*off > len) { goto err; } /* the length field */ if(extract_uint16(buf, off, len, ¶ms_len, NULL) != 0) { goto err; } /* * this calculation is required so we handle the case where we have * new parameters that we don't know how to handle (i.e. so we can skip * over them) */ final_off = *off + params_len; /* read all flag bytes */ for(i=0; i= handler_cnt) { goto done; } handler = &handlers[id]; assert(handler->read != NULL); if(handler->read(buf, off, len, handler->data, handler->param) == -1) { goto err; } } } done: *off = final_off; return 0; err: return -1; } void warts_params_write(uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len, const warts_param_writer_t *handlers, const int handler_cnt) { uint16_t i, j, tmp; int id; /* write the flag bytes out */ tmp = flags_len; insert_bytes_uint16(buf, off, len, flags, &tmp); /* * if there are flags specified, then write the parameter length out. * otherwise, there are no parameters to write, so we are done. */ if(flags[0] != 0) { insert_uint16(buf, off, len, ¶ms_len, NULL); } else { assert(params_len == 0); return; } /* handle writing the parameter for each flight out */ for(i=0; ireadbuf != NULL) { assert(state->readbuf_len == len); /* read */ if((ret = read_wrap(fd, state->readbuf + state->readlen, &rc, len - state->readlen)) != 0) { /* rc will be zero if nothing was read, so safe to use */ state->readlen += rc; /* * we got an error (or EOF) without successfully reading whatever * was left over. */ if((ret == -1 && errno != EAGAIN) || ret == -2) { if(ret == -2) scamper_file_seteof(sf); return -1; } /* * read has not completed yet, but we haven't got a failure * condition either. */ return 0; } *buf = state->readbuf; state->readlen = 0; state->readbuf = NULL; state->readbuf_len = 0; state->off += len; return 0; } /* no data left over, reading from scratch */ if((tmp = malloc_zero(len)) == NULL) return -1; /* try and read. if we read the whole amount, everything is good */ if((ret = read_wrap(fd, tmp, &rc, len)) == 0) { *buf = tmp; state->off += len; return 0; } /* if a partial read occured, then record the partial read in state */ if(rc != 0) { state->readlen = rc; state->readbuf = tmp; state->readbuf_len = len; } else { free(tmp); } /* if we got eof and we had a partial read, then we've got a problem */ if(ret == -2) { /* got eof */ scamper_file_seteof(sf); /* partial read, so error condition */ if(rc != 0) return -1; return 0; } /* if the read would block, then there's no problem */ if(ret == -1 && errno == EAGAIN) return 0; return -1; } /* * warts_write * * this function will write a record to disk, appending a warts_header * on the way out to the disk. if the write fails for whatever reason * (as in the disk is full and only a partial recrd can be written), then * the write will be retracted in its entirety. */ int warts_write(const scamper_file_t *sf, const void *buf, size_t len) { scamper_file_writefunc_t wf = scamper_file_getwritefunc(sf); warts_state_t *state = scamper_file_getstate(sf); void *param; off_t off = 0; int fd; if(wf == NULL) { fd = scamper_file_getfd(sf); if(state->isreg && (off = lseek(fd, 0, SEEK_CUR)) == (off_t)-1) return -1; if(write_wrap(fd, buf, NULL, len) != 0) { /* * if we could not write the buf out, then truncate the warts file * at the hdr we just wrote out above. */ if(state->isreg) { if(ftruncate(fd, off) != 0) return -1; } return -1; } } else { param = scamper_file_getwriteparam(sf); return wf(param, buf, len); } return 0; } /* * warts_hdr_read * */ int warts_hdr_read(scamper_file_t *sf, warts_hdr_t *hdr) { const uint32_t len = 8; uint8_t *buf = NULL; uint32_t off = 0; if(warts_read(sf, &buf, len) != 0) { goto err; } if(buf == NULL) { return 0; } /* these three statements are guaranteed not to fail... */ extract_uint16(buf, &off, len, &hdr->magic, NULL); extract_uint16(buf, &off, len, &hdr->type, NULL); extract_uint32(buf, &off, len, &hdr->len, NULL); free(buf); assert(off == len); return 1; err: return -1; } /* * warts_addr_read * * read an address structure out of the file and record it in the splay * tree of addresses. * * each address record consists of * - an id assigned to the address, modulo 255 * - the address family the address belongs to * - the address [length determined by record length] */ int warts_addr_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_addr_t **addr_out) { warts_state_t *state = scamper_file_getstate(sf); scamper_addr_t *addr = NULL, **table; uint8_t *buf = NULL; size_t size; /* the data has to be at least 3 bytes long to be valid */ assert(hdr->len > 2); if((state->addr_count % WARTS_ADDR_TABLEGROW) == 0) { size = sizeof(scamper_addr_t *)*(state->addr_count+WARTS_ADDR_TABLEGROW); if((table = realloc(state->addr_table, size)) == NULL) { goto err; } state->addr_table = table; } /* read the address record from the file */ if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { if(addr_out != NULL) *addr_out = NULL; return 0; } /* * sanity check that the warts id recorded in the file matches what we * think it should be. */ if(state->addr_count % 255 != buf[0]) goto err; /* sanity check the type of address */ if(buf[1] == 0 || buf[1] > SCAMPER_ADDR_TYPE_MAX) goto err; /* allocate a scamper address using the record read from disk */ if((addr = scamper_addr_alloc(buf[1], buf+2)) == NULL) goto err; state->addr_table[state->addr_count++] = addr; free(buf); if(addr_out != NULL) *addr_out = addr; return 0; err: if(addr != NULL) scamper_addr_free(addr); if(buf != NULL) free(buf); return -1; } static int warts_list_cmp(const warts_list_t *wa, const warts_list_t *wb) { return scamper_list_cmp(wa->list, wb->list); } warts_list_t *warts_list_alloc(scamper_list_t *list, uint32_t id) { warts_list_t *wl; if((wl = malloc_zero(sizeof(warts_list_t))) != NULL) { wl->list = scamper_list_use(list); wl->id = id; } return wl; } void warts_list_free(warts_list_t *wl) { if(wl->list != NULL) scamper_list_free(wl->list); free(wl); return; } /* * warts_list_params * * put together an outline of the optional bits for a list structure, * including the flags structure that sits at the front, and the size (in * bytes) of the various parameters that will be optionally included in the * file. */ void warts_list_params(const scamper_list_t *list, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { const warts_var_t *var; int i, max_id = 0; /* unset all the flags */ memset(flags, 0, list_vars_mfb); *params_len = 0; for(i=0; iid == WARTS_LIST_DESCR && list->descr != NULL) { flag_set(flags, WARTS_LIST_DESCR, &max_id); *params_len += warts_str_size(list->descr); } else if(var->id == WARTS_LIST_MONITOR && list->monitor != NULL) { flag_set(flags, WARTS_LIST_MONITOR, &max_id); *params_len += warts_str_size(list->monitor); } } *flags_len = fold_flags(flags, max_id); return; } /* * warts_list_params_read * */ int warts_list_params_read(scamper_list_t *list, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&list->descr, (wpr_t)extract_string, NULL}, /* WARTS_LIST_DESCR */ {&list->monitor, (wpr_t)extract_string, NULL}, /* WARTS_LIST_MONITOR */ }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); return warts_params_read(buf, off, len, handlers, handler_cnt); } void warts_list_params_write(const scamper_list_t *list, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len) { warts_param_writer_t handlers[] = { {list->descr, (wpw_t)insert_string, NULL}, /* WARTS_LIST_DESCR */ {list->monitor, (wpw_t)insert_string, NULL}, /* WARTS_LIST_MONITOR */ }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, flags, flags_len, params_len, handlers, handler_cnt); return; } /* * warts_list_read * * each list record consists of * - a 4 byte id assigned to the list by warts * - a 4 byte list id assigned by a human * - the name of the list * - optional parameters (e.g. list description, monitor) */ int warts_list_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_list_t **list_out) { warts_state_t *state = scamper_file_getstate(sf); scamper_list_t *list = NULL; warts_list_t *wl = NULL, **table; uint8_t *buf = NULL; size_t size; uint32_t i = 0; uint32_t id; /* * must at least include the warts list id, the human-assigned list-id, * a name, and some amount of flags + parameters */ if(hdr->len < 4 + 4 + 2 + 1) { goto err; } if((state->list_count % WARTS_LIST_TABLEGROW) == 0) { size = sizeof(warts_list_t *)*(state->list_count + WARTS_LIST_TABLEGROW); if((table = realloc(state->list_table, size)) == NULL) { goto err; } state->list_table = table; } /* read the list record from the file */ if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { if(list_out != NULL) { *list_out = NULL; } return 0; } /* preallocate an empty list structure */ if((list = malloc_zero(sizeof(scamper_list_t))) == NULL) { goto err; } list->refcnt = 1; /* * sanity check that the warts id recorded in the file matches what we * think it should be. */ if(extract_uint32(buf, &i, hdr->len, &id, NULL) != 0 || id != state->list_count) { goto err; } /* get the list id (assigned by a human) and name */ if(extract_uint32(buf, &i, hdr->len, &list->id, NULL) != 0 || extract_string(buf, &i, hdr->len, &list->name, NULL) != 0) { goto err; } if(warts_list_params_read(list, buf, &i, hdr->len) != 0) { goto err; } if((wl = warts_list_alloc(list, state->list_count)) == NULL) { goto err; } state->list_table[state->list_count++] = wl; scamper_list_free(list); free(buf); if(list_out != NULL) { *list_out = list; } return 0; err: if(list != NULL) scamper_list_free(list); if(wl != NULL) warts_list_free(wl); if(buf != NULL) free(buf); return -1; } /* * warts_list_write * * take a list structure and write it to disk. update the state held, too */ int warts_list_write(const scamper_file_t *sf, scamper_list_t *list, uint32_t *id) { warts_state_t *state = scamper_file_getstate(sf); warts_list_t *wl = NULL; uint8_t *buf = NULL; uint8_t flags[list_vars_mfb]; uint32_t off = 0, len; uint16_t name_len, flags_len, params_len; /* we require a list name */ if(list->name == NULL) { goto err; } /* allocate a warts wrapping structure for the list */ if((wl = warts_list_alloc(list, state->list_count)) == NULL) { goto err; } /* figure out how large the record will be */ name_len = strlen(list->name) + 1; warts_list_params(list, flags, &flags_len, ¶ms_len); len = 8 + 4 + 4 + name_len + flags_len + params_len; if(params_len != 0) len += 2; /* allocate the record */ if((buf = malloc_zero(len)) == NULL) { goto err; } insert_wartshdr(buf, &off, len, SCAMPER_FILE_OBJ_LIST); /* list id assigned by warts */ insert_uint32(buf, &off, len, &wl->id, NULL); /* list id assigned by a person */ insert_uint32(buf, &off, len, &list->id, NULL); /* list name */ insert_bytes_uint16(buf, &off, len, list->name, &name_len); /* copy in the flags for any parameters */ warts_list_params_write(list, buf, &off, len, flags, flags_len, params_len); assert(off == len); if(splaytree_insert(state->list_tree, wl) == NULL) { goto err; } /* write the list record to disk */ if(warts_write(sf, buf, len) == -1) { goto err; } state->list_count++; *id = wl->id; free(buf); return 0; err: if(wl != NULL) { splaytree_remove_item(state->list_tree, wl); warts_list_free(wl); } if(buf != NULL) free(buf); return -1; } /* * warts_list_getid * * given a scamper_list structure, return the id to use internally to * uniquely identify it. allocate the id if necessary. */ int warts_list_getid(const scamper_file_t *sf, scamper_list_t *list, uint32_t *id) { warts_state_t *state = scamper_file_getstate(sf); warts_list_t findme, *wl; if(list == NULL) { *id = 0; return 0; } /* see if there is a tree entry for this list */ findme.list = list; if((wl = splaytree_find(state->list_tree, &findme)) != NULL) { *id = wl->id; return 0; } /* no tree entry, so write it to a file and return the assigned id */ if(warts_list_write(sf, list, id) == 0) { return 0; } return -1; } static int warts_cycle_cmp(const warts_cycle_t *a, const warts_cycle_t *b) { return scamper_cycle_cmp(a->cycle, b->cycle); } warts_cycle_t *warts_cycle_alloc(scamper_cycle_t *cycle, uint32_t id) { warts_cycle_t *wc; if((wc = malloc_zero(sizeof(warts_cycle_t))) != NULL) { wc->cycle = scamper_cycle_use(cycle); wc->id = id; } return wc; } void warts_cycle_free(warts_cycle_t *cycle) { if(cycle->cycle != NULL) scamper_cycle_free(cycle->cycle); free(cycle); return; } void warts_cycle_params(const scamper_cycle_t *cycle, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { const warts_var_t *var; int i, max_id = 0; /* unset all the flags, reset max_id */ memset(flags, 0, cycle_vars_mfb); *params_len = 0; for(i=0; iid == WARTS_CYCLE_HOSTNAME && cycle->hostname != NULL) { flag_set(flags, WARTS_CYCLE_HOSTNAME, &max_id); *params_len += warts_str_size(cycle->hostname); } else if(var->id == WARTS_CYCLE_STOP_TIME && cycle->stop_time != 0) { flag_set(flags, WARTS_CYCLE_STOP_TIME, &max_id); *params_len += 4; } } *flags_len = fold_flags(flags, max_id); return; } void warts_cycle_params_write(const scamper_cycle_t *cycle, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len) { warts_param_writer_t handlers[] = { {&cycle->stop_time, (wpw_t)insert_uint32, NULL}, {cycle->hostname, (wpw_t)insert_string, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, flags, flags_len, params_len, handlers, handler_cnt); return; } int warts_cycle_params_read(scamper_cycle_t *cycle, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&cycle->stop_time, (wpr_t)extract_uint32, NULL}, {&cycle->hostname, (wpr_t)extract_string, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); return warts_params_read(buf, off, len, handlers, handler_cnt); } /* * warts_cycle_read * * 4 byte cycle id (assigned by warts from counter) * 4 byte list id (assigned by warts) * 4 byte cycle id (assigned by human) * 4 byte time since the epoch, representing start time of the cycle * 1 byte flags (followed by optional data items) */ int warts_cycle_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_cycle_t **cycle_out) { warts_state_t *state = scamper_file_getstate(sf); scamper_cycle_t *cycle = NULL; warts_cycle_t *wc = NULL, **table; size_t size; uint8_t *buf = NULL; uint32_t id; uint32_t off = 0; /* ensure the cycle_start object is large enough to be valid */ if(hdr->len < 4 + 4 + 4 + 4 + 1) { goto err; } if((state->cycle_count % WARTS_CYCLE_TABLEGROW) == 0) { size = sizeof(warts_list_t *)*(state->cycle_count+WARTS_CYCLE_TABLEGROW); if((table = realloc(state->cycle_table, size)) == NULL) { goto err; } state->cycle_table = table; } /* read the cycle_start structure out of the file */ if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { if(cycle_out != NULL) { *cycle_out = NULL; } return 0; } /* * sanity check that the warts id recorded in the file matches what we * think it should be. */ if(extract_uint32(buf, &off, hdr->len, &id, NULL) != 0 || id != state->cycle_count) { goto err; } /* the _warts_ list id for the cycle */ if(extract_uint32(buf, &off, hdr->len, &id, NULL) != 0 || id >= state->list_count) { goto err; } if((cycle = scamper_cycle_alloc(state->list_table[id]->list)) == NULL) { goto err; } /* * the second 4 bytes is the actual cycle id assigned by a human. * the third 4 bytes is seconds since the epoch. */ if(extract_uint32(buf, &off, hdr->len, &cycle->id, NULL) != 0 || extract_uint32(buf, &off, hdr->len, &cycle->start_time, NULL) != 0) { goto err; } if(warts_cycle_params_read(cycle, buf, &off, hdr->len) != 0) { goto err; } if((wc = warts_cycle_alloc(cycle, state->cycle_count)) == NULL) { goto err; } state->cycle_table[state->cycle_count++] = wc; scamper_cycle_free(cycle); free(buf); if(cycle_out != NULL) { *cycle_out = cycle; } return 0; err: if(cycle != NULL) { if(cycle->list != NULL) scamper_list_free(cycle->list); free(cycle); } if(buf != NULL) free(buf); return -1; } /* * warts_cycle_write * * write out a cycle record. depending on whether the type is a start point, * or a cycle definition, some * * 4 byte cycle id (assigned by warts from counter) * 4 byte list id (assigned by warts) * 4 byte cycle id (assigned by human) * 4 byte time since the epoch, representing start time of the cycle * 1 byte flags (followed by optional data items) */ int warts_cycle_write(const scamper_file_t *sf, scamper_cycle_t *cycle, const int type, uint32_t *id) { warts_state_t *state = scamper_file_getstate(sf); warts_cycle_t *wc = NULL; uint32_t warts_list_id; uint8_t *buf = NULL; uint8_t flags[cycle_vars_mfb]; uint16_t flags_len, params_len; uint32_t off = 0, len; /* find the list associated w/ the cycle, as we require the warts list id */ if(warts_list_getid(sf, cycle->list, &warts_list_id) == -1) { goto err; } /* allocate warts_cycle wrapping struct to associate a warts-assigned id */ if((wc = warts_cycle_alloc(cycle, state->cycle_count)) == NULL) { goto err; } /* figure out the shape the optional parameters will take */ warts_cycle_params(cycle, flags, &flags_len, ¶ms_len); /* allocate a temporary buf for recording the cycle */ len = 8 + 4 + 4 + 4 + 4 + flags_len + params_len; if(params_len != 0) len += 2; if((buf = malloc_zero(len)) == NULL) { goto err; } /* insert the warts header */ insert_wartshdr(buf, &off, len, type); /* cycle and list ids, assigned by warts from counters */ insert_uint32(buf, &off, len, &wc->id, NULL); insert_uint32(buf, &off, len, &warts_list_id, NULL); /* human cycle id, timestamp */ insert_uint32(buf, &off, len, &cycle->id, NULL); insert_uint32(buf, &off, len, &cycle->start_time, NULL); /* copy in the optionally-included parameters */ warts_cycle_params_write(cycle, buf,&off,len, flags, flags_len, params_len); assert(off == len); if(splaytree_insert(state->cycle_tree, wc) == NULL) { goto err; } if(warts_write(sf, buf, len) == -1) { goto err; } if(id != NULL) *id = wc->id; state->cycle_count++; free(buf); return 0; err: if(wc != NULL) { splaytree_remove_item(state->cycle_tree, wc); warts_cycle_free(wc); } if(buf != NULL) free(buf); return -1; } /* * warts_cycle_stop_read * * a cycle_stop record consists of the cycle id (assigned by warts from a * counter), a timestamp, and some optional parameters. */ int warts_cycle_stop_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_cycle_t **cycle_out) { warts_state_t *state = scamper_file_getstate(sf); scamper_cycle_t *cycle; uint32_t off = 0; uint32_t id; uint8_t *buf = NULL; if(hdr->len < 4 + 4 + 1) { goto err; } if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { if(cycle_out != NULL) { *cycle_out = NULL; } return 0; } /* * get an index into the stored cycles. * * if the id does not make sense (is larger than any cycle currently * defined, or is the null cycle entry, or there is no current cycle * for this id) then we have a problem... */ if(extract_uint32(buf, &off, hdr->len, &id, NULL) != 0 || id >= state->cycle_count || id == 0 || state->cycle_table[id] == NULL) { goto err; } /* embed the stop timestamp with the cycle object */ cycle = state->cycle_table[id]->cycle; if(extract_uint32(buf, &off, hdr->len, &cycle->stop_time, NULL) != 0) { goto err; } /* * if the caller wants the cycle record, then get a reference to it. * don't need the cycle in the array any longer, though. */ if(cycle_out != NULL) { *cycle_out = scamper_cycle_use(cycle); } warts_cycle_free(state->cycle_table[id]); state->cycle_table[id] = NULL; free(buf); return 0; err: if(buf != NULL) free(buf); return -1; } int warts_cycle_getid(const scamper_file_t *sf, scamper_cycle_t *cycle, uint32_t *id) { warts_state_t *state = scamper_file_getstate(sf); warts_cycle_t findme, *wc; /* if no cycle is specified, we use the special value zero */ if(cycle == NULL) { *id = 0; return 0; } /* see if there is an entry for this cycle */ findme.cycle = cycle; if((wc = splaytree_find(state->cycle_tree, &findme)) != NULL) { *id = wc->id; return 0; } if(warts_cycle_write(sf, cycle, SCAMPER_FILE_OBJ_CYCLE_DEF, id) == 0) { return 0; } return -1; } /* * warts_cycle_stop_write * * this function writes a record denoting the end of the cycle pointed to * by the cycle parameter. * it writes * the 4 byte cycle id assigned by warts * the 4 byte stop time * where applicable, additional parameters */ int warts_cycle_stop_write(const scamper_file_t *sf, scamper_cycle_t *cycle) { uint32_t wc_id; uint8_t *buf = NULL; uint32_t off = 0, len; uint8_t flag = 0; assert(cycle != NULL); if(warts_cycle_getid(sf, cycle, &wc_id) != 0) { goto err; } len = 8 + 4 + 4 + 1; if((buf = malloc_zero(len)) == NULL) { goto err; } insert_wartshdr(buf, &off, len, SCAMPER_FILE_OBJ_CYCLE_STOP); insert_uint32(buf, &off, len, &wc_id, NULL); insert_uint32(buf, &off, len, &cycle->stop_time, NULL); insert_byte(buf, &off, len, &flag, NULL); assert(off == len); if(warts_write(sf, buf, len) == -1) { goto err; } free(buf); return 0; err: if(buf != NULL) free(buf); return -1; } int warts_icmpext_read(const uint8_t *buf, uint32_t *off, uint32_t len, scamper_icmpext_t **exts) { scamper_icmpext_t *ie, *next = NULL; uint16_t tmp; uint16_t u16; uint8_t cn, ct; /* make sure there's enough left for the length field */ if(len - *off < 2) { return -1; } /* extract the length field that says how much data is left past it */ memcpy(&tmp, &buf[*off], 2); tmp = ntohs(tmp); *off += 2; /* the length value must be greater than zero */ if(tmp == 0) return -1; /* make sure there's enough left for the extension data */ if(len - *off < tmp) return -1; while(tmp >= 4) { memcpy(&u16, &buf[*off], 2); u16 = ntohs(u16); if(len - *off < (uint32_t)(u16 + 2 + 1 + 1)) { return -1; } cn = buf[*off+2]; ct = buf[*off+3]; if((ie = scamper_icmpext_alloc(cn, ct, u16, &buf[*off+4])) == NULL) { return -1; } if(next == NULL) { *exts = ie; } else { next->ie_next = ie; } next = ie; *off += (2 + 1 + 1 + u16); tmp -= (2 + 1 + 1 + u16); } if(tmp != 0) return -1; return 0; } void warts_icmpext_write(uint8_t *buf,uint32_t *off,const uint32_t len, const scamper_icmpext_t *exts) { const scamper_icmpext_t *ie; uint16_t tmp = 0; uint16_t u16; for(ie=exts; ie != NULL; ie = ie->ie_next) { assert(*off + tmp + 1 + 1 + 2 + ie->ie_dl <= len); /* convert the data length field to network byte order and write */ u16 = htons(ie->ie_dl); memcpy(&buf[*off + 2 + tmp], &u16, 2); tmp += 2; /* write the class num/type fields */ buf[*off + 2 + tmp] = ie->ie_cn; tmp++; buf[*off + 2 + tmp] = ie->ie_ct; tmp++; /* write any data */ if(ie->ie_dl != 0) { memcpy(&buf[*off + 2 + tmp], ie->ie_data, ie->ie_dl); tmp += ie->ie_dl; } } /* write, at the start of the data, the length of the icmp extension data */ u16 = htons(tmp); memcpy(&buf[*off], &u16, 2); *off = *off + 2 + tmp; return; } /* * scamper_file_warts_read * */ int scamper_file_warts_read(scamper_file_t *sf, scamper_file_filter_t *filter, uint16_t *type, void **data) { static const warts_obj_read_t objread[] = { NULL, (warts_obj_read_t)warts_list_read, (warts_obj_read_t)warts_cycle_read, (warts_obj_read_t)warts_cycle_read, (warts_obj_read_t)warts_cycle_stop_read, (warts_obj_read_t)warts_addr_read, (warts_obj_read_t)scamper_file_warts_trace_read, (warts_obj_read_t)scamper_file_warts_ping_read, (warts_obj_read_t)scamper_file_warts_tracelb_read, (warts_obj_read_t)scamper_file_warts_dealias_read, (warts_obj_read_t)scamper_file_warts_neighbourdisc_read, (warts_obj_read_t)scamper_file_warts_tbit_read, (warts_obj_read_t)scamper_file_warts_sting_read, (warts_obj_read_t)scamper_file_warts_sniff_read, }; warts_state_t *state = scamper_file_getstate(sf); warts_hdr_t hdr; int isfilter; int tmp; uint8_t *buf; void *ptr; char offs[16]; for(;;) { /* * check to see if the previous read got a warts header but not * the payload */ if(state->hdr.type == 0) { /* read the header for the next record from the file */ if((tmp = warts_hdr_read(sf, &hdr)) == 0) { *data = NULL; return 0; } /* if the header does not pass a basic sanity check, then give up */ if(tmp == -1 || hdr.magic != WARTS_MAGIC || hdr.type == 0) goto err; } else { hdr = state->hdr; } /* * does the caller want to know about this type? * if they do, tell them what type of object (might be) returned. */ if((isfilter = scamper_file_filter_isset(filter, hdr.type)) == 1) *type = hdr.type; *data = NULL; if(hdr.type == SCAMPER_FILE_OBJ_ADDR || hdr.type == SCAMPER_FILE_OBJ_LIST || hdr.type == SCAMPER_FILE_OBJ_CYCLE_DEF || hdr.type == SCAMPER_FILE_OBJ_CYCLE_START || hdr.type == SCAMPER_FILE_OBJ_CYCLE_STOP) { if(objread[hdr.type](sf, &hdr, &ptr) != 0) goto err; if(ptr == NULL) { /* partial read. return for now */ state->hdr = hdr; return 0; } memset(&state->hdr, 0, sizeof(state->hdr)); if(isfilter != 0) { switch(hdr.type) { case SCAMPER_FILE_OBJ_ADDR: *data = scamper_addr_use((scamper_addr_t *)ptr); break; case SCAMPER_FILE_OBJ_LIST: *data = scamper_list_use((scamper_list_t *)ptr); break; case SCAMPER_FILE_OBJ_CYCLE_DEF: case SCAMPER_FILE_OBJ_CYCLE_START: *data = scamper_cycle_use((scamper_cycle_t *)ptr); break; case SCAMPER_FILE_OBJ_CYCLE_STOP: *data = ptr; break; } return 0; } if(hdr.type == SCAMPER_FILE_OBJ_CYCLE_STOP) scamper_cycle_free((scamper_cycle_t *)ptr); } else if(isfilter == 0) { /* reader doesn't care what the data is, and neither do we */ buf = NULL; if(warts_read(sf, &buf, hdr.len) != 0) goto err; if(buf == NULL) { /* partial read. return for now */ state->hdr = hdr; return 0; } free(buf); memset(&state->hdr, 0, sizeof(state->hdr)); } else { if(hdr.type >= sizeof(objread)/sizeof(warts_obj_read_t) || objread[hdr.type] == NULL || objread[hdr.type](sf, &hdr, data) != 0) goto err; if(*data != NULL) memset(&state->hdr, 0, sizeof(state->hdr)); else state->hdr = hdr; break; } } return 0; err: fprintf(stderr, "off 0x%s magic 0x%04x type 0x%04x len 0x%08x\n", offt_tostr(offs, sizeof(offs), state->off - hdr.len, 8, 'x'), hdr.magic, hdr.type, hdr.len); return -1; } int scamper_file_warts_cyclestart_write(const scamper_file_t *sf, scamper_cycle_t *c) { return warts_cycle_write(sf, c, SCAMPER_FILE_OBJ_CYCLE_START, NULL); } int scamper_file_warts_cyclestop_write(const scamper_file_t *sf, scamper_cycle_t *c) { return warts_cycle_stop_write(sf, c); } /* * scamper_file_warts_init_read * * initialise the scamper_file_t's state structure so that it is all set * for reading. the first entry of the list and cycle tables is pre-set * to be null for data objects that don't have associated list/cycle * objects. */ int scamper_file_warts_init_read(scamper_file_t *sf) { warts_state_t *state; size_t size; if((state = (warts_state_t *)malloc_zero(sizeof(warts_state_t))) == NULL) { goto err; } size = sizeof(scamper_addr_t *) * WARTS_ADDR_TABLEGROW; if((state->addr_table = malloc_zero(size)) == NULL) { goto err; } state->addr_table[0] = NULL; state->addr_count = 1; size = sizeof(warts_list_t *) * WARTS_LIST_TABLEGROW; if((state->list_table = malloc_zero(size)) == NULL) { goto err; } state->list_table[0] = &state->list_null; state->list_count = 1; size = sizeof(warts_cycle_t *) * WARTS_CYCLE_TABLEGROW; if((state->cycle_table = malloc_zero(size)) == NULL) { goto err; } state->cycle_table[0] = &state->cycle_null; state->cycle_count = 1; scamper_file_setstate(sf, state); return 0; err: if(state != NULL) { if(state->addr_table != NULL) free(state->addr_table); if(state->list_table != NULL) free(state->list_table); if(state->cycle_table != NULL) free(state->cycle_table); free(state); } return -1; } /* * scamper_file_warts_init_write * * get the scamper_file_t object ready to write warts objects and keep state */ int scamper_file_warts_init_write(scamper_file_t *sf) { warts_state_t *s = NULL; int fd = scamper_file_getfd(sf); struct stat sb; if((s = (warts_state_t *)malloc_zero(sizeof(warts_state_t))) == NULL) goto err; if(fd != -1) { if(fstat(fd, &sb) != 0) goto err; if(S_ISREG(sb.st_mode)) s->isreg = 1; } if((s->list_tree=splaytree_alloc((splaytree_cmp_t)warts_list_cmp)) == NULL) goto err; s->list_count = 1; if((s->cycle_tree=splaytree_alloc((splaytree_cmp_t)warts_cycle_cmp)) == NULL) goto err; s->cycle_count = 1; scamper_file_setstate(sf, s); return 0; err: if(s != NULL) { if(s->list_tree != NULL) splaytree_free(s->list_tree, NULL); if(s->cycle_tree != NULL) splaytree_free(s->cycle_tree, NULL); free(s); } return -1; } /* * scamper_file_warts_init_append * * go through the file and form the address, list, and cycle dictionaries */ int scamper_file_warts_init_append(scamper_file_t *sf) { warts_state_t *s; warts_hdr_t hdr; int i, fd; uint32_t j; scamper_addr_t *addr; scamper_list_t *list; scamper_cycle_t *cycle; /* init the warts structures as if we were reading the file */ if(scamper_file_warts_init_read(sf) == -1) { return -1; } fd = scamper_file_getfd(sf); for(;;) { /* read the header for the next record from the file */ if((i = warts_hdr_read(sf, &hdr)) == 0) { /* EOF */ break; } else if(i == -1) { /* partial record */ return -1; } if(hdr.magic != WARTS_MAGIC || hdr.type == 0) { return -1; } switch(hdr.type) { case SCAMPER_FILE_OBJ_ADDR: if(warts_addr_read(sf, &hdr, &addr) != 0 || addr == NULL) return -1; break; case SCAMPER_FILE_OBJ_LIST: if(warts_list_read(sf, &hdr, &list) != 0 || list == NULL) return -1; break; case SCAMPER_FILE_OBJ_CYCLE_START: case SCAMPER_FILE_OBJ_CYCLE_DEF: if(warts_cycle_read(sf, &hdr, &cycle) != 0 || cycle == NULL) return -1; break; case SCAMPER_FILE_OBJ_CYCLE_STOP: if(warts_cycle_stop_read(sf, &hdr, &cycle) != 0 || cycle == NULL) return -1; scamper_cycle_free(cycle); break; default: if(lseek(fd, hdr.len, SEEK_CUR) == -1) { return -1; } break; } } /* get the state structure created in init_read */ s = scamper_file_getstate(sf); /* * all the lists are in a table. put them into a splay tree so we can * find them quickly, and then trash the list table */ if((s->list_tree = splaytree_alloc((splaytree_cmp_t)warts_list_cmp)) == NULL) return -1; for(j=1; jlist_count; j++) if(splaytree_insert(s->list_tree, s->list_table[j]) == NULL) return -1; free(s->list_table); s->list_table = NULL; if((s->cycle_tree=splaytree_alloc((splaytree_cmp_t)warts_cycle_cmp)) == NULL) return -1; for(j=1; jcycle_count; j++) { /* don't install finished cycles into the splaytree */ if(s->cycle_table[j] == NULL) continue; if(splaytree_insert(s->cycle_tree, s->cycle_table[j]) == NULL) return -1; } free(s->cycle_table); s->cycle_table = NULL; return 0; } int scamper_file_warts_is(const scamper_file_t *sf) { uint16_t magic16; int fd = scamper_file_getfd(sf); if(lseek(fd, 0, SEEK_SET) == -1) { return 0; } if(read_wrap(fd, &magic16, NULL, sizeof(magic16)) != 0) { return 0; } if(ntohs(magic16) == WARTS_MAGIC) { if(lseek(fd, 0, SEEK_SET) == -1) { return 0; } return 1; } return 0; } static void warts_free_state(splaytree_t *tree, void **table, unsigned int count, splaytree_free_t free_cb) { unsigned int i; if(table != NULL) { for(i=1; ireadbuf != NULL) { free(state->readbuf); } warts_free_state(state->list_tree, (void **)state->list_table, state->list_count, (splaytree_free_t)warts_list_free); warts_free_state(state->cycle_tree, (void **)state->cycle_table, state->cycle_count, (splaytree_free_t)warts_cycle_free); if(state->addr_table != NULL) { for(i=1; iaddr_count; i++) if(state->addr_table[i] != NULL) scamper_addr_free(state->addr_table[i]); free(state->addr_table); } free(state); return; } scamper-cvs-20171204/scamper/scamper_file_warts.h000644 001751 000000 00000025576 12736164223 021614 0ustar00mjlwheel000000 000000 /* * scamper_file_warts.h * * the warts file format * * $Id: scamper_file_warts.h,v 1.25 2016/07/03 10:27:31 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_FILE_WARTS_H #define __SCAMPER_FILE_WARTS_H #include "mjl_splaytree.h" #include "scamper_icmpext.h" /* * warts_var * * warts often stores optional items of data with each object. it does * this by declaring an array of bits that declare which optional bits of * data will be stored. the warts_var structure is a convenient way of * encouraging the code for each object to be consistent. * * the id field corresponds to a bit * the size field records how large the field is stored on disk; -1 is variable * the tlv_id field records the id for a scamper_tlv_t if the data item is * stored optionally in the data structure itself. */ typedef struct warts_var { int id; ssize_t size; int tlv_id; } warts_var_t; #define WARTS_VAR_COUNT(array) (sizeof(array)/sizeof(warts_var_t)) #define WARTS_VAR_MFB(array) ((WARTS_VAR_COUNT(array) / 7) + \ (WARTS_VAR_COUNT(array) % 7 == 0 ? 0 : 1)) /* * warts_list / warts_cycle * * these structures associate a scamper structure with an id number used * to represent the structure on disk. */ typedef struct warts_list { scamper_list_t *list; uint32_t id; } warts_list_t; typedef struct warts_cycle { scamper_cycle_t *cycle; uint32_t id; } warts_cycle_t; /* * warts_addr, warts_addrtable * * keep track of addresses being written to disk. */ typedef struct warts_addr { scamper_addr_t *addr; uint32_t id; uint8_t ondisk; } warts_addr_t; typedef struct warts_addrtable warts_addrtable_t; /* * warts_hdr * * this object is written at the start of every object. * the magic field is a special integer value that signifies a new warts * record. * the type field says what type of record follows. * the length field reports the length of the following record. */ typedef struct warts_hdr { uint16_t magic; uint16_t type; uint32_t len; } warts_hdr_t; /* * warts_state * * warts keeps state of lists, cycles, and addresses declared in a warts * file. each resource is stored either in a tree (for fast searching) or * a table (for fast indexing). when a file is open for writing, the tree * is used. when a file is open for reading, the table is used. each null * entry is used for the first ([0]) entry in the corresponding table. */ typedef struct warts_state { int isreg; off_t off; /* temporary buffer for leftover partial reads */ uint8_t *readbuf; size_t readlen; size_t readbuf_len; /* * if a partial read was done on the last loop through but whatever * warts object was there was not completely read, then keep track of it */ warts_hdr_t hdr; /* list state */ uint32_t list_count; splaytree_t *list_tree; warts_list_t **list_table; warts_list_t list_null; /* cycle state */ uint32_t cycle_count; splaytree_t *cycle_tree; warts_cycle_t **cycle_table; warts_cycle_t cycle_null; /* address state */ uint32_t addr_count; scamper_addr_t **addr_table; } warts_state_t; typedef int (*wpr_t)(const uint8_t *,uint32_t *,const uint32_t,void *, void *); typedef void (*wpw_t)(uint8_t *,uint32_t *,const uint32_t,const void *,void *); typedef struct warts_param_reader { void *data; wpr_t read; void *param; } warts_param_reader_t; typedef struct warts_param_writer { const void *data; wpw_t write; void *param; } warts_param_writer_t; void flag_ij(const int id, int *i, int *j); void flag_set(uint8_t *flags, const int id, int *max_id); int flag_isset(const uint8_t *flags, const int id); uint16_t fold_flags(uint8_t *flags, const int max_id); int warts_str_size(const char *str); warts_addrtable_t *warts_addrtable_alloc_byaddr(void); warts_addrtable_t *warts_addrtable_alloc_byid(void); uint32_t warts_addr_size(warts_addrtable_t *t, scamper_addr_t *addr); void warts_addrtable_free(warts_addrtable_t *t); void insert_addr(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_addr_t *addr, void *param); void insert_uint16(uint8_t *buf, uint32_t *off, const uint32_t len, const uint16_t *in, void *param); void insert_uint32(uint8_t *buf, uint32_t *off, const uint32_t len, const uint32_t *in, void *param); void insert_int32(uint8_t *buf, uint32_t *off, const uint32_t len, const int32_t *in, void *param); void insert_wartshdr(uint8_t *buf, uint32_t *off, uint32_t len, uint16_t hdr_type); void insert_byte(uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *in, void *param); void insert_bytes_uint16(uint8_t *buf,uint32_t *off,const uint32_t len, const void *vin, uint16_t *count); void insert_string(uint8_t *buf, uint32_t *off, const uint32_t len, const char *in, void *param); void insert_timeval(uint8_t *buf, uint32_t *off, const uint32_t len, const struct timeval *in, void *param); void insert_rtt(uint8_t *buf, uint32_t *off, const uint32_t len, const struct timeval *tv, void *param); int extract_addr(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_addr_t **out, void *param); int extract_string(const uint8_t *buf, uint32_t *off, const uint32_t len, char **out, void *param); int extract_uint16(const uint8_t *buf, uint32_t *off, const uint32_t len, uint16_t *out, void *param); int extract_uint32(const uint8_t *buf, uint32_t *off, const uint32_t len, uint32_t *out, void *param); int extract_int32(const uint8_t *buf, uint32_t *off, const uint32_t len, int32_t *out, void *param); int extract_byte(const uint8_t *buf, uint32_t *off, const uint32_t len, uint8_t *out, void *param); int extract_bytes_ptr(const uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t **out, uint16_t *req); int extract_bytes_alloc(const uint8_t *buf, uint32_t *off, const uint32_t len, uint8_t **out, uint16_t *req); int extract_bytes(const uint8_t *buf, uint32_t *off, const uint32_t len, uint8_t *out, uint16_t *req); int extract_addr_gid(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_addr_t **addr, warts_state_t *state); int extract_list(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_list_t **list, warts_state_t *state); int extract_cycle(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_cycle_t **cycle, warts_state_t *state); int extract_timeval(const uint8_t *buf, uint32_t *off, const uint32_t len, struct timeval *tv, void *param); int extract_rtt(const uint8_t *buf, uint32_t *off, const uint32_t len, struct timeval *tv, void *param); int warts_params_read(const uint8_t *buf, uint32_t *off, uint32_t len, warts_param_reader_t *handlers, int handler_cnt); void warts_params_write(uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len, const warts_param_writer_t *handlers, const int handler_cnt); int warts_read(scamper_file_t *sf, uint8_t **buf, size_t len); int warts_write(const scamper_file_t *sf, const void *buf, size_t len); int warts_hdr_read(scamper_file_t *sf, warts_hdr_t *hdr); int warts_addr_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_addr_t **addr_out); warts_list_t *warts_list_alloc(scamper_list_t *list, uint32_t id); void warts_list_free(warts_list_t *wl); void warts_list_params(const scamper_list_t *list, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len); int warts_list_params_read(scamper_list_t *list, uint8_t *buf, uint32_t *off, uint32_t len); void warts_list_params_write(const scamper_list_t *list, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len); int warts_list_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_list_t **list_out); int warts_list_write(const scamper_file_t *sf, scamper_list_t *list, uint32_t *id); int warts_list_getid(const scamper_file_t *sf, scamper_list_t *list, uint32_t *id); warts_cycle_t *warts_cycle_alloc(scamper_cycle_t *cycle, uint32_t id); void warts_cycle_free(warts_cycle_t *cycle); void warts_cycle_params(const scamper_cycle_t *cycle, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len); void warts_cycle_params_write(const scamper_cycle_t *cycle, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len); int warts_cycle_params_read(scamper_cycle_t *cycle, uint8_t *buf, uint32_t *off, uint32_t len); int warts_cycle_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_cycle_t **cycle_out); int warts_cycle_write(const scamper_file_t *sf, scamper_cycle_t *cycle, const int type, uint32_t *id); int warts_cycle_stop_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_cycle_t **cycle_out); int warts_cycle_getid(const scamper_file_t *sf, scamper_cycle_t *cycle, uint32_t *id); int warts_cycle_stop_write(const scamper_file_t *sf, scamper_cycle_t *cycle); int warts_icmpext_read(const uint8_t *buf, uint32_t *off, uint32_t len, scamper_icmpext_t **exts); void warts_icmpext_write(uint8_t *buf,uint32_t *off,const uint32_t len, const scamper_icmpext_t *exts); int scamper_file_warts_read(scamper_file_t *sf, scamper_file_filter_t *filter, uint16_t *type, void **data); int scamper_file_warts_cyclestart_write(const scamper_file_t *sf, scamper_cycle_t *c); int scamper_file_warts_cyclestop_write(const scamper_file_t *sf, scamper_cycle_t *c); int scamper_file_warts_is(const scamper_file_t *file); int scamper_file_warts_init_append(scamper_file_t *file); int scamper_file_warts_init_read(scamper_file_t *file); int scamper_file_warts_init_write(scamper_file_t *file); void scamper_file_warts_free_state(scamper_file_t *file); #endif /* __SCAMPER_FILE_WARTS_H */ scamper-cvs-20171204/scamper/scamper_firewall.c000644 001751 000000 00000066615 13210743403 021243 0ustar00mjlwheel000000 000000 /* * scamper_firewall.c * * $Id: scamper_firewall.c,v 1.53 2017/12/03 09:42:27 mjl Exp $ * * Copyright (C) 2008-2011 The University of Waikato * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_firewall.c,v 1.53 2017/12/03 09:42:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #ifdef HAVE_NETINET_IP_FW_H #include #ifdef HAVE_NETINET6_IP_FW_H #include #endif #endif #ifdef HAVE_NET_PFVAR_H #include #endif #include "scamper_addr.h" #include "scamper_debug.h" #include "scamper_firewall.h" #include "scamper_privsep.h" #include "scamper_osinfo.h" #include "mjl_heap.h" #include "mjl_splaytree.h" #include "utils.h" #if defined(HAVE_IPFW) || defined(HAVE_PF) struct scamper_firewall_entry { int slot; int refcnt; splaytree_node_t *node; scamper_firewall_rule_t *rule; }; static splaytree_t *entries = NULL; static heap_t *freeslots = NULL; static int firewall_rule_cmp(const scamper_firewall_rule_t *a, const scamper_firewall_rule_t *b) { int i; assert(a->type == SCAMPER_FIREWALL_RULE_TYPE_5TUPLE); assert(b->type == SCAMPER_FIREWALL_RULE_TYPE_5TUPLE); if(a->type < b->type) return -1; if(a->type > b->type) return 1; if(a->type == SCAMPER_FIREWALL_RULE_TYPE_5TUPLE) { if(a->sfw_5tuple_proto < b->sfw_5tuple_proto) return -1; if(a->sfw_5tuple_proto > b->sfw_5tuple_proto) return 1; if(a->sfw_5tuple_sport < b->sfw_5tuple_sport) return -1; if(a->sfw_5tuple_sport > b->sfw_5tuple_sport) return 1; if(a->sfw_5tuple_dport < b->sfw_5tuple_dport) return -1; if(a->sfw_5tuple_dport > b->sfw_5tuple_dport) return 1; if((i = scamper_addr_cmp(a->sfw_5tuple_src, b->sfw_5tuple_src)) != 0) return i; if(a->sfw_5tuple_dst == NULL && b->sfw_5tuple_dst == NULL) return 0; if(a->sfw_5tuple_dst != NULL && b->sfw_5tuple_dst == NULL) return -1; if(a->sfw_5tuple_dst == NULL && b->sfw_5tuple_dst != NULL) return 1; return scamper_addr_cmp(a->sfw_5tuple_dst, b->sfw_5tuple_dst); } return 0; } static void firewall_rule_free(scamper_firewall_rule_t *sfw) { if(sfw == NULL) return; if(sfw->sfw_5tuple_src != NULL) scamper_addr_free(sfw->sfw_5tuple_src); if(sfw->sfw_5tuple_dst != NULL) scamper_addr_free(sfw->sfw_5tuple_dst); free(sfw); return; } static scamper_firewall_rule_t *firewall_rule_dup(scamper_firewall_rule_t *sfw) { scamper_firewall_rule_t *dup; if((dup = memdup(sfw, sizeof(scamper_firewall_rule_t))) == NULL) return NULL; scamper_addr_use(dup->sfw_5tuple_src); if(dup->sfw_5tuple_dst != NULL) scamper_addr_use(dup->sfw_5tuple_dst); return dup; } static int firewall_entry_cmp(const scamper_firewall_entry_t *a, const scamper_firewall_entry_t *b) { return firewall_rule_cmp(a->rule, b->rule); } /* * firewall_entry_slot_cmp * * provide ordering for the freeslots heap by returning the earliest available * slot number in a range */ static int firewall_entry_slot_cmp(const scamper_firewall_entry_t *a, const scamper_firewall_entry_t *b) { if(a->slot > b->slot) return -1; if(a->slot < b->slot) return 1; return 0; } /* * firewall_entry_free * */ static void firewall_entry_free(scamper_firewall_entry_t *entry) { if(entry->node != NULL) splaytree_remove_node(entries, entry->node); firewall_rule_free(entry->rule); free(entry); return; } static int firewall_freeslots_alloc(long start, long end) { scamper_firewall_entry_t *entry; long i; if((freeslots = heap_alloc((heap_cmp_t)firewall_entry_slot_cmp)) == NULL) { printerror(__func__, "could not create freeslots heap"); return -1; } for(i=start; i<=end; i++) { if((entry = malloc_zero(sizeof(scamper_firewall_entry_t))) == NULL) { printerror(__func__, "could not alloc entry %d", i); return -1; } entry->slot = i; if(heap_insert(freeslots, entry) == NULL) { printerror(__func__, "could not add entry %d", i); return -1; } } return 0; } static int firewall_entries_alloc(void) { if((entries = splaytree_alloc((splaytree_cmp_t)firewall_entry_cmp)) == NULL) { printerror(__func__, "could not create entries tree"); return -1; } return 0; } #endif /* HAVE_IPFW || HAVE_PF */ #ifdef HAVE_IPFW /* variables to keep state with ipfw, which is rule-number based */ static int ipfw_use = 0; static int ipfw_inited = 0; static int ipfw_have_ipv6 = 0; static int ipfw_have_ipv4 = 0; static int ipfw_sysctl_check(void) { const scamper_osinfo_t *osinfo; size_t len; char *name; int i; len = sizeof(i); name = "net.inet.ip.fw.enable"; if(sysctlbyname(name, &i, &len, NULL, 0) != 0) { printerror(__func__, "could not sysctl %s", name); return -1; } else { if(i != 0) ipfw_have_ipv4 = 1; else scamper_debug(__func__, "ipfw ipv4 not enabled"); } len = sizeof(i); name = "net.inet6.ip6.fw.enable"; if(sysctlbyname(name, &i, &len, NULL, 0) != 0) { printerror(__func__, "could not sysctl %s", name); if(errno != ENOENT) return -1; /* * check if the system is known to not have a separate sysctl for * ipv6 ipfw. */ i = 0; osinfo = scamper_osinfo_get(); if((osinfo->os_id == SCAMPER_OSINFO_OS_FREEBSD && osinfo->os_rel_dots >= 2 && osinfo->os_rel[0] == 6 && osinfo->os_rel[1] < 3) || (osinfo->os_id == SCAMPER_OSINFO_OS_DARWIN && osinfo->os_rel_dots > 0 && osinfo->os_rel[0] == 8)) { ipfw_have_ipv6 = ipfw_have_ipv4; } else i++; if(i != 0) return -1; } else { if(i != 0) ipfw_have_ipv6 = 1; else scamper_debug(__func__, "ipfw ipv6 not enabled"); } return 0; } #ifdef _IPFW2_H static int fws = -1; int scamper_firewall_ipfw_init(void) { if(fws != -1 || ipfw_sysctl_check() != 0 || ipfw_inited != 0) return -1; if((fws = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) { printerror(__func__, "could not open socket for ipfw"); return -1; } ipfw_inited = 1; return 0; } void scamper_firewall_ipfw_cleanup(void) { if(fws != -1) { close(fws); fws = -1; } return; } #if __FreeBSD_version >= 600000 static int ipfw_deny_ip6_ext6hdr_frag(int n, void *s, void *d) { struct ip_fw *fw = NULL; socklen_t sl; uint16_t insnc; ipfw_insn_ip6 *insn_ip6; ipfw_insn *insn; insnc = 1 + 5 + 1 + 1; if(d != NULL) insnc += 5; else insnc += 1; sl = sizeof(struct ip_fw) + (insnc*4) - 4; if((fw = malloc_zero(sl)) == NULL) { printerror(__func__, "could not malloc ip_fw"); goto err; } fw->rulenum = n; fw->act_ofs = insnc-1; fw->cmd_len = insnc; insn = fw->cmd; insn->opcode = O_IP6; insn->len = 1; insn += insn->len; insn_ip6 = (ipfw_insn_ip6 *)insn; insn->opcode = O_IP6_SRC; insn->len = 5; memcpy(&insn_ip6->addr6, s, 16); insn += insn->len; if(d != NULL) { insn_ip6 = (ipfw_insn_ip6 *)insn; insn->opcode = O_IP6_DST; insn->len = 5; memcpy(&insn_ip6->addr6, d, 16); } else { insn->opcode = O_IP6_DST_ME; insn->len = 1; } insn += insn->len; insn->opcode = O_EXT_HDR; insn->len = 1; insn->arg1 = EXT_FRAGMENT; insn += insn->len; insn->opcode = O_DENY; insn->len = 1; if(getsockopt(fws, IPPROTO_IP, IP_FW_ADD, fw, &sl) != 0) { printerror(__func__, "could not add rule"); goto err; } free(fw); return 0; err: if(fw != NULL) free(fw); return -1; } #endif int scamper_firewall_ipfw_add(int n,int af,int p,void *s,void *d,int sp,int dp) { ipfw_insn_u32 *insn_u32; ipfw_insn_u16 *insn_u16; struct ip_fw *fw = NULL; ipfw_insn *insn; socklen_t sl; size_t len; #if __FreeBSD_version >= 600000 ipfw_insn_ip6 *insn_ip6; #endif /* * build ip_fw struct * * note that the ip_fw struct has one member reserved for * the first instruction, so that is not counted here */ len = 2 + 2 + 1; /* O_PROTO + O_IP_SRCPORT + O_IP_DSTPORT + O_DENY */ if(af == AF_INET) len += 2; /* O_IP_SRC */ else if(af == AF_INET6) len += 5; /* O_IP6_SRC */ else goto err; if(d == NULL) len += 1; /* O_IP_DST_ME -or- O_IP6_DST_ME */ else if(af == AF_INET) len += 2; /* O_IP_DST */ else if(af == AF_INET6) len += 5; /* O_IP6_DST */ else goto err; if((fw = malloc_zero(sizeof(struct ip_fw) + (len * 4))) == NULL) { printerror(__func__, "could not malloc ip_fw"); goto err; } sl = sizeof(struct ip_fw) + (len * 4); #if defined(__APPLE__) fw->version = IP_FW_CURRENT_API_VERSION; #endif fw->rulenum = n; fw->act_ofs = len; fw->cmd_len = len+1; insn = fw->cmd; /* encode the O_PROTO parameter */ insn->opcode = O_PROTO; insn->len = 1; insn->arg1 = p; insn += insn->len; /* encode the O_IP_SRC parameter */ if(af == AF_INET) { insn_u32 = (ipfw_insn_u32 *)insn; memcpy(insn_u32->d, s, 4); insn->opcode = O_IP_SRC; insn->len = 2; } #if __FreeBSD_version >= 600000 else if(af == AF_INET6) { insn_ip6 = (ipfw_insn_ip6 *)insn; memcpy(&insn_ip6->addr6, s, 16); insn->opcode = O_IP6_SRC; insn->len = 5; } #endif else goto err; insn += insn->len; /* encode the O_IP_SRCPORT parameter */ insn_u16 = (ipfw_insn_u16 *)insn; insn->opcode = O_IP_SRCPORT; insn->len = 2; insn_u16->ports[0] = sp; insn_u16->ports[1] = sp; insn += insn->len; /* encode the O_IP_DST parameter */ if(d == NULL) { if(af == AF_INET) insn->opcode = O_IP_DST_ME; #if __FreeBSD_version >= 600000 else if(af == AF_INET6) insn->opcode = O_IP6_DST_ME; #endif else goto err; insn->len = 1; } else if(af == AF_INET) { insn_u32 = (ipfw_insn_u32 *)insn; memcpy(insn_u32->d, d, 4); insn->opcode = O_IP_DST; insn->len = 2; } #if __FreeBSD_version >= 600000 else if(af == AF_INET6) { insn_ip6 = (ipfw_insn_ip6 *)insn; memcpy(&insn_ip6->addr6, d, 16); insn->opcode = O_IP6_DST; insn->len = 5; } #endif else goto err; insn += insn->len; /* encode the O_IP_DSTPORT parameter */ insn_u16 = (ipfw_insn_u16 *)insn; insn->opcode = O_IP_DSTPORT; insn->len = 2; insn_u16->ports[0] = dp; insn_u16->ports[1] = dp; insn += insn->len; /* encode the O_DENY action */ insn->opcode = O_DENY; insn->len = 1; if(getsockopt(fws, IPPROTO_IP, IP_FW_ADD, fw, &sl) != 0) { printerror(__func__, "could not add rule"); goto err; } free(fw); #if __FreeBSD_version >= 600000 if(af == AF_INET6) ipfw_deny_ip6_ext6hdr_frag(n, s, d); #endif return 0; err: if(fw != NULL) free(fw); return -1; } int scamper_firewall_ipfw_del(int n, int af) { uint32_t rule = n; if(setsockopt(fws, IPPROTO_IP, IP_FW_DEL, &rule, sizeof(rule)) != 0) { printerror(__func__, "could not delete rule %d", n); return -1; } return 0; } #endif /* _IPFW2_H */ #if defined(_IP_FW_H) || defined(__APPLE__) static int fw4s = -1; static int fw6s = -1; int scamper_firewall_ipfw_init(void) { if(fw4s != -1 || fw6s != -1 || ipfw_sysctl_check() != 0 || ipfw_inited != 0) return -1; if(ipfw_have_ipv4 != 0 && (fw4s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) { printerror(__func__, "could not open socket for ipfw"); return -1; } if(ipfw_have_ipv6 != 0 && (fw6s = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW)) < 0) { printerror(__func__, "could not open socket for ip6fw"); return -1; } ipfw_inited = 1; return 0; } void scamper_firewall_ipfw_cleanup(void) { if(fw4s != -1) { close(fw4s); fw4s = -1; } if(fw6s != -1) { close(fw6s); fw6s = -1; } return; } int scamper_firewall_ipfw_add(int n,int af,int p,void *s,void *d,int sp,int dp) { struct ip_fw fw; struct ip6_fw fw6; int level, optname; void *optval; socklen_t optlen; int i, fd; if(af == AF_INET) { memset(&fw, 0, sizeof(fw)); fw.fw_number = n; fw.fw_flg = IP_FW_F_DENY | IP_FW_F_IN; fw.fw_prot = p; memcpy(&fw.fw_src, s, 4); fw.fw_smsk.s_addr = ~0; memcpy(&fw.fw_dst, d, 4); fw.fw_dmsk.s_addr = ~0; fw.fw_uar.fw_pts[0] = sp; IP_FW_SETNSRCP(&fw, 1); fw.fw_uar.fw_pts[1] = dp; IP_FW_SETNDSTP(&fw, 1); #ifdef __APPLE__ fw.version = IP_FW_CURRENT_API_VERSION; #endif level = IPPROTO_IP; optname = IP_FW_ADD; optval = &fw; optlen = sizeof(fw); fd = fw4s; } else if(af == AF_INET6) { memset(&fw6, 0, sizeof(fw6)); fw6.fw_number = n; fw6.fw_flg = IPV6_FW_F_DENY | IPV6_FW_F_IN; fw6.fw_prot = p; memcpy(&fw6.fw_src, s, 16); for(i=0; i<4; i++) fw6.fw_smsk.s6_addr32[i] = ~0; memcpy(&fw6.fw_dst, d, 16); for(i=0; i<4; i++) fw6.fw_dmsk.s6_addr32[i] = ~0; fw6.fw_pts[0] = sp; IPV6_FW_SETNSRCP(&fw6, 1); fw6.fw_pts[1] = dp; IPV6_FW_SETNDSTP(&fw6, 1); #ifdef __APPLE__ fw6.version = IPV6_FW_CURRENT_API_VERSION; #endif level = IPPROTO_IPV6; optname = IPV6_FW_ADD; optval = &fw6; optlen = sizeof(fw6); fd = fw6s; } else return -1; if(setsockopt(fd, level, optname, optval, optlen) != 0) { printerror(__func__, "could not add fw rule"); return -1; } return 0; } int scamper_firewall_ipfw_del(int n, int af) { struct ip_fw fw; struct ip6_fw fw6; int level, optname; void *optval; socklen_t optlen; int fd; if(af == AF_INET) { memset(&fw, 0, sizeof(fw)); fw.fw_number = n; #ifdef __APPLE__ fw.version = IP_FW_CURRENT_API_VERSION; #endif level = IPPROTO_IP; optname = IP_FW_DEL; optval = &fw; optlen = sizeof(fw); fd = fw4s; } else if(af == AF_INET6) { memset(&fw6, 0, sizeof(fw6)); fw6.fw_number = n; #ifdef __APPLE__ fw6.version = IPV6_FW_CURRENT_API_VERSION; #endif level = IPPROTO_IPV6; optname = IPV6_FW_DEL; optval = &fw6; optlen = sizeof(fw6); fd = fw6s; } else { return -1; } if(setsockopt(fd, level, optname, optval, optlen) != 0) { printerror(__func__, "could not delete rule %d", n); return -1; } return 0; } #endif /* _IPFW_H */ static int ipfw_init(char *opts) { long start, end; char *ptr; if(opts == NULL) { scamper_debug(__func__, "no IPFW configuration parameters supplied"); return -1; } string_nullterm_char(opts, '-', &ptr); if(ptr == NULL || string_isnumber(opts) == 0 || string_isnumber(ptr) == 0) { scamper_debug(__func__, "invalid IFPW options"); return -1; } if(string_tolong(opts, &start) != 0 || start < 1 || start > 65534) { scamper_debug(__func__, "invalid start rule number for IPFW"); return -1; } if(string_tolong(ptr, &end) != 0 || end <= start || end > 65534) { scamper_debug(__func__, "invalid end rule number for IPFW"); return -1; } if(ipfw_sysctl_check() != 0) return -1; if(firewall_entries_alloc() != 0) return -1; if(firewall_freeslots_alloc(start, end) != 0) return -1; #ifdef WITHOUT_PRIVSEP if(scamper_firewall_ipfw_init() != 0) return -1; #else if(scamper_privsep_ipfw_init() != 0) return -1; #endif ipfw_use = 1; return 0; } static int ipfw_add(int ruleno, scamper_firewall_rule_t *sfw) { int af, p, sp, dp; void *s, *d; assert(ipfw_use != 0); if(sfw->sfw_5tuple_src->type == SCAMPER_ADDR_TYPE_IPV4) { if(ipfw_have_ipv4 == 0) { scamper_debug(__func__, "IPv4 rule requested but no IPv4 firewall"); return -1; } af = AF_INET; } else if(sfw->sfw_5tuple_src->type == SCAMPER_ADDR_TYPE_IPV6) { if(ipfw_have_ipv6 == 0) { scamper_debug(__func__, "IPv6 rule requested but no IPv6 firewall"); return -1; } af = AF_INET6; } else { scamper_debug(__func__, "invalid src type"); return -1; } p = sfw->sfw_5tuple_proto; dp = sfw->sfw_5tuple_dport; sp = sfw->sfw_5tuple_sport; s = sfw->sfw_5tuple_src->addr; if(sfw->sfw_5tuple_dst == NULL) d = NULL; else d = sfw->sfw_5tuple_dst->addr; #ifdef WITHOUT_PRIVSEP if(scamper_firewall_ipfw_add(ruleno, af, p, s, d, sp, dp) != 0) return -1; #else if(scamper_privsep_ipfw_add(ruleno, af, p, s, d, sp, dp) != 0) return -1; #endif return 0; } int ipfw_del(const scamper_firewall_entry_t *entry) { int af = scamper_addr_af(entry->rule->sfw_5tuple_src); #ifdef WITHOUT_PRIVSEP return scamper_firewall_ipfw_del(entry->slot, af); #else return scamper_privsep_ipfw_del(entry->slot, af); #endif } #endif /* HAVE_IPFW */ #ifdef HAVE_PF static int pf_use = 0; static int pf_inited = 0; static int pf_fd = -1; static pid_t pf_pid = 0; static char *pf_name = NULL; /* * scamper_firewall_pf_init * * code that can be called both inside scamper_firewall.c and * scamper_privsep.c for initalising the PF firewall. */ int scamper_firewall_pf_init(const char *name) { struct pf_status status; size_t len; if(pf_fd != -1 || pf_inited != 0) return -1; if((len = strlen(name)) == 0 || string_isprint(name, len) == 0) return -1; if((pf_name = strdup(name)) == NULL) { printerror(__func__, "could not dup name"); return -1; } if((pf_fd = open("/dev/pf", O_RDWR)) == -1) { printerror(__func__, "could not open socket"); return -1; } if(ioctl(pf_fd, DIOCGETSTATUS, &status) == -1) { printerror(__func__, "could not get status"); return -1; } if(status.running == 0) { scamper_debug(__func__, "pf not running"); return -1; } pf_pid = getpid(); pf_inited = 1; return 0; } void scamper_firewall_pf_cleanup(void) { if(pf_fd != -1) { close(pf_fd); pf_fd = -1; } if(pf_name != NULL) { free(pf_name); pf_name = NULL; } return; } int scamper_firewall_pf_add(int n,int af,int p,void *s,void *d,int sp,int dp) { char anchor[PF_ANCHOR_NAME_SIZE]; struct pfioc_trans_e pfte; struct pfioc_trans pft; struct pfioc_rule pfr; size_t off; off = 0; string_concat(anchor, sizeof(anchor), &off, "%s/%d.%d", pf_name, pf_pid, n); memset(&pft, 0, sizeof(pft)); pft.size = 1; pft.esize = sizeof(pfte); pft.array = &pfte; memset(&pfte, 0, sizeof(pfte)); strncpy(pfte.anchor, anchor, sizeof(pfte.anchor)-1); pfte.anchor[sizeof(pfte.anchor)-1] = '\0'; #if defined(HAVE_STRUCT_PFIOC_TRANS_E_TYPE) pfte.type = PF_TRANS_RULESET; #endif #if defined(HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM) pfte.rs_num = PF_RULESET_FILTER; #endif if(ioctl(pf_fd, DIOCXBEGIN, &pft) == -1) { printerror(__func__, "could not begin transaction"); return -1; } memset(&pfr, 0, sizeof(pfr)); strncpy(pfr.anchor, anchor, sizeof(pfr.anchor)-1); pfte.anchor[sizeof(pfr.anchor)-1] = '\0'; pfr.ticket = pfte.ticket; pfr.rule.af = af; pfr.rule.proto = p; pfr.rule.direction = PF_IN; pfr.rule.src.addr.type = PF_ADDR_ADDRMASK; pfr.rule.dst.addr.type = PF_ADDR_ADDRMASK; #if defined(HAVE_STRUCT_PF_RULE_NAT) pfr.rule.nat.addr.type = PF_ADDR_NONE; #endif #if defined(HAVE_STRUCT_PF_RULE_RDR) pfr.rule.rdr.addr.type = PF_ADDR_NONE; #endif if(af == AF_INET) { memcpy(&pfr.rule.src.addr.v.a.addr.v4, s, 4); memset(&pfr.rule.src.addr.v.a.mask.v4, 255, 4); memcpy(&pfr.rule.dst.addr.v.a.addr.v4, d, 4); memset(&pfr.rule.dst.addr.v.a.mask.v4, 255, 4); } else { memcpy(&pfr.rule.src.addr.v.a.addr.v6, s, 16); memset(&pfr.rule.src.addr.v.a.mask.v6, 255, 16); memcpy(&pfr.rule.src.addr.v.a.addr.v6, d, 16); memset(&pfr.rule.dst.addr.v.a.mask.v6, 255, 16); } pfr.rule.src.port_op = PF_OP_EQ; pfr.rule.src.port[0] = htons(sp); pfr.rule.dst.port_op = PF_OP_EQ; pfr.rule.dst.port[0] = htons(dp); pfr.rule.action = PF_DROP; pfr.rule.quick = 1; if(ioctl(pf_fd, DIOCADDRULE, &pfr) == -1) { printerror(__func__, "could not add rule"); return -1; } if(ioctl(pf_fd, DIOCXCOMMIT, &pft) == -1) { printerror(__func__, "could not commit rule"); return -1; } return 0; } int scamper_firewall_pf_del(int ruleno) { struct pfioc_trans_e pfte; struct pfioc_trans pft; size_t off; memset(&pft, 0, sizeof(pft)); pft.size = 1; pft.esize = sizeof(pfte); pft.array = &pfte; memset(&pfte, 0, sizeof(pfte)); off = 0; string_concat(pfte.anchor, sizeof(pfte.anchor), &off, "%s/%d.%d", pf_name,pf_pid,ruleno); #if defined(HAVE_STRUCT_PFIOC_TRANS_E_TYPE) pfte.type = PF_TRANS_RULESET; #endif #if defined(HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM) pfte.rs_num = PF_RULESET_FILTER; #endif if(ioctl(pf_fd, DIOCXBEGIN, &pft) == -1) { printerror(__func__, "could not begin transaction"); return -1; } if(ioctl(pf_fd, DIOCXCOMMIT, &pft) == -1) { printerror(__func__, "could not commit rule"); return -1; } return 0; } static int pf_add(int n, scamper_firewall_rule_t *sfw) { int af, p, sp, dp; void *s, *d; assert(pf_use != 0); if(sfw->sfw_5tuple_src->type != SCAMPER_ADDR_TYPE_IPV4 && sfw->sfw_5tuple_src->type != SCAMPER_ADDR_TYPE_IPV6) return -1; af = scamper_addr_af(sfw->sfw_5tuple_src); p = sfw->sfw_5tuple_proto; dp = sfw->sfw_5tuple_dport; sp = sfw->sfw_5tuple_sport; s = sfw->sfw_5tuple_src->addr; d = sfw->sfw_5tuple_dst->addr; #ifdef WITHOUT_PRIVSEP if(scamper_firewall_pf_add(n, af, p, s, d, sp, dp) != 0) return -1; #else if(scamper_privsep_pf_add(n, af, p, s, d, sp, dp) != 0) return -1; #endif return 0; } static int pf_del(int n) { #ifdef WITHOUT_PRIVSEP return scamper_firewall_pf_del(n); #else return scamper_privsep_pf_del(n); #endif } static int pf_init(char *opts) { char *name_str, *num_str; long num; name_str = opts; string_nullterm_char(opts, ':', &num_str); if(strlen(name_str) < 1) { scamper_debug(__func__, "invalid name"); return -1; } if(num_str == NULL) { scamper_debug(__func__, "missing number"); return -1; } if(string_isnumber(num_str) == 0 || string_tolong(num_str, &num) != 0 || num < 1 || num > 65535) { scamper_debug(__func__, "%s is not a valid number", num_str); return -1; } if(firewall_entries_alloc() != 0) return -1; if(firewall_freeslots_alloc(1, num) != 0) return -1; #ifdef WITHOUT_PRIVSEP if(scamper_firewall_pf_init(name_str) != 0) return -1; #else if(scamper_privsep_pf_init(name_str) != 0) return -1; #endif pf_use = 1; return 0; } #endif /* HAVE_PF */ scamper_firewall_entry_t *scamper_firewall_entry_get(scamper_firewall_rule_t *sfw) { #if defined(HAVE_IPFW) || defined(HAVE_PF) scamper_firewall_entry_t findme, *entry = NULL; /* sanity check the rule */ if((sfw->sfw_5tuple_proto != IPPROTO_TCP && sfw->sfw_5tuple_proto != IPPROTO_UDP) || sfw->sfw_5tuple_sport == 0 || sfw->sfw_5tuple_dport == 0 || (sfw->sfw_5tuple_dst == NULL || sfw->sfw_5tuple_src == NULL || sfw->sfw_5tuple_src->type != sfw->sfw_5tuple_dst->type)) { scamper_debug(__func__, "invalid 5tuple rule"); goto err; } findme.rule = sfw; if((entry = splaytree_find(entries, &findme)) != NULL) { entry->refcnt++; return entry; } if((entry = heap_remove(freeslots)) == NULL) goto err; entry->refcnt = 1; if((entry->rule = firewall_rule_dup(sfw)) == NULL || (entry->node = splaytree_insert(entries, entry)) == NULL) { goto err; } #ifdef HAVE_IPFW if(ipfw_use != 0) { if(ipfw_add(entry->slot, sfw) != 0) goto err; return entry; } #endif #ifdef HAVE_PF if(pf_use != 0) { if(pf_add(entry->slot, sfw) != 0) goto err; return entry; } #endif err: if(entry != NULL) { if(entry->rule != NULL) firewall_rule_free(entry->rule); free(entry); } #endif /* HAVE_IPFW || HAVE_PF */ return NULL; } #if defined(HAVE_IPFW) || defined(HAVE_PF) static int firewall_rule_delete(scamper_firewall_entry_t *entry) { #if defined(HAVE_IPFW) if(ipfw_use != 0) { if(ipfw_del(entry) != 0) return -1; goto done; } #endif #if defined(HAVE_PF) if(pf_use != 0) { if(pf_del(entry->slot) != 0) return -1; goto done; } #endif done: /* put the rule back into the freeslots heap */ if(heap_insert(freeslots, entry) == NULL) { printerror(__func__, "could not add entry %d", entry->slot); return -1; } /* free up the firewall rule associated with the entry */ firewall_rule_free(entry->rule); entry->rule = NULL; return 0; } #endif void scamper_firewall_entry_free(scamper_firewall_entry_t *entry) { #if defined(HAVE_IPFW) || defined(HAVE_PF) entry->refcnt--; if(entry->refcnt > 0) return; /* remove the entry from the tree */ splaytree_remove_node(entries, entry->node); entry->node = NULL; /* * if the entry is still loaded in the firewall, remove it now. * note that this code is to handle the case that scamper_firewall_cleanup * is called before this function is called. */ if(entry->slot >= 0) firewall_rule_delete(entry); #endif return; } #if defined(HAVE_IPFW) || defined(HAVE_PF) static int firewall_entry_cleanup(void *param, scamper_firewall_entry_t *entry) { firewall_rule_delete(entry); entry->slot = -1; return 0; } #endif void scamper_firewall_cleanup(void) { #if defined(HAVE_IPFW) || defined(HAVE_PF) scamper_firewall_entry_t *entry; if(entries != NULL) splaytree_inorder(entries,(splaytree_inorder_t)firewall_entry_cleanup,NULL); if(freeslots != NULL) { while((entry = heap_remove(freeslots)) != NULL) firewall_entry_free(entry); heap_free(freeslots, NULL); freeslots = NULL; } if(entries != NULL) { splaytree_free(entries, NULL); entries = NULL; } #endif #ifdef HAVE_IPFW if(ipfw_use != 0) { #ifdef WITHOUT_PRIVSEP scamper_firewall_ipfw_cleanup(); #else if(ipfw_inited != 0) scamper_privsep_ipfw_cleanup(); #endif } #endif #ifdef HAVE_PF if(pf_use != 0) { #ifdef WITHOUT_PRIVSEP scamper_firewall_pf_cleanup(); #else if(pf_inited != 0) scamper_privsep_pf_cleanup(); #endif } #endif return; } int scamper_firewall_init(const char *opt) { #if defined(HAVE_IPFW) || defined(HAVE_PF) char *dup, *ptr; int rc = -1; if((dup = strdup(opt)) == NULL) { printerror(__func__, "could not dup opt"); return -1; } string_nullterm_char(dup, ':', &ptr); #if defined(HAVE_IPFW) if(strcasecmp(dup, "ipfw") == 0) { rc = ipfw_init(ptr); goto done; } #endif #if defined(HAVE_PF) if(strcasecmp(dup, "pf") == 0) { rc = pf_init(ptr); goto done; } #endif done: free(dup); return rc; #endif /* HAVE_IPFW || HAVE_PF */ return -1; } scamper-cvs-20171204/scamper/scamper_firewall.h000644 001751 000000 00000004611 12751606454 021251 0ustar00mjlwheel000000 000000 /* * scamper_firewall.h * * $Id: scamper_firewall.h,v 1.5 2016/08/07 10:27:56 mjl Exp $ * * Copyright (C) 2008-2010 The University of Waikato * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_FIREWALL_H #define __SCAMPER_FIREWALL_H #define SCAMPER_FIREWALL_RULE_TYPE_5TUPLE 0x1 /* handle returned when a firewall entry is added to the table */ typedef struct scamper_firewall_entry scamper_firewall_entry_t; #ifdef __SCAMPER_ADDR_H typedef struct scamper_firewall_rule { uint16_t type; union { struct fivetuple { uint8_t proto; scamper_addr_t *src; scamper_addr_t *dst; uint16_t sport; uint16_t dport; } fivetuple; } un; } scamper_firewall_rule_t; scamper_firewall_entry_t *scamper_firewall_entry_get(scamper_firewall_rule_t *); #endif #define sfw_5tuple_proto un.fivetuple.proto #define sfw_5tuple_src un.fivetuple.src #define sfw_5tuple_dst un.fivetuple.dst #define sfw_5tuple_sport un.fivetuple.sport #define sfw_5tuple_dport un.fivetuple.dport void scamper_firewall_entry_free(scamper_firewall_entry_t *); /* routines to handle initialising structures to manage the firewall */ int scamper_firewall_init(const char *opt); void scamper_firewall_cleanup(void); #ifdef HAVE_IPFW int scamper_firewall_ipfw_init(void); void scamper_firewall_ipfw_cleanup(void); int scamper_firewall_ipfw_add(int n,int af,int p,void *s,void *d,int sp,int dp); int scamper_firewall_ipfw_del(int n,int af); #endif #ifdef HAVE_PF int scamper_firewall_pf_init(const char *anchor); int scamper_firewall_pf_add(int n,int af,int p,void *s,void *d,int sp,int dp); int scamper_firewall_pf_del(int n); void scamper_firewall_pf_cleanup(void); #endif #endif /* __SCAMPER_FIREWALL_H */ scamper-cvs-20171204/scamper/scamper_getsrc.c000644 001751 000000 00000006566 13210743022 020721 0ustar00mjlwheel000000 000000 /* * scamper_getsrc.c * * $Id: scamper_getsrc.c,v 1.19 2017/12/03 09:38:26 mjl Exp $ * * Copyright (C) 2005 Matthew Luckie * Copyright (C) 2007-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_getsrc.c,v 1.19 2017/12/03 09:38:26 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_debug.h" #include "scamper_getsrc.h" #include "utils.h" static int udp4 = -1; static int udp6 = -1; extern scamper_addrcache_t *addrcache; /* * scamper_getsrc * * given a destination address, determine the src address used in the IP * header to transmit probes to it. */ scamper_addr_t *scamper_getsrc(const scamper_addr_t *dst, int ifindex) { struct sockaddr_storage sas; scamper_addr_t *src; socklen_t socklen, sockleno; int sock; void *addr; char buf[64]; if(dst->type == SCAMPER_ADDR_TYPE_IPV4) { if(udp4 == -1 && (udp4 = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { printerror(__func__, "could not open udp4 sock"); return NULL; } sock = udp4; addr = &((struct sockaddr_in *)&sas)->sin_addr; socklen = sizeof(struct sockaddr_in); sockaddr_compose((struct sockaddr *)&sas, AF_INET, dst->addr, 80); } else if(dst->type == SCAMPER_ADDR_TYPE_IPV6) { if(udp6 == -1 && (udp6 = socket(AF_INET6, SOCK_DGRAM,IPPROTO_UDP)) == -1) { printerror(__func__, "could not open udp6 sock"); return NULL; } sock = udp6; addr = &((struct sockaddr_in6 *)&sas)->sin6_addr; socklen = sizeof(struct sockaddr_in6); sockaddr_compose((struct sockaddr *)&sas, AF_INET6, dst->addr, 80); if(scamper_addr_islinklocal(dst) != 0) { ((struct sockaddr_in6 *)&sas)->sin6_scope_id = ifindex; } } else return NULL; if(connect(sock, (struct sockaddr *)&sas, socklen) != 0) { printerror(__func__, "connect to dst failed for %s", scamper_addr_tostr(dst, buf, sizeof(buf))); return NULL; } sockleno = socklen; if(getsockname(sock, (struct sockaddr *)&sas, &sockleno) != 0) { printerror(__func__, "could not getsockname for %s", scamper_addr_tostr(dst, buf, sizeof(buf))); return NULL; } src = scamper_addrcache_get(addrcache, dst->type, addr); memset(&sas, 0, sizeof(sas)); connect(sock, (struct sockaddr *)&sas, socklen); return src; } int scamper_getsrc_init() { return 0; } void scamper_getsrc_cleanup() { if(udp4 != -1) { #ifndef _WIN32 close(udp4); #else closesocket(udp4); #endif udp4 = -1; } if(udp6 != -1) { #ifndef _WIN32 close(udp6); #else closesocket(udp6); #endif udp6 = -1; } return; } scamper-cvs-20171204/scamper/scamper_getsrc.h000644 001751 000000 00000002100 11634537540 020720 0ustar00mjlwheel000000 000000 /* * scamper_getsrc.h * * $Id: scamper_getsrc.h,v 1.5 2011/09/16 03:15:44 mjl Exp $ * * Copyright (C) 2005 Matthew Luckie * Copyright (C) 2008-2009 University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_GETSRC_H #define __SCAMPER_GETSRC_H scamper_addr_t *scamper_getsrc(const scamper_addr_t *dst, int ifindex); int scamper_getsrc_init(void); void scamper_getsrc_cleanup(void); #endif /* __SCAMPER_GETSRC_H */ scamper-cvs-20171204/scamper/scamper_icmp4.c000644 001751 000000 00000052665 13210743022 020447 0ustar00mjlwheel000000 000000 /* * scamper_icmp4.c * * $Id: scamper_icmp4.c,v 1.115 2017/12/03 09:38:26 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2013-2014 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_icmp4.c,v 1.115 2017/12/03 09:38:26 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_dl.h" #include "scamper_probe.h" #include "scamper_icmp_resp.h" #include "scamper_ip4.h" #include "scamper_icmp4.h" #include "scamper_privsep.h" #include "scamper_debug.h" #include "utils.h" static uint8_t *txbuf = NULL; static size_t txbuf_len = 0; static uint8_t rxbuf[65536]; static void icmp4_header(scamper_probe_t *probe, uint8_t *buf) { buf[0] = probe->pr_icmp_type; /* type */ buf[1] = probe->pr_icmp_code; /* code */ buf[2] = 0; buf[3] = 0; /* checksum */ switch(probe->pr_icmp_type) { case ICMP_ECHO: case ICMP_ECHOREPLY: case ICMP_TSTAMP: bytes_htons(buf+4, probe->pr_icmp_id); bytes_htons(buf+6, probe->pr_icmp_seq); break; case ICMP_UNREACH: memset(buf+4, 0, 4); if(probe->pr_icmp_code == ICMP_UNREACH_NEEDFRAG) bytes_htons(buf+6, probe->pr_icmp_mtu); break; default: memset(buf+4, 0, 4); break; } return; } uint16_t scamper_icmp4_cksum(scamper_probe_t *probe) { uint8_t hdr[8]; uint16_t tmp, *w; int i, sum = 0; icmp4_header(probe, hdr); w = (uint16_t *)hdr; for(i=0; i<8; i+=2) sum += *w++; w = (uint16_t *)probe->pr_data; for(i = probe->pr_len; i > 1; i -= 2) sum += *w++; if(i != 0) sum += ((uint8_t *)w)[0]; /* fold the checksum */ sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); if((tmp = ~sum) == 0) { tmp = 0xffff; } return tmp; } static void icmp4_build(scamper_probe_t *probe, uint8_t *buf) { uint16_t csum; icmp4_header(probe, buf); if(probe->pr_len > 0) memcpy(buf + 8, probe->pr_data, probe->pr_len); csum = in_cksum(buf, (size_t)(probe->pr_len + 8)); memcpy(buf+2, &csum, 2); return; } int scamper_icmp4_build(scamper_probe_t *probe, uint8_t *buf, size_t *len) { size_t ip4hlen, req; int rc = 0; ip4hlen = *len; scamper_ip4_build(probe, buf, &ip4hlen); req = ip4hlen + 8 + probe->pr_len; if(req <= *len) icmp4_build(probe, buf + ip4hlen); else rc = -1; *len = req; return rc; } /* * scamper_icmp4_probe * * send an ICMP probe to a destination */ int scamper_icmp4_probe(scamper_probe_t *probe) { struct sockaddr_in sin4; char addr[128]; size_t ip4hlen, len, tmp; int i, icmphdrlen; #if !defined(IP_HDR_HTONS) struct ip *ip; #endif assert(probe != NULL); assert(probe->pr_ip_proto == IPPROTO_ICMP); assert(probe->pr_ip_dst != NULL); assert(probe->pr_ip_src != NULL); assert(probe->pr_len > 0 || probe->pr_data == NULL); switch(probe->pr_icmp_type) { case ICMP_ECHO: case ICMP_TSTAMP: icmphdrlen = (1 + 1 + 2 + 2 + 2); break; default: probe->pr_errno = EINVAL; return -1; } scamper_ip4_hlen(probe, &ip4hlen); /* compute length, for sake of readability */ len = ip4hlen + icmphdrlen + probe->pr_len; if(txbuf_len < len) { if(realloc_wrap((void **)&txbuf, len) != 0) { printerror(__func__, "could not realloc"); return -1; } txbuf_len = len; } /* build the IPv4 header from the probe structure */ tmp = len; scamper_ip4_build(probe, txbuf, &tmp); /* byte swap the length and offset fields back to host-byte order if reqd */ #if !defined(IP_HDR_HTONS) ip = (struct ip *)txbuf; ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); #endif icmp4_build(probe, txbuf + ip4hlen); sockaddr_compose((struct sockaddr *)&sin4, AF_INET, probe->pr_ip_dst->addr, 0); /* get the transmit time immediately before we send the packet */ gettimeofday_wrap(&probe->pr_tx); i = sendto(probe->pr_fd, txbuf, len, 0, (struct sockaddr *)&sin4, sizeof(struct sockaddr_in)); if(i < 0) { /* error condition, could not send the packet at all */ probe->pr_errno = errno; printerror(__func__, "could not send to %s (%d ttl, %d seq, %d len)", scamper_addr_tostr(probe->pr_ip_dst, addr, sizeof(addr)), probe->pr_ip_ttl, probe->pr_icmp_seq, len); return -1; } else if((size_t)i != len) { /* error condition, sent a portion of the probe */ printerror_msg(__func__, "sent %d bytes of %d byte packet to %s", i, (int)len, scamper_addr_tostr(probe->pr_ip_dst, addr, sizeof(addr))); return -1; } return 0; } /* * icmp4_quote_ip_len * * this function returns the ip header's length field inside an icmp message * in a consistent fashion based on the system it is running on and the * type of the message. * * thanks to the use of an ICMP_FILTER or scamper's own type filtering, the * two ICMP types scamper has to deal with are ICMP_TIMXCEED and ICMP_UNREACH * * note that the filtering will filter any ICMP_TIMXCEED message with a code * other than ICMP_TIMXCEED_INTRANS, but we might as well deal with the whole * type. * * the pragmatic way is just to use pcap, which passes packets up in network * byte order consistently. */ static uint16_t icmp4_quote_ip_len(const struct icmp *icmp) { uint16_t len; #if defined(__linux__) || defined(__OpenBSD__) || defined(__sun__) || defined(_WIN32) len = ntohs(icmp->icmp_ip.ip_len); #elif defined(__FreeBSD__) && __FreeBSD_version >= 1000022 len = ntohs(icmp->icmp_ip.ip_len); #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__DragonFly__) if(icmp->icmp_type == ICMP_TIMXCEED) { if(icmp->icmp_code <= 1) len = icmp->icmp_ip.ip_len; else len = ntohs(icmp->icmp_ip.ip_len); } else if(icmp->icmp_type == ICMP_UNREACH) { switch(icmp->icmp_code) { case ICMP_UNREACH_NET: case ICMP_UNREACH_HOST: case ICMP_UNREACH_PROTOCOL: case ICMP_UNREACH_PORT: case ICMP_UNREACH_SRCFAIL: case ICMP_UNREACH_NEEDFRAG: case ICMP_UNREACH_NET_UNKNOWN: case ICMP_UNREACH_NET_PROHIB: case ICMP_UNREACH_TOSNET: case ICMP_UNREACH_HOST_UNKNOWN: case ICMP_UNREACH_ISOLATED: case ICMP_UNREACH_HOST_PROHIB: case ICMP_UNREACH_TOSHOST: # if defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__) case ICMP_UNREACH_HOST_PRECEDENCE: case ICMP_UNREACH_PRECEDENCE_CUTOFF: case ICMP_UNREACH_FILTER_PROHIB: # endif len = icmp->icmp_ip.ip_len; break; default: len = ntohs(icmp->icmp_ip.ip_len); } } else if(icmp->icmp_type == ICMP_PARAMPROB) { if(icmp->icmp_code <= 1) len = icmp->icmp_ip.ip_len; else len = ntohs(icmp->icmp_ip.ip_len); } else { len = icmp->icmp_ip.ip_len; } #else len = icmp->icmp_ip.ip_len; #endif return len; } /* * scamper_icmp4_ip_len * * given the ip header encapsulating the icmp response, return the length * of the ip packet */ static uint16_t icmp4_ip_len(const struct ip *ip) { uint16_t len; #if defined(__linux__) || defined(__OpenBSD__) || defined(__sun__) || defined(_WIN32) len = ntohs(ip->ip_len); #elif defined(__FreeBSD__) && __FreeBSD_version >= 1100030 len = ntohs(ip->ip_len); #else len = ip->ip_len + (ip->ip_hl << 2); #endif return len; } static void ip_quote_rr(scamper_icmp_resp_t *ir, int rrc, void *rrs) { ir->ir_inner_ipopt_rrc = rrc; ir->ir_inner_ipopt_rrs = rrs; return; } static void ip_rr(scamper_icmp_resp_t *ir, int rrc, void *rrs) { ir->ir_ipopt_rrc = rrc; ir->ir_ipopt_rrs = rrs; return; } static uint8_t ip_tsc(int fl, int len) { if(fl == 0) { if(len >= 4 && (len % 4) == 0) return len / 4; } else if(fl == 1 || fl == 3) { if(len >= 8 && (len % 8) == 0) return len / 8; } return 0; } static void ip_quote_ts(scamper_icmp_resp_t *ir, int fl, const uint8_t *buf, int len) { const uint8_t *ptr = buf; uint8_t i, tsc; ir->ir_flags |= SCAMPER_ICMP_RESP_FLAG_INNER_IPOPT_TS; if((tsc = ip_tsc(fl, len)) == 0) return; if(fl == 1 || fl == 3) { ir->ir_inner_ipopt_tsips = malloc_zero(sizeof(struct in_addr) * tsc); if(ir->ir_inner_ipopt_tsips == NULL) return; } if((ir->ir_inner_ipopt_tstss = malloc_zero(sizeof(uint32_t) * tsc)) == NULL) return; for(i=0; iir_inner_ipopt_tsips[i], ptr, 4); ptr += 4; } ir->ir_inner_ipopt_tstss[i] = bytes_ntohl(ptr); ptr += 4; } ir->ir_inner_ipopt_tsc = tsc; return; } static void ip_ts(scamper_icmp_resp_t *ir, int fl, const uint8_t *buf, int len) { const uint8_t *ptr = buf; uint8_t i, tsc; size_t size; ir->ir_flags |= SCAMPER_ICMP_RESP_FLAG_IPOPT_TS; if((tsc = ip_tsc(fl, len)) == 0) return; if(fl == 1 || fl == 3) { size = sizeof(struct in_addr) * tsc; if((ir->ir_ipopt_tsips = malloc_zero(size)) == NULL) return; } if((ir->ir_ipopt_tstss = malloc_zero(sizeof(uint32_t) * tsc)) == NULL) return; for(i=0; iir_ipopt_tsips[i], ptr, 4); ptr += 4; } ir->ir_ipopt_tstss[i] = bytes_ntohl(ptr); ptr += 4; } ir->ir_ipopt_tsc = tsc; return; } static void ipopt_parse(scamper_icmp_resp_t *ir, const uint8_t *buf, int iphl, void (*rr)(scamper_icmp_resp_t *, int, void *), void (*ts)(scamper_icmp_resp_t *, int, const uint8_t *, int)) { int off, ol, p, fl, rrc; void *rrs; off = 20; while(off < iphl) { /* end of IP options */ if(buf[off] == 0) break; /* no-op */ if(buf[off] == 1) { off++; continue; } ol = buf[off+1]; /* check to see if the option could be included */ if(ol < 2 || off + ol > iphl) break; if(buf[off] == 7 && rr != NULL) { /* record route */ p = buf[off+2]; if(p >= 4 && (p % 4) == 0 && (rrc = (p / 4) - 1) != 0 && (rrs = memdup(buf+off+3, rrc * 4)) != NULL) { rr(ir, rrc, rrs); } } else if(buf[off] == 68 && ts != NULL) { /* timestamp */ p = buf[off+2]; fl = buf[off+3] & 0xf; if(p == 1) /* RFC 781, not in 791 */ ts(ir, fl, buf+off+4, ol-4); else if(p >= 5 && p-1 <= ol) ts(ir, fl, buf+off+4, p-5); } off += ol; } return; } /* * icmp4_recv_ip * * copy details of the ICMP message and the time it was received into the * response structure. */ #ifndef _WIN32 static void icmp4_recv_ip(int fd, scamper_icmp_resp_t *ir, const uint8_t *buf, int iphl, struct msghdr *msg) #else static void icmp4_recv_ip(int fd, scamper_icmp_resp_t *ir, const uint8_t *buf, int iphl) #endif { const struct ip *ip = (const struct ip *)buf; const struct icmp *icmp = (const struct icmp *)(buf + iphl); /* * to start with, get a timestamp from the kernel if we can, otherwise * just get one from user-space. */ #if defined(SO_TIMESTAMP) struct cmsghdr *cmsg; /* * RFC 2292: * this should be taken care of by CMSG_FIRSTHDR, but not always is. */ if(msg->msg_controllen >= sizeof(struct cmsghdr)) { cmsg = (struct cmsghdr *)CMSG_FIRSTHDR(msg); while(cmsg != NULL) { if(cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_TIMESTAMP) { timeval_cpy(&ir->ir_rx, (struct timeval *)CMSG_DATA(cmsg)); ir->ir_flags |= SCAMPER_ICMP_RESP_FLAG_KERNRX; break; } cmsg = (struct cmsghdr *)CMSG_NXTHDR(msg, cmsg); } } #elif defined(SIOCGSTAMP) if(ioctl(fd, SIOCGSTAMP, &ir->ir_rx) != -1) { ir->ir_flags |= SCAMPER_ICMP_RESP_FLAG_KERNRX; } #else gettimeofday_wrap(&ir->ir_rx); #endif /* the response came from ... */ memcpy(&ir->ir_ip_src.v4, &ip->ip_src, sizeof(struct in_addr)); ir->ir_af = AF_INET; ir->ir_ip_ttl = ip->ip_ttl; ir->ir_ip_id = ntohs(ip->ip_id); ir->ir_ip_tos = ip->ip_tos; ir->ir_ip_size = icmp4_ip_len(ip); ir->ir_icmp_type = icmp->icmp_type; ir->ir_icmp_code = icmp->icmp_code; ipopt_parse(ir, buf, iphl, ip_rr, ip_ts); return; } static int ip_hl(const void *buf) { return (((const uint8_t *)buf)[0] & 0xf) << 2; } int scamper_icmp4_recv(int fd, scamper_icmp_resp_t *resp) { ssize_t poffset; ssize_t pbuflen; struct icmp *icmp; struct ip *ip_outer = (struct ip *)rxbuf; struct ip *ip_inner; struct udphdr *udp; struct tcphdr *tcp; uint8_t type, code; uint8_t nh; int iphl; int iphlq; uint8_t *ext; ssize_t extlen; #ifndef _WIN32 struct sockaddr_in from; uint8_t ctrlbuf[256]; struct msghdr msg; struct iovec iov; memset(&iov, 0, sizeof(iov)); iov.iov_base = (caddr_t)rxbuf; iov.iov_len = sizeof(rxbuf); msg.msg_name = (caddr_t)&from; msg.msg_namelen = sizeof(from); msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = (caddr_t)ctrlbuf; msg.msg_controllen = sizeof(ctrlbuf); if((pbuflen = recvmsg(fd, &msg, 0)) == -1) { printerror(__func__, "could not recvmsg"); return -1; } #else if((pbuflen = recv(fd, rxbuf, sizeof(rxbuf), 0)) == SOCKET_ERROR) { printerror(__func__, "could not recv"); return -1; } #endif if((iphl = ip_hl(ip_outer)) < 20) { scamper_debug(__func__, "iphl %d < 20", iphl); return -1; } /* * an ICMP header has to be at least 8 bytes: * 1 byte type, 1 byte code, 2 bytes checksum, 4 bytes 'data' */ if(pbuflen < iphl + 8) { scamper_debug(__func__, "pbuflen [%d] < iphl [%d] + 8", pbuflen, iphl); return -1; } icmp = (struct icmp *)(rxbuf + iphl); type = icmp->icmp_type; code = icmp->icmp_code; /* check to see if the ICMP type / code is what we want */ if((type != ICMP_TIMXCEED || code != ICMP_TIMXCEED_INTRANS) && type != ICMP_UNREACH && type != ICMP_ECHOREPLY && type != ICMP_TSTAMPREPLY && type != ICMP_PARAMPROB) { scamper_debug(__func__, "type %d, code %d not wanted", type, code); return -1; } memset(resp, 0, sizeof(scamper_icmp_resp_t)); resp->ir_fd = fd; /* * if we get an ICMP echo reply, there is no 'inner' IP packet as there * was no error condition. * so get the outer packet's details and be done */ if(type == ICMP_ECHOREPLY || type == ICMP_TSTAMPREPLY) { resp->ir_icmp_id = ntohs(icmp->icmp_id); resp->ir_icmp_seq = ntohs(icmp->icmp_seq); memcpy(&resp->ir_inner_ip_dst.v4, &ip_outer->ip_src, sizeof(struct in_addr)); if(type == ICMP_TSTAMPREPLY) { resp->ir_icmp_tso = bytes_ntohl(rxbuf + iphl + 8); resp->ir_icmp_tsr = bytes_ntohl(rxbuf + iphl + 12); resp->ir_icmp_tst = bytes_ntohl(rxbuf + iphl + 16); } #ifndef _WIN32 icmp4_recv_ip(fd, resp, rxbuf, iphl, &msg); #else icmp4_recv_ip(fd, resp, rxbuf, iphl); #endif return 0; } ip_inner = &icmp->icmp_ip; nh = ip_inner->ip_p; iphlq = ip_hl(ip_inner); poffset = iphl + 8 + iphlq; /* search for an ICMP / UDP / TCP header in this packet */ while(poffset + 8 <= pbuflen) { /* if we can't deal with the inner header, then stop now */ if(nh != IPPROTO_UDP && nh != IPPROTO_ICMP && nh != IPPROTO_TCP) { scamper_debug(__func__, "unhandled next header %d", nh); return -1; } resp->ir_flags |= SCAMPER_ICMP_RESP_FLAG_INNER_IP; /* record details of the IP header and the ICMP headers */ #ifndef _WIN32 icmp4_recv_ip(fd, resp, rxbuf, iphl, &msg); #else icmp4_recv_ip(fd, resp, rxbuf, iphl); #endif /* record details of the IP header found in the ICMP error message */ memcpy(&resp->ir_inner_ip_dst.v4, &ip_inner->ip_dst, sizeof(struct in_addr)); resp->ir_inner_ip_proto = nh; resp->ir_inner_ip_ttl = ip_inner->ip_ttl; resp->ir_inner_ip_id = ntohs(ip_inner->ip_id); resp->ir_inner_ip_off = ntohs(ip_inner->ip_off) & IP_OFFMASK; resp->ir_inner_ip_tos = ip_inner->ip_tos; resp->ir_inner_ip_size = icmp4_quote_ip_len(icmp); if(type == ICMP_UNREACH && code == ICMP_UNREACH_NEEDFRAG) resp->ir_icmp_nhmtu = ntohs(icmp->icmp_nextmtu); if(type == ICMP_PARAMPROB && code == ICMP_PARAMPROB_ERRATPTR) resp->ir_icmp_pptr = icmp->icmp_pptr; if(resp->ir_inner_ip_off == 0) { ipopt_parse(resp, rxbuf+iphl+8, iphlq, ip_quote_rr, ip_quote_ts); if(nh == IPPROTO_UDP) { udp = (struct udphdr *)(rxbuf+poffset); resp->ir_inner_udp_sport = ntohs(udp->uh_sport); resp->ir_inner_udp_dport = ntohs(udp->uh_dport); resp->ir_inner_udp_sum = udp->uh_sum; } else if(nh == IPPROTO_ICMP) { icmp = (struct icmp *)(rxbuf+poffset); resp->ir_inner_icmp_type = icmp->icmp_type; resp->ir_inner_icmp_code = icmp->icmp_code; resp->ir_inner_icmp_sum = icmp->icmp_cksum; resp->ir_inner_icmp_id = ntohs(icmp->icmp_id); resp->ir_inner_icmp_seq = ntohs(icmp->icmp_seq); } else if(nh == IPPROTO_TCP) { tcp = (struct tcphdr *)(rxbuf+poffset); resp->ir_inner_tcp_sport = ntohs(tcp->th_sport); resp->ir_inner_tcp_dport = ntohs(tcp->th_dport); resp->ir_inner_tcp_seq = ntohl(tcp->th_seq); } } else { resp->ir_inner_data = rxbuf + poffset; resp->ir_inner_datalen = pbuflen - poffset; } /* * check for ICMP extensions * * the length of the message must be at least padded out to 128 bytes, * and must have 4 bytes of header beyond that for there to be * extensions included. * RFC 4884 says that the first 4 bits of the extension header * corresponds to a version number, and the version is two. But * it appears some systems have the version in the subsequent 4 bits. */ if(pbuflen - (iphl+8) > 128 + 4) { ext = rxbuf + (iphl + 8 + 128); extlen = pbuflen - (iphl + 8 + 128); if(((ext[0] & 0xf0) == 0x20 || ext[0] == 0x02) && ((ext[2] == 0 && ext[3] == 0) || in_cksum(ext, extlen) == 0)) { resp->ir_ext = memdup(ext, extlen); resp->ir_extlen = extlen; } } return 0; } scamper_debug(__func__, "packet not ours"); return -1; } void scamper_icmp4_read_cb(const int fd, void *param) { scamper_icmp_resp_t ir; memset(&ir, 0, sizeof(ir)); if(scamper_icmp4_recv(fd, &ir) == 0) scamper_icmp_resp_handle(&ir); scamper_icmp_resp_clean(&ir); return; } void scamper_icmp4_cleanup() { if(txbuf != NULL) { free(txbuf); txbuf = NULL; } return; } void scamper_icmp4_close(int fd) { #ifndef _WIN32 close(fd); #else closesocket(fd); #endif return; } int scamper_icmp4_open_fd(void) { int opt = 1, fd; if((fd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) == -1) { printerror(__func__, "could not open ICMP socket"); goto err; } if(setsockopt(fd, IPPROTO_IP, IP_HDRINCL, (void *)&opt, sizeof(opt)) == -1) { printerror(__func__, "could not set IP_HDRINCL"); goto err; } return fd; err: if(fd != -1) scamper_icmp4_close(fd); return -1; } int scamper_icmp4_open(const void *addr) { struct sockaddr_in sin; char tmp[32]; int fd, opt; #if defined(ICMP_FILTER) struct icmp_filter filter; #endif #if defined(WITHOUT_PRIVSEP) fd = scamper_icmp4_open_fd(); #else fd = scamper_privsep_open_icmp(AF_INET); #endif if(fd == -1) return -1; opt = 65535 + 128; if(setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *)&opt, sizeof(opt)) == -1) { printerror(__func__, "could not set SO_RCVBUF"); goto err; } opt = 65535 + 128; if(setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *)&opt, sizeof(opt)) == -1) { printerror(__func__, "could not set SO_SNDBUF"); goto err; } #if defined(SO_TIMESTAMP) opt = 1; if(setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP, &opt, sizeof(opt)) == -1) { printerror(__func__, "could not set SO_TIMESTAMP"); goto err; } #endif /* * on linux systems with ICMP_FILTER defined, filter all messages except * destination unreachable and time exceeded messages */ #if defined(ICMP_FILTER) filter.data = ~((1 << ICMP_DEST_UNREACH) | (1 << ICMP_TIME_EXCEEDED) | (1 << ICMP_ECHOREPLY) | (1 << ICMP_TSTAMPREPLY) | (1 << ICMP_PARAMPROB) ); if(setsockopt(fd, SOL_RAW, ICMP_FILTER, &filter, sizeof(filter)) == -1) { printerror(__func__, "could not set ICMP_FILTER"); goto err; } #endif if(addr != NULL) { sockaddr_compose((struct sockaddr *)&sin, AF_INET, addr, 0); if(bind(fd, (struct sockaddr *)&sin, sizeof(sin)) != 0) { printerror(__func__, "could not bind %s", sockaddr_tostr((struct sockaddr *)&sin,tmp,sizeof(tmp))); goto err; } } return fd; err: if(fd != -1) scamper_icmp4_close(fd); return -1; } scamper-cvs-20171204/scamper/scamper_icmp4.h000644 001751 000000 00000002666 12516265335 020466 0ustar00mjlwheel000000 000000 /* * scamper_icmp4.h * * $Id: scamper_icmp4.h,v 1.20 2015/04/23 21:57:49 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2009 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_ICMP4_H #define __SCAMPER_ICMP4_H int scamper_icmp4_open(const void *addr); int scamper_icmp4_open_fd(void); void scamper_icmp4_close(int fd); void scamper_icmp4_cleanup(void); void scamper_icmp4_read_cb(const int fd, void *param); #ifdef __SCAMPER_PROBE_H int scamper_icmp4_probe(scamper_probe_t *probe); int scamper_icmp4_build(scamper_probe_t *probe, uint8_t *buf, size_t *len); uint16_t scamper_icmp4_cksum(scamper_probe_t *probe); #endif #ifdef __SCAMPER_ICMP_RESP_H int scamper_icmp4_recv(int fd, scamper_icmp_resp_t *resp); #endif #endif /* __SCAMPER_ICMP4_H */ scamper-cvs-20171204/scamper/scamper_icmp6.c000644 001751 000000 00000041531 13210743023 020440 0ustar00mjlwheel000000 000000 /* * scamper_icmp6.c * * $Id: scamper_icmp6.c,v 1.99 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_icmp6.c,v 1.99 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_dl.h" #include "scamper_probe.h" #include "scamper_icmp_resp.h" #include "scamper_ip6.h" #include "scamper_icmp6.h" #include "scamper_privsep.h" #include "scamper_debug.h" #include "utils.h" static uint8_t *txbuf = NULL; static size_t txbuf_len = 0; static uint8_t rxbuf[65536]; static void icmp6_header(scamper_probe_t *probe, uint8_t *buf) { buf[0] = probe->pr_icmp_type; buf[1] = 0; buf[2] = 0; buf[3] = 0; switch(probe->pr_icmp_type) { case ICMP6_ECHO_REQUEST: case ICMP6_ECHO_REPLY: bytes_htons(buf+4, probe->pr_icmp_id); bytes_htons(buf+6, probe->pr_icmp_seq); break; case ICMP6_PACKET_TOO_BIG: bytes_htonl(buf+4, probe->pr_icmp_mtu); break; default: memset(buf+4, 0, 4); break; } return; } uint16_t scamper_icmp6_cksum(scamper_probe_t *probe) { uint8_t hdr[8]; uint16_t tmp, *w; int i, sum = 0; /* * the ICMP6 checksum includes a checksum calculated over a psuedo header * that includes the src and dst IP addresses, the protocol tyoe, and * the ICMP6 length. this is a departure from the ICMPv4 checksum, which * was only over the payload of the packet */ w = (uint16_t *)probe->pr_ip_src->addr; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; w = (uint16_t *)probe->pr_ip_dst->addr; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += htons(probe->pr_len + 8); sum += htons(IPPROTO_ICMPV6); /* ICMP header */ icmp6_header(probe, hdr); w = (uint16_t *)hdr; for(i=0; i<8; i+=2) sum += *w++; /* payload */ w = (uint16_t *)probe->pr_data; for(i = probe->pr_len; i > 1; i -= 2) sum += *w++; if(i != 0) sum += ((uint8_t *)w)[0]; /* fold the checksum */ sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); if((tmp = ~sum) == 0) { tmp = 0xffff; } return tmp; } int scamper_icmp6_build(scamper_probe_t *probe, uint8_t *buf, size_t *len) { struct ip6_hdr *ip6; struct icmp6_hdr *icmp; size_t ip6hlen, req, icmp6hlen; /* * build the IPv6 header; pass in the total buffer space available in * the ip6hlen parameter. when this function returns, that value is * replaced by the length of the IPv6 header including any options */ ip6hlen = *len; scamper_ip6_build(probe, buf, &ip6hlen); /* currently, we only understand how to build ICMP6 echo packets */ icmp6hlen = 8; /* calculate the total number of bytes required for this packet */ req = ip6hlen + icmp6hlen + probe->pr_len; if(req <= *len) { /* * calculate and record the ip6_plen value. * any IPv6 extension headers present are considered part of the payload */ ip6 = (struct ip6_hdr *)buf; ip6->ip6_plen = htons(ip6hlen - 40 + icmp6hlen + probe->pr_len); /* build the icmp6 header */ icmp = (struct icmp6_hdr *)(buf + ip6hlen); icmp6_header(probe, buf+ip6hlen); /* if there is data to include in the payload, copy it in now */ if(probe->pr_len > 0) { memcpy(buf + ip6hlen + icmp6hlen, probe->pr_data, probe->pr_len); } /* compute the ICMP6 checksum */ icmp->icmp6_cksum = scamper_icmp6_cksum(probe); *len = req; return 0; } *len = req; return -1; } int scamper_icmp6_probe(scamper_probe_t *probe) { struct sockaddr_in6 sin6; struct icmp6_hdr *icmp; char addr[128]; size_t len, icmphdrlen; int i; assert(probe != NULL); assert(probe->pr_ip_proto == IPPROTO_ICMPV6); assert(probe->pr_ip_dst != NULL); assert(probe->pr_ip_src != NULL); assert(probe->pr_len > 0 || probe->pr_data == NULL); if(probe->pr_icmp_type != ICMP6_ECHO_REQUEST) { probe->pr_errno = EINVAL; return -1; } icmphdrlen = (1 + 1 + 2 + 2 + 2); len = probe->pr_len + icmphdrlen; i = probe->pr_ip_ttl; if(setsockopt(probe->pr_fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, (char *)&i, sizeof(i)) == -1) { printerror(__func__, "could not set hlim to %d", i); return -1; } if(txbuf_len < len) { if(realloc_wrap((void **)&txbuf, len) != 0) { printerror(__func__, "could not realloc"); return -1; } txbuf_len = len; } icmp = (struct icmp6_hdr *)txbuf; icmp->icmp6_type = probe->pr_icmp_type; icmp->icmp6_code = probe->pr_icmp_code; icmp->icmp6_cksum = 0; icmp->icmp6_id = htons(probe->pr_icmp_id); icmp->icmp6_seq = htons(probe->pr_icmp_seq); /* if there is data to include in the payload, copy it in now */ if(probe->pr_len > 0) { memcpy(txbuf + icmphdrlen, probe->pr_data, probe->pr_len); } sockaddr_compose((struct sockaddr *)&sin6, AF_INET6, probe->pr_ip_dst->addr, 0); /* get the transmit time immediately before we send the packet */ gettimeofday_wrap(&probe->pr_tx); i = sendto(probe->pr_fd, txbuf, len, 0, (struct sockaddr *)&sin6, sizeof(struct sockaddr_in6)); if(i < 0) { /* error condition, could not send the packet at all */ probe->pr_errno = errno; printerror(__func__, "could not send to %s (%d ttl, %d seq, %d len)", scamper_addr_tostr(probe->pr_ip_dst, addr, sizeof(addr)), probe->pr_ip_ttl, probe->pr_icmp_seq, len); return -1; } else if((size_t)i != len) { /* error condition, sent a portion of the probe */ printerror_msg(__func__, "sent %d bytes of %d byte packet to %s", i, (int)len, scamper_addr_tostr(probe->pr_ip_dst, addr, sizeof(addr))); return -1; } return 0; } /* * icmp6_recv_ip_outer * * copy the outer-details of the ICMP6 message into the response structure. * get details of when the packet was received. */ static void icmp6_recv_ip_outer(int fd, scamper_icmp_resp_t *resp, #ifndef _WIN32 struct msghdr *msg, #endif struct icmp6_hdr *icmp, struct sockaddr_in6 *from, size_t size) { int16_t hlim = -1; #if (defined(IPV6_HOPLIMIT) || defined(SO_TIMESTAMP)) && !defined(_WIN32) /* get the HLIM field of the ICMP6 packet returned */ struct cmsghdr *cm; /* * RFC 2292: * this should be taken care of by CMSG_FIRSTHDR, but not always is. */ if(msg->msg_controllen >= sizeof(struct cmsghdr)) { cm = (struct cmsghdr *)CMSG_FIRSTHDR(msg); while(cm != NULL) { #if defined(IPV6_HOPLIMIT) if(cm->cmsg_level == IPPROTO_IPV6 && cm->cmsg_type == IPV6_HOPLIMIT) hlim = *((uint8_t *)CMSG_DATA(cm)); #endif #if defined(SO_TIMESTAMP) if(cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_TIMESTAMP) { timeval_cpy(&resp->ir_rx, (struct timeval *)CMSG_DATA(cm)); resp->ir_flags |= SCAMPER_ICMP_RESP_FLAG_KERNRX; } #endif cm = (struct cmsghdr *)CMSG_NXTHDR(msg, cm); } } #endif #if defined(SIOCGSTAMP) if((resp->ir_flags & SCAMPER_ICMP_RESP_FLAG_KERNRX) == 0) { if(ioctl(fd, SIOCGSTAMP, &resp->ir_rx) != -1) resp->ir_flags |= SCAMPER_ICMP_RESP_FLAG_KERNRX; } #endif if((resp->ir_flags & SCAMPER_ICMP_RESP_FLAG_KERNRX) == 0) gettimeofday_wrap(&resp->ir_rx); memcpy(&resp->ir_ip_src.v6, &from->sin6_addr, sizeof(struct in6_addr)); resp->ir_af = AF_INET6; resp->ir_icmp_type = icmp->icmp6_type; resp->ir_icmp_code = icmp->icmp6_code; resp->ir_ip_hlim = hlim; resp->ir_ip_size = size; return; } /* * scamper_icmp6_recv * * handle receiving an ICMPv6 packet. * * if the packet is an ICMP response that we should concern ourselves with * (i.e. it is in response to one of our probes) then we fill out * the attached icmp_response structure and return zero. * * if we should ignore this packet, or an error condition occurs, then * we return -1. */ int scamper_icmp6_recv(int fd, scamper_icmp_resp_t *resp) { struct sockaddr_in6 from; ssize_t poffset; ssize_t pbuflen; struct icmp6_hdr *icmp, *icmpq; struct ip6_hdr *ip; struct ip6_frag *frag; struct udphdr *udp; struct tcphdr *tcp; uint8_t type, code; uint8_t nh; uint8_t *ext; ssize_t extlen; #ifndef _WIN32 uint8_t ctrlbuf[256]; struct msghdr msg; struct iovec iov; memset(&iov, 0, sizeof(iov)); iov.iov_base = (caddr_t)rxbuf; iov.iov_len = sizeof(rxbuf); msg.msg_name = (caddr_t)&from; msg.msg_namelen = sizeof(from); msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = (caddr_t)ctrlbuf; msg.msg_controllen = sizeof(ctrlbuf); if((pbuflen = recvmsg(fd, &msg, 0)) == -1) { printerror(__func__, "could not recvmsg"); return -1; } #endif #ifdef _WIN32 socklen_t fromlen = sizeof(from); if((pbuflen = recvfrom(fd, rxbuf, sizeof(rxbuf), 0, (struct sockaddr *)&from, &fromlen)) < 0) { printerror(__func__, "could not recvfrom"); return -1; } #endif icmp = (struct icmp6_hdr *)rxbuf; if(pbuflen < (ssize_t)sizeof(struct icmp6_hdr)) { return -1; } type = icmp->icmp6_type; code = icmp->icmp6_code; /* check to see if the ICMP type / code is what we want */ if((type != ICMP6_TIME_EXCEEDED || code != ICMP6_TIME_EXCEED_TRANSIT) && type != ICMP6_DST_UNREACH && type != ICMP6_PACKET_TOO_BIG && type != ICMP6_ECHO_REPLY) { scamper_debug(__func__,"ICMP6 type %d / code %d not wanted", type, code); return -1; } poffset = sizeof(struct icmp6_hdr); ip = (struct ip6_hdr *)(rxbuf + poffset); memset(resp, 0, sizeof(scamper_icmp_resp_t)); resp->ir_fd = fd; if(type == ICMP6_ECHO_REPLY) { resp->ir_icmp_id = ntohs(icmp->icmp6_id); resp->ir_icmp_seq = ntohs(icmp->icmp6_seq); memcpy(&resp->ir_inner_ip_dst.v6, &from.sin6_addr, sizeof(struct in6_addr)); #ifndef _WIN32 icmp6_recv_ip_outer(fd,resp,&msg,icmp,&from, pbuflen + sizeof(struct ip6_hdr)); #else icmp6_recv_ip_outer(fd,resp,icmp,&from,pbuflen+sizeof(struct ip6_hdr)); #endif return 0; } nh = ip->ip6_nxt; poffset += sizeof(struct ip6_hdr); /* search for a ICMP / UDP / TCP header in this packet */ while(poffset + 8 <= pbuflen) { if(nh != IPPROTO_UDP && nh != IPPROTO_ICMPV6 && nh != IPPROTO_TCP && nh != IPPROTO_FRAGMENT) { scamper_debug(__func__, "unhandled next header %d", nh); return -1; } resp->ir_flags |= SCAMPER_ICMP_RESP_FLAG_INNER_IP; if(nh == IPPROTO_UDP) { udp = (struct udphdr *)(rxbuf+poffset); resp->ir_inner_udp_sport = ntohs(udp->uh_sport); resp->ir_inner_udp_dport = ntohs(udp->uh_dport); resp->ir_inner_udp_sum = udp->uh_sum; } else if(nh == IPPROTO_ICMPV6) { icmpq = (struct icmp6_hdr *)(rxbuf+poffset); resp->ir_inner_icmp_type = icmpq->icmp6_type; resp->ir_inner_icmp_code = icmpq->icmp6_code; resp->ir_inner_icmp_sum = icmpq->icmp6_cksum; resp->ir_inner_icmp_id = ntohs(icmpq->icmp6_id); resp->ir_inner_icmp_seq = ntohs(icmpq->icmp6_seq); } else if(nh == IPPROTO_TCP) { tcp = (struct tcphdr *)(rxbuf+poffset); resp->ir_inner_tcp_sport = ntohs(tcp->th_sport); resp->ir_inner_tcp_dport = ntohs(tcp->th_dport); resp->ir_inner_tcp_seq = ntohl(tcp->th_seq); } else if(nh == IPPROTO_FRAGMENT) { frag = (struct ip6_frag *)(rxbuf+poffset); resp->ir_inner_ip_proto = nh = frag->ip6f_nxt; resp->ir_inner_ip_off = ntohs(frag->ip6f_offlg) >> 3; resp->ir_inner_ip_id = ntohl(frag->ip6f_ident); poffset += 8; if(resp->ir_inner_ip_off == 0) continue; resp->ir_inner_data = rxbuf + poffset; resp->ir_inner_datalen = pbuflen - poffset; } /* record details of the IP header and the ICMP headers */ #ifndef _WIN32 icmp6_recv_ip_outer(fd,resp,&msg,icmp,&from, pbuflen + sizeof(struct ip6_hdr)); #else icmp6_recv_ip_outer(fd,resp,icmp,&from,pbuflen+sizeof(struct ip6_hdr)); #endif memcpy(&resp->ir_inner_ip_dst.v6, &ip->ip6_dst, sizeof(struct in6_addr)); resp->ir_inner_ip_proto = nh; resp->ir_inner_ip_hlim = ip->ip6_hlim; resp->ir_inner_ip_size = ntohs(ip->ip6_plen) + sizeof(struct ip6_hdr); resp->ir_inner_ip_flow = ntohl(ip->ip6_flow) & 0xfffff; if(type == ICMP6_PACKET_TOO_BIG) resp->ir_icmp_nhmtu = (ntohl(icmp->icmp6_mtu) % 0xffff); /* * check for ICMP extensions * * the length of the message must be at least padded out to 128 bytes, * and must have 4 bytes of header beyond that for there to be * extensions included */ if(pbuflen - 8 > 128 + 4) { ext = rxbuf + (8 + 128); extlen = pbuflen - (8 + 128); if((ext[0] & 0xf0) == 0x20 && ((ext[2] == 0 && ext[3] == 0) || in_cksum(ext, extlen) == 0)) { resp->ir_ext = memdup(ext, extlen); resp->ir_extlen = extlen; } } return 0; } return -1; } void scamper_icmp6_read_cb(const int fd, void *param) { scamper_icmp_resp_t ir; memset(&ir, 0, sizeof(ir)); if(scamper_icmp6_recv(fd, &ir) == 0) scamper_icmp_resp_handle(&ir); scamper_icmp_resp_clean(&ir); return; } void scamper_icmp6_cleanup() { if(txbuf != NULL) { free(txbuf); txbuf = NULL; } return; } void scamper_icmp6_close(int fd) { #ifndef _WIN32 close(fd); #else closesocket(fd); #endif return; } int scamper_icmp6_open_fd(void) { return socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); } int scamper_icmp6_open(const void *addr) { struct sockaddr_in6 sin6; int fd, opt; #if defined(ICMP6_FILTER) struct icmp6_filter filter; #endif #if defined(WITHOUT_PRIVSEP) fd = scamper_icmp6_open_fd(); #else fd = scamper_privsep_open_icmp(AF_INET6); #endif if(fd == -1) goto err; opt = 65535 + 128; if(setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&opt, sizeof(opt)) == -1) { printerror(__func__, "could not SO_RCVBUF"); goto err; } opt = 65535 + 128; if(setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&opt, sizeof(opt)) == -1) { printerror(__func__, "could not SO_SNDBUF"); return -1; } #if defined(SO_TIMESTAMP) opt = 1; if(setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP, &opt, sizeof(opt)) == -1) { printerror(__func__, "could not set SO_TIMESTAMP"); goto err; } #endif #if defined(ICMP6_FILTER) /* * if the operating system has filtering capabilities for the ICMP6 * raw socket, then install a filter that passes the three ICMP message * types that scamper cares about / processes. */ ICMP6_FILTER_SETBLOCKALL(&filter); ICMP6_FILTER_SETPASS(ICMP6_DST_UNREACH, &filter); ICMP6_FILTER_SETPASS(ICMP6_PACKET_TOO_BIG, &filter); ICMP6_FILTER_SETPASS(ICMP6_TIME_EXCEEDED, &filter); ICMP6_FILTER_SETPASS(ICMP6_ECHO_REPLY, &filter); if(setsockopt(fd,IPPROTO_ICMPV6,ICMP6_FILTER,&filter,sizeof(filter)) == -1) { printerror(__func__, "could not IPV6_FILTER"); goto err; } #endif #if defined(IPV6_DONTFRAG) opt = 1; if(setsockopt(fd,IPPROTO_IPV6,IPV6_DONTFRAG,(char *)&opt, sizeof(opt)) == -1) { printerror(__func__, "could not set IPV6_DONTFRAG"); goto err; } #endif /* * ask the icmp6 socket to supply the TTL of any packet it receives * so that scamper might be able to infer the length of the reverse path */ #if defined(IPV6_RECVHOPLIMIT) opt = 1; if(setsockopt(fd, IPPROTO_IPV6,IPV6_RECVHOPLIMIT, &opt,sizeof(opt)) == -1) { printerror(__func__, "could not set IPV6_RECVHOPLIMIT"); } #elif defined(IPV6_HOPLIMIT) opt = 1; if(setsockopt(fd,IPPROTO_IPV6,IPV6_HOPLIMIT,(char *)&opt,sizeof(opt)) == -1) { printerror(__func__, "could not set IPV6_HOPLIMIT"); } #endif if(addr != NULL) { sockaddr_compose((struct sockaddr *)&sin6, AF_INET6, addr, 0); if(bind(fd, (struct sockaddr *)&sin6, sizeof(sin6)) != 0) { printerror(__func__, "could not bind"); goto err; } } return fd; err: if(fd != -1) scamper_icmp6_close(fd); return -1; } scamper-cvs-20171204/scamper/scamper_icmp6.h000644 001751 000000 00000002666 12516265335 020470 0ustar00mjlwheel000000 000000 /* * scamper_icmp6.h * * $Id: scamper_icmp6.h,v 1.20 2015/04/23 21:57:49 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2009 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_ICMP6_H #define __SCAMPER_ICMP6_H int scamper_icmp6_open(const void *addr); int scamper_icmp6_open_fd(void); void scamper_icmp6_close(int fd); void scamper_icmp6_cleanup(void); void scamper_icmp6_read_cb(const int fd, void *param); #ifdef __SCAMPER_PROBE_H int scamper_icmp6_probe(scamper_probe_t *probe); int scamper_icmp6_build(scamper_probe_t *probe, uint8_t *buf, size_t *len); uint16_t scamper_icmp6_cksum(scamper_probe_t *probe); #endif #ifdef __SCAMPER_ICMP_RESP_H int scamper_icmp6_recv(int fd, scamper_icmp_resp_t *resp); #endif #endif /* __SCAMPER_ICMP6_H */ scamper-cvs-20171204/scamper/scamper_icmp_resp.c000644 001751 000000 00000025442 12767231350 021421 0ustar00mjlwheel000000 000000 /* * scamper_icmp_resp.c * * $Id: scamper_icmp_resp.c,v 1.33 2016/09/17 12:11:20 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2013 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_icmp_resp.c,v 1.33 2016/09/17 12:11:20 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "utils.h" #include "scamper_addr.h" #include "scamper_task.h" #include "scamper_icmp_resp.h" #include "scamper_debug.h" #if !defined(NDEBUG) || !defined(WITHOUT_DEBUGFILE) void scamper_icmp_resp_print(const scamper_icmp_resp_t *ir) { char *t = NULL, tbuf[64]; char *c = NULL, cbuf[64]; char addr[64]; char ip[256]; char icmp[256]; char inner_ip[256]; char inner_transport[256]; char ext[256]; int i, j; size_t off; assert(ir->ir_af == AF_INET || ir->ir_af == AF_INET6); if(ir->ir_af == AF_INET) { addr_tostr(AF_INET, &ir->ir_ip_src.v4, addr, sizeof(addr)); off = 0; string_concat(ip, sizeof(ip), &off, "from %s size %d ttl %d tos 0x%02x ipid 0x%04x", addr, ir->ir_ip_size, ir->ir_ip_ttl, ir->ir_ip_tos, ir->ir_ip_id); if(ir->ir_ipopt_rrc > 0) string_concat(ip, sizeof(ip), &off, " rr %d", ir->ir_ipopt_rrc); switch(ir->ir_icmp_type) { case ICMP_UNREACH: t = "unreach"; switch(ir->ir_icmp_code) { case ICMP_UNREACH_NET: c = "net"; break; case ICMP_UNREACH_HOST: c = "host"; break; case ICMP_UNREACH_PROTOCOL: c = "protocol"; break; case ICMP_UNREACH_PORT: c = "port"; break; case ICMP_UNREACH_SRCFAIL: c = "src-rt failed"; break; case ICMP_UNREACH_NET_UNKNOWN: c = "net unknown"; break; case ICMP_UNREACH_HOST_UNKNOWN: c = "host unknown"; break; case ICMP_UNREACH_ISOLATED: c = "isolated"; break; case ICMP_UNREACH_NET_PROHIB: c = "net prohib"; break; case ICMP_UNREACH_HOST_PROHIB: c = "host prohib"; break; case ICMP_UNREACH_TOSNET: c = "tos net"; break; case ICMP_UNREACH_TOSHOST: c = "tos host"; break; case ICMP_UNREACH_FILTER_PROHIB: c = "admin prohib"; break; case ICMP_UNREACH_NEEDFRAG: /* * use the type buf to be consistent with the ICMP6 * fragmentation required message */ snprintf(tbuf, sizeof(tbuf), "need frag %d", ir->ir_icmp_nhmtu); t = tbuf; break; default: snprintf(cbuf, sizeof(cbuf), "code %d", ir->ir_icmp_code); c = cbuf; break; } break; case ICMP_TIMXCEED: t = "time exceeded"; switch(ir->ir_icmp_code) { case ICMP_TIMXCEED_INTRANS: c = "in trans"; break; case ICMP_TIMXCEED_REASS: c = "in reass"; break; default: snprintf(cbuf, sizeof(cbuf), "code %d", ir->ir_icmp_code); c = cbuf; break; } break; case ICMP_ECHOREPLY: t = "echo reply"; snprintf(cbuf, sizeof(cbuf), "id %d seq %d", ir->ir_icmp_id, ir->ir_icmp_seq); c = cbuf; break; case ICMP_TSTAMPREPLY: t = "ts reply"; snprintf(cbuf, sizeof(cbuf), "id %d seq %d", ir->ir_icmp_id, ir->ir_icmp_seq); c = cbuf; break; case ICMP_PARAMPROB: t = "paramprob"; switch(ir->ir_icmp_code) { case ICMP_PARAMPROB_ERRATPTR: snprintf(cbuf, sizeof(cbuf), "erratptr %u", ir->ir_icmp_pptr); c = cbuf; break; case ICMP_PARAMPROB_OPTABSENT: c = "optabsent"; break; case ICMP_PARAMPROB_LENGTH: c = "length"; break; default: snprintf(cbuf, sizeof(cbuf), "code %d", ir->ir_icmp_code); c = cbuf; break; } break; } } else /* if(ir->ir_af == AF_INET6) */ { addr_tostr(AF_INET6, &ir->ir_ip_src.v6, addr, sizeof(addr)); snprintf(ip, sizeof(ip), "from %s size %d hlim %d", addr, ir->ir_ip_size, ir->ir_ip_hlim); switch(ir->ir_icmp_type) { case ICMP6_DST_UNREACH: t = "unreach"; switch(ir->ir_icmp_code) { case ICMP6_DST_UNREACH_NOROUTE: c = "no route"; break; case ICMP6_DST_UNREACH_ADMIN: c = "admin prohib"; break; case ICMP6_DST_UNREACH_BEYONDSCOPE: c = "beyond scope"; break; case ICMP6_DST_UNREACH_ADDR: c = "addr"; break; case ICMP6_DST_UNREACH_NOPORT: c = "port"; break; default: snprintf(cbuf, sizeof(cbuf), "code %d", ir->ir_icmp_code); c = cbuf; break; } break; case ICMP6_TIME_EXCEEDED: t = "time exceeded"; switch(ir->ir_icmp_code) { case ICMP6_TIME_EXCEED_TRANSIT: c = "in trans"; break; case ICMP6_TIME_EXCEED_REASSEMBLY: c = "in reass"; break; default: snprintf(cbuf, sizeof(cbuf), "code %d", ir->ir_icmp_code); c = cbuf; break; } break; case ICMP6_PACKET_TOO_BIG: snprintf(tbuf, sizeof(tbuf), "need frag %d", ir->ir_icmp_nhmtu); t = tbuf; break; case ICMP6_ECHO_REPLY: t = "echo reply"; snprintf(cbuf, sizeof(cbuf), "id %d seq %d", ir->ir_icmp_id, ir->ir_icmp_seq); c = cbuf; break; } } if(t == NULL) { snprintf(icmp, sizeof(icmp), "icmp %d code %d", ir->ir_icmp_type, ir->ir_icmp_code); } else if(c == NULL) { snprintf(icmp, sizeof(icmp), "icmp %s", t); } else { snprintf(icmp, sizeof(icmp), "icmp %s %s", t, c); } if(ir->ir_flags & SCAMPER_ICMP_RESP_FLAG_INNER_IP) { if(ir->ir_af == AF_INET) { addr_tostr(AF_INET, &ir->ir_inner_ip_dst.v4, addr, sizeof(addr)); off = 0; string_concat(inner_ip, sizeof(inner_ip), &off, " to %s size %d ttl %d tos 0x%02x ipid 0x%04x", addr, ir->ir_inner_ip_size, ir->ir_inner_ip_ttl, ir->ir_inner_ip_tos, ir->ir_inner_ip_id); if(ir->ir_inner_ipopt_rrc > 0) string_concat(inner_ip, sizeof(inner_ip), &off, " rr %d", ir->ir_inner_ipopt_rrc); } else /* if(ir->ir_af == AF_INET6) */ { addr_tostr(AF_INET6, &ir->ir_inner_ip_dst.v6, addr, sizeof(addr)); snprintf(inner_ip, sizeof(inner_ip), " to %s size %d hlim %d flow 0x%05x", addr, ir->ir_inner_ip_size, ir->ir_inner_ip_hlim, ir->ir_inner_ip_flow); } switch(ir->ir_inner_ip_proto) { case IPPROTO_UDP: snprintf(inner_transport, sizeof(inner_transport), " proto UDP sport %d dport %d sum 0x%04x", ir->ir_inner_udp_sport, ir->ir_inner_udp_dport, ntohs(ir->ir_inner_udp_sum)); break; case IPPROTO_ICMP: case IPPROTO_ICMPV6: snprintf(inner_transport, sizeof(inner_transport), " proto ICMP type %d code %d id %04x seq %d sum %04x", ir->ir_inner_icmp_type, ir->ir_inner_icmp_code, ir->ir_inner_icmp_id, ir->ir_inner_icmp_seq, ntohs(ir->ir_inner_icmp_sum)); break; case IPPROTO_TCP: snprintf(inner_transport, sizeof(inner_transport), " proto TCP sport %d dport %d seq %08x", ir->ir_inner_tcp_sport, ir->ir_inner_tcp_dport, ir->ir_inner_tcp_seq); break; default: inner_transport[0] = '\0'; break; } } else { inner_ip[0] = '\0'; inner_transport[0] = '\0'; } if(ir->ir_ext != NULL) { snprintf(ext, sizeof(ext), " icmp-ext"); j = 9; for(i=0; iir_extlen; i++) { if(i % 4 == 0) { if(sizeof(ext)-j < 4) break; ext[j++] = ' '; } else if(sizeof(ext)-j < 3) break; byte2hex(ir->ir_ext[i], ext + j); j += 2; } ext[j] = '\0'; } else { ext[0] = '\0'; } scamper_debug(NULL, "%s %s%s%s%s", ip, icmp, inner_ip, inner_transport, ext); return; } #endif int scamper_icmp_resp_src(scamper_icmp_resp_t *resp, scamper_addr_t *addr) { if(resp->ir_af == AF_INET) { addr->type = SCAMPER_ADDR_TYPE_IPV4; addr->addr = &resp->ir_ip_src.v4; return 0; } else if(resp->ir_af == AF_INET6) { addr->type = SCAMPER_ADDR_TYPE_IPV6; addr->addr = &resp->ir_ip_src.v6; return 0; } return -1; } int scamper_icmp_resp_inner_dst(scamper_icmp_resp_t *resp,scamper_addr_t *addr) { if(resp->ir_af == AF_INET) { addr->type = SCAMPER_ADDR_TYPE_IPV4; addr->addr = &resp->ir_inner_ip_dst.v4; return 0; } else if(resp->ir_af == AF_INET6) { addr->type = SCAMPER_ADDR_TYPE_IPV6; addr->addr = &resp->ir_inner_ip_dst.v6; return 0; } return -1; } void scamper_icmp_resp_clean(scamper_icmp_resp_t *ir) { if(ir->ir_ext != NULL) free(ir->ir_ext); if(ir->ir_ipopt_rrs != NULL) free(ir->ir_ipopt_rrs); if(ir->ir_ipopt_tsips != NULL) free(ir->ir_ipopt_tsips); if(ir->ir_ipopt_tstss != NULL) free(ir->ir_ipopt_tstss); if(ir->ir_inner_ipopt_rrs != NULL) free(ir->ir_inner_ipopt_rrs); if(ir->ir_inner_ipopt_tsips != NULL) free(ir->ir_inner_ipopt_tsips); if(ir->ir_inner_ipopt_tstss != NULL) free(ir->ir_inner_ipopt_tstss); return; } void scamper_icmp_resp_handle(scamper_icmp_resp_t *resp) { scamper_task_sig_t sig; scamper_task_t *task; scamper_addr_t addr; if(SCAMPER_ICMP_RESP_IS_TTL_EXP(resp) || SCAMPER_ICMP_RESP_IS_UNREACH(resp) || SCAMPER_ICMP_RESP_IS_PACKET_TOO_BIG(resp) || SCAMPER_ICMP_RESP_IS_PARAMPROB(resp)) { /* the probe signature is embedded in the response */ if(!SCAMPER_ICMP_RESP_INNER_IS_SET(resp)) return; if(scamper_icmp_resp_inner_dst(resp, &addr) != 0) return; } else if(SCAMPER_ICMP_RESP_IS_ECHO_REPLY(resp) || SCAMPER_ICMP_RESP_IS_TIME_REPLY(resp)) { /* the probe signature is an ICMP echo/ts request */ if(scamper_icmp_resp_src(resp, &addr) != 0) return; } else { return; } memset(&sig, 0, sizeof(sig)); sig.sig_type = SCAMPER_TASK_SIG_TYPE_TX_IP; sig.sig_tx_ip_dst = &addr; if((task = scamper_task_find(&sig)) != NULL) scamper_task_handleicmp(task, resp); return; } scamper-cvs-20171204/scamper/scamper_icmp_resp.h000644 001751 000000 00000020700 12767231506 021421 0ustar00mjlwheel000000 000000 /* * scamper_icmp_resp.h * * $Id: scamper_icmp_resp.h,v 1.31 2016/09/17 12:12:54 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2013 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_ICMP_RESP_H #define __SCAMPER_ICMP_RESP_H #define SCAMPER_ICMP_RESP_FLAG_KERNRX 0x01 #define SCAMPER_ICMP_RESP_FLAG_INNER_IP 0x02 #define SCAMPER_ICMP_RESP_FLAG_IPOPT_TS 0x04 #define SCAMPER_ICMP_RESP_FLAG_INNER_IPOPT_TS 0x08 #define SCAMPER_ICMP_RESP_IS_ECHO_REPLY(ir) ( \ (ir->ir_af == AF_INET && ir->ir_icmp_type == 0) || \ (ir->ir_af == AF_INET6 && ir->ir_icmp_type == 129)) #define SCAMPER_ICMP_RESP_IS_TIME_REPLY(ir) ( \ (ir->ir_af == AF_INET && ir->ir_icmp_type == 14)) #define SCAMPER_ICMP_RESP_IS_TTL_EXP(ir) ( \ (ir->ir_af == AF_INET && ir->ir_icmp_type == 11) || \ (ir->ir_af == AF_INET6 && ir->ir_icmp_type == 3)) #define SCAMPER_ICMP_RESP_IS_UNREACH(ir) ( \ (ir->ir_af == AF_INET && ir->ir_icmp_type == 3) || \ (ir->ir_af == AF_INET6 && ir->ir_icmp_type == 1)) #define SCAMPER_ICMP_RESP_IS_UNREACH_PORT(ir) ( \ (ir->ir_af == AF_INET && ir->ir_icmp_type == 3 && ir->ir_icmp_code == 3) || \ (ir->ir_af == AF_INET6 && ir->ir_icmp_type == 1 && ir->ir_icmp_code == 4)) #define SCAMPER_ICMP_RESP_IS_PACKET_TOO_BIG(ir) ( \ (ir->ir_af == AF_INET && ir->ir_icmp_type == 3 && ir->ir_icmp_code == 4) || \ (ir->ir_af == AF_INET6 && ir->ir_icmp_type == 2)) #define SCAMPER_ICMP_RESP_IS_PARAMPROB(ir) ( \ (ir->ir_af == AF_INET && ir->ir_icmp_type == 12)) /* this macro checks to see if the inner structs are valid */ #define SCAMPER_ICMP_RESP_INNER_IS_SET(ir) ( \ ((ir->ir_flags & SCAMPER_ICMP_RESP_FLAG_INNER_IP) != 0)) #define SCAMPER_ICMP_RESP_INNER_IS_ICMP(ir) ( \ (ir->ir_af == AF_INET && ir->ir_inner_ip_proto == 1) || \ (ir->ir_af == AF_INET6 && ir->ir_inner_ip_proto == 58)) #define SCAMPER_ICMP_RESP_INNER_IS_TCP(ir) ( \ (ir->ir_inner_ip_proto == 6)) #define SCAMPER_ICMP_RESP_INNER_IS_UDP(ir) ( \ (ir->ir_inner_ip_proto == 17)) #define SCAMPER_ICMP_RESP_INNER_IS_ICMP_ECHO_REQ(ir) ( \ (ir->ir_af == AF_INET && \ ir->ir_inner_ip_proto == 1 && ir->ir_inner_icmp_type == 8) || \ (ir->ir_af == AF_INET6 && \ ir->ir_inner_ip_proto == 58 && ir->ir_inner_icmp_type == 128)) #define SCAMPER_ICMP_RESP_INNER_IS_ICMP_TIME_REQ(ir) ( \ ir->ir_af == AF_INET && \ ir->ir_inner_ip_proto == 1 && ir->ir_inner_icmp_type == 13) /* * an ICMP response may consist of up to four pieces. when an ICMP * packet is received, scamper parses the packet and records values of * interest in this structure. * * the four pieces of interesting information can be broken up into the * following categories: * * 1. the IP header * 2. the ICMP header * 3. [optional] IP header of probe that caused this message * 4. [optional] transport header of probe that caused this message * * the optional pieces - the 'inner' IP and transport headers are found * depending on the type / code of the ICMP message. they are always * found in 'destination unreachable' type messages, but obviously * are not found in echo replies or the like. */ typedef struct scamper_icmp_resp { /* the address family (AF_INET / AF_INET6) of the response */ int ir_af; /* the icmp file descriptor the message was received on */ int ir_fd; /* when the ICMP response was received */ struct timeval ir_rx; /* flags, whose meanings are defined above */ uint8_t ir_flags; /* * category 1: the IP header; * * scamper records the source of the ICMP message but not the destination, * as that is the host scamper is running on, and that is not interesting. * * scamper also records the size, ttl, ipid, and tos fields of the * response */ union { struct in_addr v4; struct in6_addr v6; } ir_ip_src; uint16_t ir_ip_size; uint16_t ir_ip_id; uint8_t ir_ip_tos; int16_t ir_ip_ttl; /* ir_ip_hlim; -1 if unavailable */ /* * if the response includes the IPv4 record route option, IP addresses * are found here. */ struct in_addr *ir_ipopt_rrs; uint8_t ir_ipopt_rrc; /* * if the response includes the IPv4 timestamp option, the results of it * are found in here. */ uint8_t ir_ipopt_tsc; struct in_addr *ir_ipopt_tsips; uint32_t *ir_ipopt_tstss; /* * category 2: the ICMP header; * * scamper records the type and code of the ICMP message. depending on * the type of the message, optional ICMP id and sequence fields are * also recorded. if the message */ uint8_t ir_icmp_type; uint8_t ir_icmp_code; uint16_t ir_icmp_id; uint16_t ir_icmp_seq; uint16_t ir_icmp_nhmtu; uint8_t ir_icmp_pptr; uint32_t ir_icmp_tso; uint32_t ir_icmp_tsr; uint32_t ir_icmp_tst; /* * category 3: the inner IP header; * * if the ICMP type/code hints that a portion of the probe is included * in the ICMP response, then scamper records interesting portions of the * IP header. we don't record the source address, as that is the host * that scamper is running on, and that does not seem to be interesting. */ union { struct in_addr v4; struct in6_addr v6; } ir_inner_ip_dst; uint16_t ir_inner_ip_size; uint32_t ir_inner_ip_id; /* fragment id */ uint16_t ir_inner_ip_off; /* fragment offset, no bits */ uint32_t ir_inner_ip_flow; /* IPv6 flow */ uint8_t ir_inner_ip_tos; uint8_t ir_inner_ip_ttl; /* ir_inner_ip_hlim */ uint8_t ir_inner_ip_proto; struct in_addr *ir_inner_ipopt_rrs; uint8_t ir_inner_ipopt_rrc; uint8_t ir_inner_ipopt_tsc; struct in_addr *ir_inner_ipopt_tsips; uint32_t *ir_inner_ipopt_tstss; uint8_t *ir_inner_data; uint16_t ir_inner_datalen; /* * category 4: details of the transport header * * the IPv4 ICMP RFC says that if an ICMP error message */ union { struct irt_udp { uint16_t sport; uint16_t dport; uint16_t sum; } irit_udp; struct irt_tcp { uint16_t sport; uint16_t dport; uint32_t seq; } irit_tcp; struct irt_icmp { uint8_t type; uint8_t code; uint16_t sum; uint16_t id; uint16_t seq; } irit_icmp; } ir_inner_trans_un; uint8_t *ir_ext; uint16_t ir_extlen; } scamper_icmp_resp_t; #define ir_ip_hlim ir_ip_ttl #define ir_inner_ip_hlim ir_inner_ip_ttl #define ir_inner_udp_sport ir_inner_trans_un.irit_udp.sport #define ir_inner_udp_dport ir_inner_trans_un.irit_udp.dport #define ir_inner_udp_sum ir_inner_trans_un.irit_udp.sum #define ir_inner_tcp_sport ir_inner_trans_un.irit_tcp.sport #define ir_inner_tcp_dport ir_inner_trans_un.irit_tcp.dport #define ir_inner_tcp_seq ir_inner_trans_un.irit_tcp.seq #define ir_inner_icmp_type ir_inner_trans_un.irit_icmp.type #define ir_inner_icmp_code ir_inner_trans_un.irit_icmp.code #define ir_inner_icmp_sum ir_inner_trans_un.irit_icmp.sum #define ir_inner_icmp_id ir_inner_trans_un.irit_icmp.id #define ir_inner_icmp_seq ir_inner_trans_un.irit_icmp.seq int scamper_icmp_resp_src(scamper_icmp_resp_t *resp, scamper_addr_t *addr); int scamper_icmp_resp_inner_dst(scamper_icmp_resp_t *resp, scamper_addr_t *a); void scamper_icmp_resp_handle(scamper_icmp_resp_t *resp); void scamper_icmp_resp_clean(scamper_icmp_resp_t *ir); /* scamper only uses this function if it is built in debug mode */ #if !defined(NDEBUG) || !defined(WITHOUT_DEBUGFILE) void scamper_icmp_resp_print(const scamper_icmp_resp_t *resp); #else #define scamper_icmp_resp_print(resp) ((void)0) #endif #endif /* __SCAMPER_ICMP_RESP_H */ scamper-cvs-20171204/scamper/scamper_icmpext.c000644 001751 000000 00000007741 12346403264 021111 0ustar00mjlwheel000000 000000 /* * scamper_icmpext.c * * $Id: scamper_icmpext.c,v 1.9 2014/06/12 19:59:48 mjl Exp $ * * Copyright (C) 2008-2010 The University of Waikato * Copyright (C) 2012 Matthew Luckie * Copyright (C) 2014 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_icmpext.c,v 1.9 2014/06/12 19:59:48 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_icmpext.h" #include "utils.h" scamper_icmpext_t *scamper_icmpext_alloc(uint8_t cn, uint8_t ct, uint16_t dl, const void *data) { scamper_icmpext_t *ie; if((ie = malloc_zero(sizeof(scamper_icmpext_t))) == NULL) return NULL; if(dl != 0 && (ie->ie_data = memdup(data, dl)) == NULL) { free(ie); return NULL; } ie->ie_cn = cn; ie->ie_ct = ct; ie->ie_dl = dl; return ie; } void scamper_icmpext_free(scamper_icmpext_t *ie) { scamper_icmpext_t *next; while(ie != NULL) { next = ie->ie_next; if(ie->ie_data != NULL) free(ie->ie_data); free(ie); ie = next; } return; } int scamper_icmpext_parse(scamper_icmpext_t **exts, void *data, uint16_t len) { scamper_icmpext_t *ie, *next; uint8_t *u8 = data; uint16_t dl; uint8_t cn, ct; int off; *exts = NULL; next = *exts; /* start at offset 4 so the extension header is skipped */ for(off = 4; off + 4 < len; off += dl) { /* extract the length field */ memcpy(&dl, u8+off, 2); dl = ntohs(dl); /* make sure there is enough in the packet left */ if(off + dl < len) break; cn = u8[off+2]; ct = u8[off+3]; if(dl < 8) { continue; } if((ie = scamper_icmpext_alloc(cn, ct, dl-4, u8+off+4)) == NULL) { return -1; } if(next == NULL) { *exts = ie; } else { next->ie_next = ie; } next = ie; } return 0; } void scamper_icmpext_unnumbered_parse(scamper_icmpext_t *ie, scamper_icmpext_unnumbered_t *unn) { uint8_t *u8 = ie->ie_data; uint32_t off = 0; uint16_t u16; int i; memset(unn, 0, sizeof(scamper_icmpext_unnumbered_t)); for(i=4; i<=7; i++) { if(i == 4 && SCAMPER_ICMPEXT_UNNUMBERED_CT_IS_IFINDEX(ie)) { if(ie->ie_dl > off + 4) break; unn->ifindex = bytes_ntohl(u8 + off); unn->flags |= SCAMPER_ICMPEXT_UNNUMBERED_CT_IFINDEX; off += 4; } else if(i == 5 && SCAMPER_ICMPEXT_UNNUMBERED_CT_IS_IPADDR(ie)) { if(ie->ie_dl > off + 4) break; u16 = bytes_ntohs(u8 + off); off += 4; if(u16 == 1) { unn->af = AF_INET; u16 = 4; } else if(u16 == 2) { unn->af = AF_INET6; u16 = 16; } else break; if(ie->ie_dl > off + u16) break; unn->flags |= SCAMPER_ICMPEXT_UNNUMBERED_CT_IPADDR; memcpy(&unn->un.v6, u8 + off, u16); off += u16; } else if(i == 6 && SCAMPER_ICMPEXT_UNNUMBERED_CT_IS_NAME(ie)) { if(u8[off] > 64 || ie->ie_dl > off + u8[off]) break; unn->flags |= SCAMPER_ICMPEXT_UNNUMBERED_CT_NAME; memcpy(unn->name, &u8[off+1], u8[off]-1); unn->name[63] = 0; off += u8[off]; } else if(i == 7 && SCAMPER_ICMPEXT_UNNUMBERED_CT_IS_MTU(ie)) { if(ie->ie_dl > off + 4) break; unn->mtu = bytes_ntohl(u8 + off); unn->flags |= SCAMPER_ICMPEXT_UNNUMBERED_CT_MTU; off += 4; } } } scamper-cvs-20171204/scamper/scamper_icmpext.h000644 001751 000000 00000006623 12054753426 021120 0ustar00mjlwheel000000 000000 /* * scamper_icmpext.h * * $Id: scamper_icmpext.h,v 1.2 2012/11/26 20:54:46 mjl Exp $ * * Copyright (C) 2008 The University of Waikato * Copyright (C) 2012 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_ICMPEXT_H #define __SCAMPER_ICMPEXT_H /* * scamper_icmpext * * this structure holds an individual icmp extension */ typedef struct scamper_icmpext { uint8_t ie_cn; /* class number */ uint8_t ie_ct; /* class type */ uint16_t ie_dl; /* data length */ uint8_t *ie_data; /* data */ struct scamper_icmpext *ie_next; } scamper_icmpext_t; #define SCAMPER_ICMPEXT_IS_MPLS(ie) \ ((ie)->ie_cn == 1 && (ie)->ie_ct == 1) #define SCAMPER_ICMPEXT_IS_UNNUMBERED(ie) \ ((ie)->ie_cn == 2) #define SCAMPER_ICMPEXT_MPLS_COUNT(ie) \ ((ie)->ie_dl >> 2) #define SCAMPER_ICMPEXT_MPLS_LABEL(ie, x) \ (( (ie)->ie_data[((x)<<2)+0] << 12) + \ ( (ie)->ie_data[((x)<<2)+1] << 4) + \ (((ie)->ie_data[((x)<<2)+2] >> 4) & 0xff)) #define SCAMPER_ICMPEXT_MPLS_EXP(ie, x) \ (((ie)->ie_data[((x)<<2)+2] >> 1) & 0x7) #define SCAMPER_ICMPEXT_MPLS_S(ie, x) \ ((ie)->ie_data[((x)<<2)+2] & 0x1) #define SCAMPER_ICMPEXT_MPLS_TTL(ie, x) \ ((ie)->ie_data[((x)<<2)+3]) #define SCAMPER_ICMPEXT_UNNUMBERED_CT_ROLE(ie) \ ((ie)->ie_data[0] >> 6) #define SCAMPER_ICMPEXT_UNNUMBERED_CT_ROLE_ARRIVED_IP 0 #define SCAMPER_ICMPEXT_UNNUMBERED_CT_ROLE_ARRIVED_SUBIP 1 #define SCAMPER_ICMPEXT_UNNUMBERED_CT_ROLE_FORWARD 2 #define SCAMPER_ICMPEXT_UNNUMBERED_CT_ROLE_NEXTHOP 3 #define SCAMPER_ICMPEXT_UNNUMBERED_CT_IFINDEX 4 #define SCAMPER_ICMPEXT_UNNUMBERED_CT_IPADDR 5 #define SCAMPER_ICMPEXT_UNNUMBERED_CT_NAME 6 #define SCAMPER_ICMPEXT_UNNUMBERED_CT_MTU 7 #define SCAMPER_ICMPEXT_UNNUMBERED_CT_IS_IFINDEX(ie) \ ((ie)->ie_ct & SCAMPER_ICMPEXT_UNNUMBERED_CT_IFINDEX) #define SCAMPER_ICMPEXT_UNNUMBERED_CT_IS_IPADDR(ie) \ ((ie)->ie_ct & SCAMPER_ICMPEXT_UNNUMBERED_CT_IPADDR) #define SCAMPER_ICMPEXT_UNNUMBERED_CT_IS_NAME(ie) \ ((ie)->ie_ct & SCAMPER_ICMPEXT_UNNUMBERED_CT_NAME) #define SCAMPER_ICMPEXT_UNNUMBERED_CT_IS_MTU(ie) \ ((ie)->ie_ct & SCAMPER_ICMPEXT_UNNUMBERED_CT_MTU) typedef struct scamper_icmpext_unnumbered { uint8_t flags; uint32_t ifindex; int af; union { struct in_addr v4; struct in6_addr v6; } un; char name[64]; uint32_t mtu; } scamper_icmpext_unnumbered_t; void scamper_icmpext_unnumbered_parse(scamper_icmpext_t *ext, scamper_icmpext_unnumbered_t *unn); scamper_icmpext_t *scamper_icmpext_alloc(uint8_t cn, uint8_t ct, uint16_t dl, const void *data); int scamper_icmpext_parse(scamper_icmpext_t **ext, void *data, uint16_t len); void scamper_icmpext_free(scamper_icmpext_t *exts); #endif /* __SCAMPER_ICMPEXT_H */ scamper-cvs-20171204/scamper/scamper_if.c000644 001751 000000 00000017610 13210743023 020021 0ustar00mjlwheel000000 000000 /* * scamper_if.c * * $Id: scamper_if.c,v 1.25 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2008-2011 The University of Waikato * Copyright (C) 2014 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_if.c,v 1.25 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_debug.h" #include "scamper_fds.h" #include "scamper_if.h" #include "scamper_privsep.h" #include "utils.h" #ifndef _WIN32 int scamper_if_getifindex(const char *ifname, int *ifindex) { unsigned int i; if((i = if_nametoindex(ifname)) == 0) { printerror(__func__, "could not get index for %s", ifname); return -1; } *ifindex = i; return 0; } #endif #ifdef _WIN32 int scamper_if_getifindex(const char *ifname, int *ifindex) { return -1; } #endif #ifdef _WIN32 int scamper_if_getifname(char *str, size_t len, int ifindex) { MIB_IFROW row; row.dwIndex = ifindex; if(GetIfEntry(&row) != NO_ERROR) { printerror(__func__, "could not GetIfEntry %d", ifindex); return -1; } /* XXX: need to finish. row.wszName is wide */ _snprintf(str, len, "XXX"); return -1; } #endif #ifndef _WIN32 int scamper_if_getifname(char *str, size_t len, int ifindex) { char ifname[IFNAMSIZ]; if(if_indextoname(ifindex, ifname) == NULL) { printerror(__func__, "could not get name for %d", ifindex); return -1; } if(strlen(ifname) + 1 > len) { scamper_debug(__func__, "ifname too small"); return -1; } strncpy(str, ifname, len); return 0; } #endif /* * scamper_if_getmtu * * given an interface index, return the MTU of it. return zero if * we can't get the interface's MTU. */ #ifndef _WIN32 int scamper_if_getmtu(const int ifindex, uint16_t *ifmtu) { scamper_fd_t *fd; struct ifreq ifr; int mtu; assert(ifindex >= 0); /* given the index, return the interface name to query */ if(if_indextoname((unsigned int)ifindex, ifr.ifr_name) == NULL) { printerror(__func__, "could not if_indextoname"); return -1; } if((fd = scamper_fd_ifsock()) == NULL) { printerror(__func__, "could not get ifsock"); return -1; } if(ioctl(scamper_fd_fd_get(fd), SIOCGIFMTU, &ifr) == -1) { printerror(__func__, "could not SIOCGIFMTU"); scamper_fd_free(fd); return -1; } scamper_fd_free(fd); #if defined(__sun__) mtu = ifr.ifr_metric; #else mtu = ifr.ifr_mtu; #endif if(mtu >= 0 && mtu <= 65535) { *ifmtu = mtu; return 0; } return -1; } #endif #ifdef _WIN32 int scamper_if_getmtu(const int ifindex, uint16_t *ifmtu) { MIB_IFROW row; row.dwIndex = ifindex; if(GetIfEntry(&row) != NO_ERROR) { printerror(__func__, "could not GetIfEntry %d", ifindex); return -1; } *ifmtu = (uint16_t)row.dwMtu; return 0; } #endif #if defined(__linux__) int scamper_if_getmac(const int ifindex, uint8_t *mac) { scamper_fd_t *fd = NULL; struct ifreq ifr; if(if_indextoname(ifindex, ifr.ifr_name) == NULL) { printerror(__func__, "could not if_indextoname"); goto err; } if((fd = scamper_fd_ifsock()) == NULL) { printerror(__func__, "could not get ifsock"); goto err; } if(ioctl(scamper_fd_fd_get(fd), SIOCGIFHWADDR, &ifr) == -1) { printerror(__func__, "could not SIOCGIFHWADDR"); goto err; } memcpy(mac, ifr.ifr_hwaddr.sa_data, 6); scamper_fd_free(fd); return 0; err: if(fd != NULL) scamper_fd_free(fd); return -1; } #elif defined(_WIN32) int scamper_if_getmac(const int ifindex, uint8_t *mac) { MIB_IFROW row; row.dwIndex = ifindex; if(GetIfEntry(&row) != NO_ERROR) { printerror(__func__, "could not GetIfEntry %d", ifindex); return -1; } memcpy(mac, row.bPhysAddr, 6); return 0; } #elif defined(__sun__) int scamper_if_getmac(const int ifindex, uint8_t *mac) { union DL_primitives *dlp; uint8_t reqbuf[DL_PHYS_ADDR_REQ_SIZE]; uint8_t ackbuf[DL_PHYS_ADDR_ACK_SIZE + 64]; dl_phys_addr_req_t *req = (dl_phys_addr_req_t *)reqbuf; dl_phys_addr_ack_t *ack = (dl_phys_addr_ack_t *)ackbuf; struct strbuf ctl; int fd = -1, flags; #ifdef WITHOUT_PRIVSEP char ifname[5+IFNAMSIZ]; strncpy(ifname, "/dev/", sizeof(ifname)); if(if_indextoname(ifindex, ifname+5) == NULL) { printerror(__func__, "if_indextoname %d", ifindex); goto err; } if((fd = open(ifname, O_RDWR)) == -1) { printerror(__func__, "could not open %s", ifname); goto err; } #else if((fd = scamper_privsep_open_datalink(ifindex)) == -1) { printerror(__func__, "could not open %d", ifindex); goto err; } #endif memset(reqbuf, 0, sizeof(reqbuf)); req->dl_primitive = DL_PHYS_ADDR_REQ; req->dl_addr_type = DL_CURR_PHYS_ADDR; memset(&ctl, 0, sizeof(ctl)); ctl.len = sizeof(reqbuf); ctl.buf = (char *)req; if(putmsg(fd, &ctl, NULL, 0) == -1) { printerror(__func__, "could not putmsg"); goto err; } flags = 0; memset(&ctl, 0, sizeof(ctl)); ctl.maxlen = sizeof(ackbuf); ctl.buf = (char *)ack; if(getmsg(fd, &ctl, NULL, &flags) == -1) { printerror(__func__, "could not getmsg"); goto err; } close(fd); fd = -1; dlp = (void *)ack; if(dlp->dl_primitive != DL_PHYS_ADDR_ACK) { goto err; } memcpy(mac, ctl.buf+ack->dl_addr_offset, 6); return 0; err: if(fd != -1) close(fd); return -1; } #else int scamper_if_getmac(const int ifindex, uint8_t *mac) { struct sockaddr_dl *sdl; int mib[6]; size_t len; uint8_t *buf; mib[0] = CTL_NET; mib[1] = AF_ROUTE; mib[2] = 0; mib[3] = AF_LINK; mib[4] = NET_RT_IFLIST; mib[5] = ifindex; if(sysctl(mib, 6, NULL, &len, NULL, 0) == -1) { printerror(__func__, "could not sysctl buflen"); return -1; } if((buf = malloc_zero(len)) == NULL) { printerror(__func__, "could not malloc buf"); return -1; } if(sysctl(mib, 6, buf, &len, NULL, 0) < 0) { printerror(__func__, "could not sysctl data"); free(buf); return -1; } sdl = (struct sockaddr_dl *)(buf+sizeof(struct if_msghdr)); memcpy(mac, LLADDR(sdl), 6); free(buf); return 0; } #endif #ifdef HAVE_GETIFADDRS int scamper_if_getifindex_byaddr(const struct sockaddr *addr, int *ifindex) { struct ifaddrs *ifa = NULL, *ifp; int rc; if(getifaddrs(&ifa) != 0) goto err; for(ifp = ifa; ifp != NULL; ifp = ifp->ifa_next) { if(ifp->ifa_addr == NULL || ifp->ifa_addr->sa_family != addr->sa_family) continue; if(addr->sa_family == AF_INET) rc = addr4_cmp(&((struct sockaddr_in *)addr)->sin_addr, &((struct sockaddr_in *)ifp->ifa_addr)->sin_addr); else if(addr->sa_family == AF_INET6) rc = addr6_cmp(&((struct sockaddr_in6 *)addr)->sin6_addr, &((struct sockaddr_in6 *)ifp->ifa_addr)->sin6_addr); else goto err; if(rc == 0) break; } if(ifp == NULL) { errno = ENOENT; goto err; } rc = scamper_if_getifindex(ifp->ifa_name, ifindex); freeifaddrs(ifa); return rc; err: if(ifa != NULL) freeifaddrs(ifa); return -1; } #else int scamper_if_getifindex_byaddr(const struct sockaddr *addr, int *ifindex) { return -1; } #endif scamper-cvs-20171204/scamper/scamper_if.h000644 001751 000000 00000002247 11737356726 020054 0ustar00mjlwheel000000 000000 /* * scamper_if.h * * $Id: scamper_if.h,v 1.4 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2008-2009 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_IF_H #define __SCAMPER_IF_H int scamper_if_getmtu(const int ifindex, uint16_t *ifmtu); int scamper_if_getmac(const int ifindex, uint8_t *mac); int scamper_if_getifindex(const char *ifname, int *ifindex); int scamper_if_getifname(char *str, size_t len, int ifindex); int scamper_if_getifindex_byaddr(const struct sockaddr *addr, int *ifindex); #endif scamper-cvs-20171204/scamper/scamper_ip4.c000644 001751 000000 00000014305 13210743023 020115 0ustar00mjlwheel000000 000000 /* * scamper_ip4.c * * $Id: scamper_ip4.c,v 1.17 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2009-2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_ip4.c,v 1.17 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_dl.h" #include "scamper_probe.h" #include "scamper_ip4.h" #include "scamper_tcp4.h" #include "scamper_privsep.h" #include "scamper_debug.h" #include "utils.h" void scamper_ip4_close(int fd) { #ifndef _WIN32 close(fd); #else closesocket(fd); #endif return; } int scamper_ip4_openraw_fd(void) { int fd, hdr; if((fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) == -1) { printerror(__func__, "could not open socket"); goto err; } hdr = 1; if(setsockopt(fd, IPPROTO_IP, IP_HDRINCL, (void *)&hdr, sizeof(hdr)) == -1) { printerror(__func__, "could not IP_HDRINCL"); goto err; } return fd; err: if(fd != -1) scamper_ip4_close(fd); return -1; } int scamper_ip4_openraw(void) { #if defined(WITHOUT_PRIVSEP) return scamper_ip4_openraw_fd(); #else return scamper_privsep_open_rawip(); #endif } int scamper_ip4_hlen(scamper_probe_t *pr, size_t *hlen) { size_t ip4hlen = sizeof(struct ip); scamper_probe_ipopt_t *opt; int i; for(i=0; ipr_ipoptc; i++) { opt = &pr->pr_ipopts[i]; if(opt->type == SCAMPER_PROBE_IPOPTS_V4RR) { /* * want the ability to record at least one IP address otherwise * the option is useless. */ if(ip4hlen + 8 > 60) goto err; /* for now assume this option fills the rest of the option space */ ip4hlen = 60; } else if(opt->type == SCAMPER_PROBE_IPOPTS_V4TSPS) { if(opt->opt_v4tsps_ipc < 1 || opt->opt_v4tsps_ipc > 4) goto err; ip4hlen += (opt->opt_v4tsps_ipc * 4 * 2) + 4; if(ip4hlen > 60) goto err; } else if(opt->type == SCAMPER_PROBE_IPOPTS_V4TSO) { ip4hlen += 40; if(ip4hlen > 60) goto err; } else if(opt->type == SCAMPER_PROBE_IPOPTS_V4TSAA) { ip4hlen += 36; if(ip4hlen > 60) goto err; } else if(opt->type == SCAMPER_PROBE_IPOPTS_QUICKSTART) { ip4hlen += 8; if(ip4hlen > 60) goto err; } else goto err; } *hlen = ip4hlen; return 0; err: scamper_debug(__func__, "invalid IPv4 header specification"); return -1; } int scamper_ip4_build(scamper_probe_t *pr, uint8_t *buf, size_t *len) { scamper_probe_ipopt_t *opt; struct ip *ip; size_t off, ip4hlen; int i, j; if(scamper_ip4_hlen(pr, &ip4hlen) != 0) return -1; if(ip4hlen > *len) { *len = ip4hlen; return -1; } ip = (struct ip *)buf; off = sizeof(struct ip); #ifndef _WIN32 ip->ip_v = 4; ip->ip_hl = (ip4hlen / 4); #else ip->ip_vhl = 0x40 | (ip4hlen / 4); #endif if((pr->pr_ip_off & IP_OFFMASK) != 0) ip->ip_len = htons(ip4hlen + pr->pr_len); else if(pr->pr_ip_proto == IPPROTO_ICMP || pr->pr_ip_proto == IPPROTO_UDP) ip->ip_len = htons(ip4hlen + 8 + pr->pr_len); else if(pr->pr_ip_proto == IPPROTO_TCP) ip->ip_len = htons(ip4hlen + scamper_tcp4_hlen(pr) + pr->pr_len); else { scamper_debug(__func__, "unimplemented pr %d", pr->pr_ip_proto); return -1; } ip->ip_tos = pr->pr_ip_tos; ip->ip_id = htons(pr->pr_ip_id); ip->ip_off = htons(pr->pr_ip_off); ip->ip_ttl = pr->pr_ip_ttl; ip->ip_p = pr->pr_ip_proto; ip->ip_sum = 0; memcpy(&ip->ip_src, pr->pr_ip_src->addr, sizeof(ip->ip_src)); memcpy(&ip->ip_dst, pr->pr_ip_dst->addr, sizeof(ip->ip_dst)); for(i=0; ipr_ipoptc; i++) { opt = &pr->pr_ipopts[i]; if(opt->type == SCAMPER_PROBE_IPOPTS_V4RR) { memset(buf+off+3, 0, 37); buf[off+0] = 7; buf[off+1] = 39; buf[off+2] = 4; off = 60; } else if(opt->type == SCAMPER_PROBE_IPOPTS_V4TSPS || opt->type == SCAMPER_PROBE_IPOPTS_V4TSO || opt->type == SCAMPER_PROBE_IPOPTS_V4TSAA) { buf[off+0] = 68; buf[off+2] = 5; if(opt->type == SCAMPER_PROBE_IPOPTS_V4TSPS) { buf[off+1] = (opt->opt_v4tsps_ipc * 4 * 2) + 4; buf[off+3] = 3; off += 4; for(j=0; jopt_v4tsps_ipc; j++) { memcpy(buf+off, &opt->opt_v4tsps_ips[j], 4); off += 4; memset(buf+off, 0, 4); off += 4; } } else if(opt->type == SCAMPER_PROBE_IPOPTS_V4TSO) { buf[off+1] = 40; memset(buf+off+3, 0, 41); off += 40; } else if(opt->type == SCAMPER_PROBE_IPOPTS_V4TSAA) { buf[off+1] = 36; buf[off+3] = 1; memset(buf+off+4, 0, 36); off += 36; } } else if(opt->type == SCAMPER_PROBE_IPOPTS_QUICKSTART) { assert(opt->opt_qs_func <= 0xf); assert(opt->opt_qs_rate <= 0xf); buf[off+0] = 25; buf[off+1] = 8; buf[off+2] = (opt->opt_qs_func << 4) | opt->opt_qs_rate; buf[off+3] = opt->opt_qs_ttl; bytes_htonl(&buf[off+4], opt->opt_qs_nonce << 2); off += 8; } else return -1; } assert(off == ip4hlen); ip->ip_sum = in_cksum(ip, ip4hlen); *len = off; return 0; } /* * scamper_ip4_frag_build * * given an IPv4 fragment, build it. */ int scamper_ip4_frag_build(scamper_probe_t *probe, uint8_t *buf, size_t *len) { size_t ip4hlen, req; int rc = 0; /* build the IPv4 header */ ip4hlen = *len; scamper_ip4_build(probe, buf, &ip4hlen); /* calculate the total number of bytes required for this packet */ req = ip4hlen + probe->pr_len; if(req > *len) rc = -1; else if(probe->pr_len != 0) memcpy(buf + ip4hlen, probe->pr_data, probe->pr_len); *len = req; return rc; } scamper-cvs-20171204/scamper/scamper_ip4.h000644 001751 000000 00000002334 12516265335 020136 0ustar00mjlwheel000000 000000 /* * scamper_ip4.h * * $Id: scamper_ip4.h,v 1.5 2015/04/23 21:57:49 mjl Exp $ * * Copyright (C) 2009-2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_IP4_H #define __SCAMPER_IP4_H #ifdef __SCAMPER_PROBE_H int scamper_ip4_build(scamper_probe_t *probe, uint8_t *buf, size_t *len); int scamper_ip4_hlen(scamper_probe_t *probe, size_t *len); int scamper_ip4_frag_build(scamper_probe_t *probe, uint8_t *buf, size_t *len); #endif int scamper_ip4_openraw(void); int scamper_ip4_openraw_fd(void); void scamper_ip4_close(int fd); #endif /* __SCAMPER_IP4_H */ scamper-cvs-20171204/scamper/scamper_ip6.c000644 001751 000000 00000020410 11672022427 020121 0ustar00mjlwheel000000 000000 /* * scamper_ip6.c * * $Id: scamper_ip6.c,v 1.19 2011/12/14 04:24:55 mjl Exp $ * * Copyright (C) 2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_ip6.c,v 1.19 2011/12/14 04:24:55 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_dl.h" #include "scamper_probe.h" #include "scamper_ip6.h" #include "scamper_debug.h" #include "utils.h" /* * ip6_ext_route0 * * this function builds an IPv6 Routing Header of Type 0, as defined by * RFC 2460. It does not set bytes 5-8, which were defined in RFC 1883 * as being a loose/strict bitmap. In RFC 2460, these bits are just set * to zero. */ static int ip6_ext_route0(struct ip6_hdr *ip6, const scamper_probe_ipopt_t *opt, uint8_t *buf, size_t *len) { int i; ssize_t off; assert(opt->opt_v6rh0_ipc > 0); if(*len < (opt->opt_v6rh0_ipc * 16) + 8) { *len = (opt->opt_v6rh0_ipc * 16) + 8; return -1; } /* * the length field counts number of 8 octets, excluding the first 8 bytes * of routing header. * RFC 2460 says this value is twice the number of addresses in the header */ buf[1] = opt->opt_v6rh0_ipc * 2; /* routing type = 0 */ buf[2] = 0; /* number of segments left */ buf[3] = opt->opt_v6rh0_ipc; /* set the next four bytes to zero */ memset(buf+4, 0, 4); off = 8; /* * copy in addresses 1 .. N, skipping over the first address which is * swapped with ip6->ip6_dst after this loop */ for(i=1; iopt_v6rh0_ipc; i++) { memcpy(buf+off, &opt->opt_v6rh0_ips[i], 16); off += 16; } /* * the current destination address becomes the last address in the routing * header */ memcpy(buf+off, &ip6->ip6_dst, 16); off += 16; /* the first address in the option becomes the destination address */ memcpy(&ip6->ip6_dst, &opt->opt_v6rh0_ips[0], 16); *len = off; return 0; } static int ip6_ext_frag(struct ip6_hdr *ip6, const scamper_probe_ipopt_t *opt, uint8_t *buf, size_t *len) { /* make sure the pktbuf has at least enough space left for this */ if(*len < 8) { *len = 8; return -1; } /* the length of this header is set to zero since it is of fixed size */ buf[1] = 0; /* copy in the fragmentation value */ bytes_htons(buf+2, opt->opt_v6frag_off); bytes_htonl(buf+4, opt->opt_v6frag_id); *len = 8; return 0; } static int ip6_ext_quickstart(struct ip6_hdr *ip6, const scamper_probe_ipopt_t *opt, uint8_t *buf, size_t *len) { size_t off = 1; if(*len < 16) { *len = 16; return -1; } buf[off++] = 1; /* length of hop-by-hop options : 16 bytes */ /* two Pad1 options */ buf[off++] = 0; buf[off++] = 0; /* quickstart option */ buf[off++] = 0x26; buf[off++] = 6; buf[off++] = (opt->opt_qs_func << 4) | opt->opt_qs_rate; buf[off++] = opt->opt_qs_ttl; bytes_htonl(&buf[off], opt->opt_qs_nonce << 2); off += 4; /* PadN option, length 4 */ buf[off++] = 1; buf[off++] = 2; buf[off++] = 0; buf[off++] = 0; *len = off; return 0; } /* * scamper_ip6_build * * given a scamper probe structure, and a place in the pktbuf to dump the * header, write the header. * * return 0 on success, -1 on fail. * on entry, buflen contains the length of the pktbuf left for the header. * on exit, buflen contains the length of the space used if zero was returned, * or the space that would be necessary on fail. * * the caller is still required to set ip6->ip6_plen when it knows how much * payload is going to be included. */ int scamper_ip6_build(scamper_probe_t *probe, uint8_t *buf, size_t *len) { static int (*const func[])(struct ip6_hdr *, const scamper_probe_ipopt_t *, uint8_t *, size_t *) = { ip6_ext_route0, /* SCAMPER_PROBE_IPOPTS_V6ROUTE0 */ ip6_ext_frag, /* SCAMPER_PROBE_IPOPTS_V6FRAG */ NULL, /* SCAMPER_PROBE_IPOPTS_V4RR */ NULL, /* SCAMPER_PROBE_IPOPTS_V4TSPS */ NULL, /* SCAMPER_PROBE_IPOPTS_V4TSO */ NULL, /* SCAMPER_PROBE_IPOPTS_V4TSAA */ ip6_ext_quickstart, /* SCAMPER_PROBE_IPOPTS_QUICKSTART */ }; static const int nxthdrval[] = { IPPROTO_ROUTING, /* SCAMPER_PROBE_IPOPTS_V6ROUTE0 */ IPPROTO_FRAGMENT, /* SCAMPER_PROBE_IPOPTS_V6FRAG */ -1, /* SCAMPER_PROBE_IPOPTS_V4RR */ -1, /* SCAMPER_PROBE_IPOPTS_V4TSPS */ -1, /* SCAMPER_PROBE_IPOPTS_V4TSO */ -1, /* SCAMPER_PROBE_IPOPTS_V4TSAA */ IPPROTO_HOPOPTS, /* SCAMPER_PROBE_IPOPTS_QUICKSTART */ }; struct ip6_hdr *ip6; scamper_probe_ipopt_t *opt; size_t off, tmp; int i; /* get a pointer to the first byte of the buf for the IPv6 header */ ip6 = (struct ip6_hdr *)buf; off = sizeof(struct ip6_hdr); if(off <= *len) { /* build the ip6 header */ ip6->ip6_flow = htonl(0x6<<28|probe->pr_ip_tos<<20|probe->pr_ip_flow); ip6->ip6_hlim = probe->pr_ip_ttl; memcpy(&ip6->ip6_src, probe->pr_ip_src->addr, 16); memcpy(&ip6->ip6_dst, probe->pr_ip_dst->addr, 16); } /* * if there are no IPv6 extension headers, then the ip6_nxt field is set * to the underlying type of the packet */ if(probe->pr_ipoptc == 0) { if(off <= *len) { ip6->ip6_nxt = probe->pr_ip_proto; } goto done; } /* * the next header field in the IPv6 header is set to the type of the * first extension header */ if(off <= *len) { if(nxthdrval[probe->pr_ipopts[0].type] == -1) return -1; ip6->ip6_nxt = nxthdrval[probe->pr_ipopts[0].type]; } /* build the body of the IPv6 extension headers area */ for(i=0; ipr_ipoptc; i++) { if(off + 1 < *len) { /* the last extension header uses the ip protocol value */ if(i == probe->pr_ipoptc-1) { buf[off] = probe->pr_ip_proto; } else { if(nxthdrval[probe->pr_ipopts[i+1].type] == -1) return -1; buf[off] = nxthdrval[probe->pr_ipopts[i+1].type]; } } /* obtain a handy pointer to the current extension header */ opt = &probe->pr_ipopts[i]; /* work out how much space is left in the buf */ if(*len >= off) tmp = *len - off; else tmp = 0; /* handle the extension header */ func[opt->type](ip6, opt, buf+off, &tmp); off += tmp; } done: /* * figure out what to return based on if there was enough space in the * packet payload to compose the IPv6 header */ if(off > *len) { *len = off; return -1; } *len = off; return 0; } /* * scamper_ip6_hlen * * given an IPv6 header outline in the probe structure, return how large * the IPv6 header length will be. */ int scamper_ip6_hlen(scamper_probe_t *probe, size_t *ip6hlen) { *ip6hlen = 0; scamper_ip6_build(probe, NULL, ip6hlen); return 0; } /* * scamper_ip6_frag_build * * given an IPv6 fragment, build it. */ int scamper_ip6_frag_build(scamper_probe_t *probe, uint8_t *buf, size_t *len) { struct ip6_hdr *ip6; size_t ip6hlen, req; /* build the IPv6 header */ ip6hlen = *len; scamper_ip6_build(probe, buf, &ip6hlen); /* calculate the total number of bytes required for this packet */ req = ip6hlen + probe->pr_len; if(req > *len) { *len = req; return -1; } /* build the IPv6 fragment */ ip6 = (struct ip6_hdr *)buf; ip6->ip6_plen = htons(ip6hlen - 40 + probe->pr_len); if(probe->pr_len != 0) memcpy(buf + ip6hlen, probe->pr_data, probe->pr_len); *len = req; return 0; } scamper-cvs-20171204/scamper/scamper_ip6.h000644 001751 000000 00000002203 11636033520 020122 0ustar00mjlwheel000000 000000 /* * scamper_ip6.h * * $Id: scamper_ip6.h,v 1.7 2011/09/20 06:48:48 mjl Exp $ * * Copyright (C) 2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_IP6_H #define __SCAMPER_IP6_H int scamper_ip6_build(scamper_probe_t *probe, uint8_t *buf, size_t *len); int scamper_ip6_hlen(scamper_probe_t *probe, size_t *ip6hlen); int scamper_ip6_frag_build(scamper_probe_t *probe, uint8_t *buf, size_t *len); #endif /* __SCAMPER_IP6_H */ scamper-cvs-20171204/scamper/scamper_linepoll.c000644 001751 000000 00000013200 12456125646 021250 0ustar00mjlwheel000000 000000 /* * scamper_linepoll * * $Id: scamper_linepoll.c,v 1.23 2015/01/16 06:11:50 mjl Exp $ * * this code takes a string chunk and splits it up into lines, calling * the callback for each line. It buffers any partial lines in the * process. * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Copyright (C) 2014 The Regents of the University of California * Copyright (C) 2015 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_linepoll.c,v 1.23 2015/01/16 06:11:50 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_linepoll.h" #include "utils.h" struct scamper_linepoll { scamper_linepoll_handler_t handler; void *param; uint8_t *buf; size_t len; }; /* * scamper_linepoll_flush * * */ int scamper_linepoll_flush(scamper_linepoll_t *lp) { void *tmp; if(lp->len <= 0) return 0; if((tmp = realloc(lp->buf, lp->len+1)) == NULL) return -1; lp->buf = tmp; lp->buf[lp->len] = '\0'; lp->handler(lp->param, lp->buf, lp->len); free(lp->buf); lp->buf = NULL; lp->len = 0; return 0; } /* * scamper_linepoll_handle * * take the input buf and call lp->handler for each complete line it reads. * if the last read had an incomplete line, then merge the line together. */ int scamper_linepoll_handle(scamper_linepoll_t *lp, uint8_t *buf, size_t len) { uint8_t *bbuf; size_t i = 0, s = 0, blen; assert(lp != NULL); assert(buf != NULL); /* make sure there is something in the buf */ if(len < 1) { return 0; } /* * there is a partial line from the previous read, deal with it now. * it is dealt with by scanning for the actual end of the line in this * buffer, and then putting the two pieces together. */ if(lp->len > 0) { /* scan for the end-of-line */ while(i < len) { /* until a \n is found, keep looking */ if(buf[i] != '\n') { i++; continue; } /* allocate a buffer big enough to take both segments of the line */ if((bbuf = malloc_zero(lp->len + i + 1)) == NULL) { return -1; } buf[i] = '\0'; memcpy(bbuf, lp->buf, lp->len); memcpy(bbuf+lp->len, buf, i+1); blen = lp->len+i; /* we don't need the old buf anymore */ free(lp->buf); lp->buf = NULL; lp->len = 0; /* drop the \r of a \r\n if necessary */ if(bbuf[blen-1] == '\r') { /* * make sure that if the \r is dropped, we're not left with an * empty line */ if(blen-1 > 0) { bbuf[--blen] = '\0'; lp->handler(lp->param, bbuf, blen); } } else { /* blen should be > 0, as lp->len > 0 above */ assert(blen > 0); lp->handler(lp->param, bbuf, blen); } free(bbuf); break; } /* * if a newline was not found then merge the two buffers together * and hold them for next time. */ if(i == len) { /* allocate a bigger buffer */ if((bbuf = realloc(lp->buf, lp->len + len)) == NULL) { return -1; } lp->buf = bbuf; /* * copy in additional data and then increase the record held of * the total length of the line so far */ memcpy(lp->buf+lp->len, buf, len); lp->len += len; return 0; } s = ++i; } while(i < len) { /* skip until a new-line character is found */ if(buf[i] != '\n') { i++; continue; } /* * if this is a blank line we don't need to pass it * note that if the end-of-line sequence is \r\n, then the \r is * stripped in addition to the \n */ if(s != i) { buf[i] = '\0'; if(buf[i-1] != '\r') { lp->handler(lp->param, buf+s, i-s); } else if(i - 1 != 0) { buf[i-1] = '\0'; lp->handler(lp->param, buf+s, i-s-1); } } /* update the starting point for the next line */ s = ++i; } if(s < len) { if((lp->buf = malloc_zero(len - s)) == NULL) { return -1; } lp->len = len - s; memcpy(lp->buf, buf+s, lp->len); } return 0; } #ifndef DMALLOC scamper_linepoll_t *scamper_linepoll_alloc(scamper_linepoll_handler_t h, void *param) #else scamper_linepoll_t *scamper_linepoll_alloc_dm(scamper_linepoll_handler_t h, void *param, const char *file, const int line) #endif { scamper_linepoll_t *lp; #ifndef DMALLOC lp = malloc_zero(sizeof(scamper_linepoll_t)); #else lp = malloc_zero_dm(sizeof(scamper_linepoll_t), file, line); #endif if(lp == NULL) return NULL; lp->handler = h; lp->param = param; return lp; } void scamper_linepoll_update(scamper_linepoll_t *lp, scamper_linepoll_handler_t handler, void *param) { lp->handler = handler; lp->param = param; return; } void scamper_linepoll_free(scamper_linepoll_t *lp, int feedlastline) { assert(lp != NULL); if(feedlastline == 1) scamper_linepoll_flush(lp); if(lp->buf != NULL) free(lp->buf); free(lp); return; } scamper-cvs-20171204/scamper/scamper_linepoll.h000644 001751 000000 00000003450 12456125646 021263 0ustar00mjlwheel000000 000000 /* * scamper_linepoll * * $Id: scamper_linepoll.h,v 1.8 2015/01/16 06:11:50 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2008 The University of Waikato * Copyright (C) 2014-2015 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_LINEPOLL_H #define __SCAMPER_LINEPOLL_H typedef struct scamper_linepoll scamper_linepoll_t; typedef int (*scamper_linepoll_handler_t)(void *param,uint8_t *buf,size_t len); int scamper_linepoll_handle(scamper_linepoll_t *lp, uint8_t *buf, size_t len); int scamper_linepoll_flush(scamper_linepoll_t *lp); void scamper_linepoll_update(scamper_linepoll_t *lp, scamper_linepoll_handler_t handler, void *param); void scamper_linepoll_free(scamper_linepoll_t *lp, int feedlastline); #ifndef DMALLOC scamper_linepoll_t *scamper_linepoll_alloc(scamper_linepoll_handler_t handler, void *param); #endif #ifdef DMALLOC scamper_linepoll_t *scamper_linepoll_alloc_dm(scamper_linepoll_handler_t h, void *param, const char *file, const int line); #define scamper_linepoll_alloc(h, p) \ scamper_linepoll_alloc_dm((h), (p), \ __FILE__, __LINE__) #endif #endif scamper-cvs-20171204/scamper/scamper_list.c000644 001751 000000 00000011727 11634537540 020416 0ustar00mjlwheel000000 000000 /* * scamper_list.c * * $Id: scamper_list.c,v 1.22 2011/09/16 03:15:44 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_list.c,v 1.22 2011/09/16 03:15:44 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_list.h" #include "utils.h" /* * scamper_cycle_cmp * * utility function for comparing two cycles. note that the stop time * parameters are not compared; one cycle with a stop time might be * compared with the (same) cycle without a stop time, and be rejected * incorrectly. */ int scamper_cycle_cmp(scamper_cycle_t *a, scamper_cycle_t *b) { int i; if(a == b) { return 0; } /* compare lists */ if((i = scamper_list_cmp(a->list, b->list)) != 0) { return i; } /* compare cycle ids */ if(a->id < b->id) return -1; if(a->id > b->id) return 1; /* compare start times */ if(a->start_time < b->start_time) return -1; if(a->start_time > b->start_time) return 1; /* compare host names */ if(a->hostname != NULL || b->hostname != NULL) { if(a->hostname == NULL && b->hostname != NULL) return -1; if(a->hostname != NULL && b->hostname == NULL) return 1; if((i = strcmp(a->hostname, b->hostname)) != 0) return i; } /* they're the same, as best we can tell */ return 0; } scamper_cycle_t *scamper_cycle_alloc(scamper_list_t *list) { scamper_cycle_t *cycle; if(list == NULL) { return NULL; } if((cycle = malloc_zero(sizeof(struct scamper_cycle))) == NULL) { return NULL; } cycle->list = scamper_list_use(list); cycle->refcnt = 1; return cycle; } scamper_cycle_t *scamper_cycle_use(scamper_cycle_t *cycle) { if(cycle != NULL) cycle->refcnt++; return cycle; } void scamper_cycle_free(scamper_cycle_t *cycle) { if(cycle != NULL) { assert(cycle->refcnt > 0); if(--cycle->refcnt > 0) { return; } if(cycle->list != NULL) scamper_list_free(cycle->list); if(cycle->hostname != NULL) free(cycle->hostname); free(cycle); } return; } int scamper_list_cmp(const scamper_list_t *a, const scamper_list_t *b) { int i; /* if the lists are in the same piece of memory, they're identical */ if(a == b) { return 0; } /* compare list ids */ if(a->id < b->id) return -1; if(a->id > b->id) return 1; /* compare name strings */ if(a->name != NULL || b->name != NULL) { if(a->name == NULL && b->name != NULL) return -1; if(a->name != NULL && b->name == NULL) return 1; if((i = strcmp(a->name, b->name)) != 0) return i; } /* compare description strings */ if(a->descr != NULL || b->descr != NULL) { if(a->descr == NULL && b->descr != NULL) return -1; if(a->descr != NULL && b->descr == NULL) return 1; if((i = strcmp(a->descr, b->descr)) != 0) return i; } /* compare monitor strings */ if(a->monitor != NULL || b->monitor != NULL) { if(a->monitor == NULL && b->monitor != NULL) return -1; if(a->monitor != NULL && b->monitor == NULL) return 1; if((i = strcmp(a->monitor, b->monitor)) != 0) return i; } /* they're the same, as best we can tell */ return 0; } scamper_list_t *scamper_list_alloc(const uint32_t id, const char *name, const char *descr, const char *monitor) { scamper_list_t *list; if((list = malloc_zero(sizeof(struct scamper_list))) == NULL) { return NULL; } list->id = id; list->refcnt = 1; if(name != NULL && (list->name = strdup(name)) == NULL) { goto err; } if(descr != NULL && (list->descr = strdup(descr)) == NULL) { goto err; } if(monitor != NULL && (list->monitor = strdup(monitor)) == NULL) { goto err; } return list; err: scamper_list_free(list); return NULL; } scamper_list_t *scamper_list_use(scamper_list_t *list) { if(list != NULL) list->refcnt++; return list; } void scamper_list_free(scamper_list_t *list) { if(list != NULL) { assert(list->refcnt > 0); if(--list->refcnt > 0) { return; } if(list->name != NULL) free(list->name); if(list->descr != NULL) free(list->descr); if(list->monitor != NULL) free(list->monitor); free(list); } return; } scamper-cvs-20171204/scamper/scamper_list.h000644 001751 000000 00000005540 11634537540 020417 0ustar00mjlwheel000000 000000 /* * scamper_list.h * * $Id: scamper_list.h,v 1.7 2011/09/16 03:15:44 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2008 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_LIST_H #define __SCAMPER_LIST_H /* * scamper_list: * * details regarding a list that was fed into scamper for probing. * * id: some ID assigned to identify the list by a person * name: the name assigned to the list * monitor: the (optional) canonical name of the monitor * descr: optional free-form text describing the list somehow. * refcnt: a count of references to an instance of this struct */ typedef struct scamper_list { uint32_t id; char *name; char *descr; char *monitor; int refcnt; } scamper_list_t; /* * scamper_cycle: * * details of the cycle that scamper is currently making over the list. * * list: the list id of the cycle. * id: the cycle id. * start_time: time at which cycle began, seconds since the epoch * stop_time: time at which cycle ended, seconds since the epoch * hostname: optional record of the hostname at the beginning of the cycle. * refcnt: a count of references to an instance of this struct */ typedef struct scamper_cycle { scamper_list_t *list; uint32_t id; uint32_t start_time; uint32_t stop_time; char *hostname; int refcnt; } scamper_cycle_t; /* * scamper_[list|cycle]_[alloc|use|free] * * in order to prevent list and cycle objects from being copied many times * for use by data objects, we use a reference counter in each structure * so that it is allocated just the once. */ scamper_list_t *scamper_list_alloc(const uint32_t id, const char *name, const char *descr, const char *monitor); scamper_list_t *scamper_list_use(scamper_list_t *list); void scamper_list_free(scamper_list_t *list); int scamper_list_cmp(const scamper_list_t *a, const scamper_list_t *b); scamper_cycle_t *scamper_cycle_alloc(scamper_list_t *list); scamper_cycle_t *scamper_cycle_use(scamper_cycle_t *cycle); void scamper_cycle_free(scamper_cycle_t *cycle); int scamper_cycle_cmp(scamper_cycle_t *a, scamper_cycle_t *b); #endif /* __SCAMPER_LIST_H */ scamper-cvs-20171204/scamper/scamper_options.c000644 001751 000000 00000023051 12515605264 021125 0ustar00mjlwheel000000 000000 /* * scamper_options.c: code to handle parsing of options * * $Id: scamper_options.c,v 1.14 2015/04/22 02:43:00 mjl Exp $ * * Copyright (C) 2006-2010 The University of Waikato * Copyright (C) 2014-2015 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_options.c,v 1.14 2015/04/22 02:43:00 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_options.h" #include "utils.h" /* * opt_add * * routine to place the logic for putting together a list holding parsed * options. */ static int opt_add(scamper_option_out_t **head, scamper_option_out_t **tail, const scamper_option_in_t *opt, char *str) { assert(head != NULL); assert(tail != NULL); if(*tail == NULL) { assert(*head == NULL); if((*head = malloc_zero(sizeof(scamper_option_out_t))) == NULL) return -1; *tail = *head; } else { if(((*tail)->next = malloc_zero(sizeof(scamper_option_out_t))) == NULL) return -1; *tail = (*tail)->next; } (*tail)->id = opt->id; (*tail)->type = opt->type; (*tail)->str = str; return 0; } /* * opt_parse_param * * this code is used to parse out the parameter pointed to by str based on * the supplied parameter type. the next word in the string is returned * in 'next' */ static int opt_parse_param(int type, char **str, char **next) { char *tmp = *str; char delim; int c; if(type == SCAMPER_OPTION_TYPE_NUM) { if(*tmp == '-') tmp++; c = 0; while(isdigit((int)*tmp) != 0) { tmp++; c++; } /* if there are no digits in this parameter */ if(c == 0) goto err; /* if the character we stopped on is not whitespace */ if(*tmp != '\0' && isspace((int)*tmp) == 0) goto err; } else if(type == SCAMPER_OPTION_TYPE_STR) { /* * if the first character is a quoting character, then the string is * terminated by the same quoting character */ if(tmp[0] == '"' || tmp[0] == '\'') { /* record the type of quoting character, and then advance past it */ delim = tmp[0]; tmp++; *str = tmp; /* * read the string until we either get the other quoting character, * or the end of the string. if we don't get the other quoting * character then we have a problem * * XXX: when we fall out of the top-level if statement, the character * pointed to by tmp will be set to null; this corresponds to the * character used for quoting. */ while(tmp[0] != delim && tmp[0] != '\0') tmp++; if(tmp[0] == '\0') goto err; } else { *next = string_nextword(*str); return 0; } } /* if we got to the end of the argument list, then nothing else comes next */ if(tmp[0] == '\0') { *next = NULL; return 0; } /* null terminate the option parameter string */ tmp[0] = '\0'; tmp++; /* * skip past whitespace and advance to the next string in the option. * if there is nothing else, then *next is set to NULL. */ while(isspace((int)*tmp) != 0) tmp++; if(tmp[0] != '\0') *next = tmp; else *next = NULL; return 0; err: *next = NULL; return -1; } int scamper_options_c2id(const scamper_option_in_t *opts,const int cnt,char c) { int i; for(i=0; inext; } return i; } /* * scamper_options_free * * simple function to free up the option_out linked list passed in, which * was allocated by scamper_options_parse. */ void scamper_options_free(scamper_option_out_t *opts) { scamper_option_out_t *tmp; while(opts != NULL) { tmp = opts->next; free(opts); opts = tmp; } return; } scamper-cvs-20171204/scamper/scamper_options.h000644 001751 000000 00000007173 11737356726 021154 0ustar00mjlwheel000000 000000 /* * scamper_options.h: code to handle parsing of options * * $Id: scamper_options.h,v 1.7 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2006-2008 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_OPTIONS_H #define __SCAMPER_OPTIONS_H #define SCAMPER_OPTION_TYPE_NULL 0x00 /* no parameter to option */ #define SCAMPER_OPTION_TYPE_STR 0x01 /* string parameter */ #define SCAMPER_OPTION_TYPE_NUM 0x02 /* integer (number) parameter */ /* * scamper_option_in * * define the format of an option. this structure defines the short and long * strings used for the option, the parameter type, and an associated integer * id for the type, so that the caller does not have to examine the option * string after it has been parsed. */ typedef struct scamper_option_in { /* * the character (for one-letter options) or the string (for long options) * defining the option. if c is '\0', then the option does not have a short * form. if str is NULL, then the option is */ char c; char *str; /* * an integer mapping for the option. this integer mapping is used when * returning the parsed options to the caller. */ int id; /* * the type of the paramater for the option, if there is one. type codes * are defined above. */ int type; } scamper_option_in_t; #define SCAMPER_OPTION_COUNT(opts) (sizeof(opts)/sizeof(scamper_option_in_t)) /* * scamper_option_out * * a simple struct to associate an option with its supplied value. the * id comes from the scamper_option_in structure. * * the next parameter is used to assemble a linked list of option structures. */ typedef struct scamper_option_out { int id; int type; char *str; struct scamper_option_out *next; } scamper_option_out_t; /* * scamper_options_parse * * given an input string, parse the string for options based on the options * supplied in the opts_in parameter. * * the parsed options are put into opts_out. the caller must use * scamper_options_free() on the opts_out parameter when the structure is no * longer required. * * this function will modify the opt_str parameter passed in rather than * duplicate portions of the input string. */ int scamper_options_parse(char *opt_str, const scamper_option_in_t *opts_in, const int cnt_in, scamper_option_out_t **opts_out, char **stop); int scamper_options_validate(const scamper_option_in_t *opts, const int cnt, int argc, char *argv[], int *stop, int validate(int optid, char *param, long *out)); /* * scamper_options_count * * return a count of the number of opt_out structures in the list */ int scamper_options_count(scamper_option_out_t *opts); int scamper_options_c2id(const scamper_option_in_t *opts,const int cnt,char c); /* * scamper_options_free * * free the list of scamper_option_out structures passed as the only parameter. */ void scamper_options_free(scamper_option_out_t *opts); #endif /* __SCAMPER_OPTIONS_H */ scamper-cvs-20171204/scamper/scamper_osinfo.c000644 001751 000000 00000010301 13210743023 020706 0ustar00mjlwheel000000 000000 /* * scamper_osinfo.c * * $Id: scamper_osinfo.c,v 1.5 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2006 Matthew Luckie * Copyright (C) 2014 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_osinfo.c,v 1.5 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_debug.h" #include "scamper_osinfo.h" #include "mjl_list.h" #include "utils.h" static scamper_osinfo_t *osinfo = NULL; const scamper_osinfo_t *scamper_osinfo_get(void) { return osinfo; } /* * uname_wrap * * do some basic parsing on the output from uname */ #ifndef _WIN32 int scamper_osinfo_init(void) { struct utsname utsname; int i; char *str, *ptr; slist_t *nos = NULL; size_t size; /* call uname to get the information */ if(uname(&utsname) < 0) { printerror(__func__, "could not uname"); goto err; } /* allocate our wrapping struct */ if((osinfo = malloc_zero(sizeof(scamper_osinfo_t))) == NULL) { printerror(__func__, "could not malloc osinfo"); goto err; } /* copy sysname in */ if((osinfo->os = strdup(utsname.sysname)) == NULL) { printerror(__func__, "could not strdup sysname"); goto err; } /* parse the OS name */ if(strcasecmp(osinfo->os, "FreeBSD") == 0) osinfo->os_id = SCAMPER_OSINFO_OS_FREEBSD; else if(strcasecmp(osinfo->os, "OpenBSD") == 0) osinfo->os_id = SCAMPER_OSINFO_OS_OPENBSD; else if(strcasecmp(osinfo->os, "NetBSD") == 0) osinfo->os_id = SCAMPER_OSINFO_OS_NETBSD; else if(strcasecmp(osinfo->os, "SunOS") == 0) osinfo->os_id = SCAMPER_OSINFO_OS_SUNOS; else if(strcasecmp(osinfo->os, "Linux") == 0) osinfo->os_id = SCAMPER_OSINFO_OS_LINUX; else if(strcasecmp(osinfo->os, "Darwin") == 0) osinfo->os_id = SCAMPER_OSINFO_OS_DARWIN; /* parse the release integer string */ if((nos = slist_alloc()) == NULL) { printerror(__func__, "could not alloc nos"); goto err; } str = utsname.release; for(;;) { ptr = str; while(isdigit((int)*ptr) != 0) ptr++; if(*ptr == '.') { *ptr = '\0'; if(slist_tail_push(nos, str) == NULL) { printerror(__func__, "could not push str"); goto err; } str = ptr + 1; continue; } *ptr = '\0'; if(str != ptr) { if(slist_tail_push(nos, str) == NULL) { printerror(__func__, "could not push str"); goto err; } break; } } osinfo->os_rel_dots = slist_count(nos); if(osinfo->os_rel_dots != 0) { size = osinfo->os_rel_dots * sizeof(long); if((osinfo->os_rel = malloc_zero(size)) == NULL) { printerror(__func__, "could not malloc os_rel"); goto err; } i = 0; while((str = slist_head_pop(nos)) != NULL) { if(string_tolong(str, &osinfo->os_rel[i]) != 0) { printerror(__func__, "could not tolong"); goto err; } i++; } } slist_free(nos); return 0; err: if(nos != NULL) slist_free(nos); return -1; } #endif #ifdef _WIN32 int scamper_osinfo_init(void) { if((osinfo = malloc_zero(sizeof(scamper_osinfo_t))) == NULL) goto err; if((osinfo->os = strdup("Windows")) == NULL) goto err; osinfo->os_id = SCAMPER_OSINFO_OS_WINDOWS; return 0; err: return -1; } #endif void scamper_osinfo_cleanup(void) { if(osinfo == NULL) return; if(osinfo->os != NULL) free(osinfo->os); if(osinfo->os_rel != NULL) free(osinfo->os_rel); free(osinfo); return; } scamper-cvs-20171204/scamper/warts.5000644 001751 000000 00000045045 12761366526 017021 0ustar00mjlwheel000000 000000 .Dd May 16, 2011 .Dt WARTS 5 .Os .Sh NAME .Nm warts .Nd format for scamper's warts storage. .Sh DESCRIPTION This document describes the warts binary file format used by .Xr scamper 1 . A warts file consists of a set of records, each of which begin with an 8 byte object header. .Sh WARTS OBJECT HEADER The header consists of a 2-byte magic number (0x1205), a 2-byte type value, and a 4-byte length value defining the size of the object that follows. All 16-bit and 32-bit numbers are written in network byte order. The currently defined types, and the types of .Xr scamper 1 object they map to, are as follows: .Bl -dash -offset 2n -compact -width 1n .It 0x0001: List (scamper_list_t) .It 0x0002: Cycle start (scamper_cycle_t) .It 0x0003: Cycle definition (scamper_cycle_t) .It 0x0004: Cycle stop (scamper_cycle_t) .It 0x0005: Address (scamper_addr_t) -- deprecated .It 0x0006: Traceroute (scamper_trace_t) .It 0x0007: Ping (scamper_ping_t) .It 0x0008: MDA traceroute (scamper_tracelb_t) .It 0x0009: Alias resolution (scamper_dealias_t) .It 0x000a: Neighbour Discovery (scamper_neighbourdisc_t) .It 0x000b: TCP Behaviour Inference Tool (scamper_tbit_t) .It 0x000c: Sting (scamper_sting_t) .It 0x000d: Sniff (scamper_sniff_t) .El A new type number can be requested by emailing the author of scamper. The structure of each warts record beyond the header is arbitrary, though some conventions have been established to promote extensibility. .Sh FLAGS AND PARAMETERS The warts routines in scamper provide the ability to conditionally store arbitrary data in a forwards compatible method. A set of flags and parameters begins with a sequence of bytes that denote which items are included. If any flags are set, then after the flags is a 2-byte field that records the length of the parameters that follow. Finally, the data follows. The following figure illustrates how flags are recorded: .Bd -literal -offset indent Byte zero Byte one Byte two 8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ |1 | |1 | |0 | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ .Ed The most significant bit of each byte is the `link' bit; it determines if the next byte in the sequence contains flags. The low-order 7 bits of each byte signal if the corresponding field is written out in the parameters that follow. In the figure, the link bit is set to one in the first two bytes, and zero in the final byte, signifying that three flag-bytes are included. .Pp The rest of each byte is used to record flags, whose position in the sequence signifies if a particular parameter is included. For example, if bit 6 of byte zero is set, then parameter 6 is included, and if bit 5 of byte one is set, then parameter 12 is included, and if bit 2 of byte two is set, then parameter 16 is included. .Sh ADDRESSES A warts file may have addresses embedded in two ways. The first is deprecated: the address is written as a data object that can be globally referenced before the data object that uses it is written. A reader therefore must keep a copy of all addresses it reads in order to be able to decode data objects that subsequently reference it, which can consume a significant amount of memory. The format of the address is .Bd -literal -offset indent Warts header ID Modulo Type Address +--------------+-----------+--------+----//----+ | 8 bytes | 1 byte | 1 byte | | | type = 5 | | | | +--------------+-----------+--------+----//----+ .Ed A reader determines the ID number of each address by the order in which it appears, and can sanity check the ID number it determines by comparing the lower 8 bits of the computed ID with the ID that is embedded in the record. Address ID numbers start at one; zero is reserved for when no address is embedded. The type corresponds to the type of address that follows. The currently defined types are as follows: .Bl -dash -offset 2n -compact -width 1n .It 0x01 IPv4 address .It 0x02 IPv6 address .It 0x03 48-bit Ethernet MAC address .It 0x04 64-bit Firewire link address .El .Pp The second method to embed an address is to embed the address in each data object that requires that address. The format of that address can take one of two forms, depending on whether or not the address is being defined or referenced. A defined address declares a new address that has scope for the data object being embedded; a reader adds the address to the end of a table so that it can be later referenced without having to re-define the address. In this method, ID numbers start from zero. The format of a defined address is: .Bd -literal -offset indent Address length Type Address +----------------+---------+----//-----+ | uint8_t | uint8_t | | | value > 0 | | | +----------------+---------+-----------+ .Ed .Pp The format of a referenced address is: .Bd -literal -offset indent Magic value ID number +--------------+------------+ | uint8_t | uint32_t | | value == 0 | | +--------------+------------+ .Ed .Sh EMBEDDING OTHER TYPES Bytes, unsigned 16-bit integers, and unsigned 32 bit integers are embedded directly, using network byte order where appropriate. ASCII strings are also embedded directly, including the trailing null byte to terminate the string. Time values (timeval) are embedded as two unsigned 32 bit integers; the first number counts the number of seconds that have elapsed since the Unix epoch, the second number counts the number of microseconds that have elapsed in the current second. Round-trip-time (RTT) values are embedded as a single unsigned 32 bit integer that counts the number of microseconds that elapsed. .Pp Several measurements record ICMP extension data, so there is a standardised method to record a set of ICMP extensions. Individual ICMP extension records are written in the following format: The format of a list structure is: .Bl -dash -offset 2n -compact -width 1n .It uint16_t: length of data that follows .It uint8_t: ICMP extension class number .It uint8_t: ICMP extension type number .It Bytes: ICMP extension data, if any. .El .Pp A set of ICMP extension records is written in the following format: .Bd -literal -offset indent Total Length Extension #1 .. Extension #N +--------------+------//------+-------//------+ | uint16_t | | | | | | | +--------------+------//------+-------//------+ .Ed .Sh LIST STRUCTURE The format of a list structure is: .Bl -dash -offset 2n -compact -width 1n .It 8 bytes: Warts header, type 0x0001 .It uint32_t: List ID assigned by warts from a counter .It uint32_t: List ID assigned by a person. .It String: List Name assigned by a person .It Variable: Flags .It uint16_t: Parameter length (optional, included if any flags are set) .It String: Description, included if flag 1 is set .It String: Monitor name, included if flag 2 is set .El The List ID assigned by warts is subsequently used by objects that reference the list to identify which list they refer to. .Sh CYCLE STRUCTURE Three types of cycle records may be written: a start record denoting the starting point for a new cycle, a definition record declaring a cycle record whose corresponding start record is in a different file, and a cycle stop record, denoting the end point for a cycle. The format of the cycle start and definition structures is: .Bl -dash -offset 2n -compact -width 1n .It 8 bytes: Warts header, type 0x0002 or 0x0003 .It uint32_t: Cycle ID, assigned by warts from a counter .It uint32_t: List ID, referencing the list this cycle is over .It uint32_t: Cycle ID, assigned by a human .It uint32_t: Start time of the cycle, seconds since Unix epoch .It Variable: Flags .It uint16_t: Parameter length, included if any flags are set .It uint32_t: Stop time of the cycle in seconds since Unix epoch, included if flag 1 is set .It String: Hostname at cycle start point, included if flag 2 is set .El .Pp The format of the cycle stop structure is: .Bl -dash -offset 2n -compact -width 1n .It 8 bytes: Warts header, type 0x0004 .It uint32_t: Cycle ID, assigned by warts from a counter, referencing the cycle structure that is being updated. .It uint32_t: Stop time of the cycle, seconds since Unix epoch .It Variable: Flags. currently set to zero. .El .Sh TRACEROUTE STRUCTURE Traceroute structures consist of traceroute parameters, hop records, and an optional series of additional data types for special types of traceroute invokation. The general form of a traceroute recorded in warts is as follows: .Bl -dash -offset 2n -compact -width 1n .It 8 bytes: Warts header, type 0x0006 .It Variable: Flags describing traceroute parameters and high-level outcomes .It uint16_t: Parameter length, included if any flags are set .It Variable: Traceroute parameters, depending on flags .It uint16_t: Hop record count .It Variable: Hop records, if hop record count > 0 .It Variable: Optional traceroute data; pmtud, doubletree .It uint16_t: End of traceroute record; value is zero. .El .Pp The flags and data types that describe traceroute are as follows: .Bl -dash -offset 2n -compact -width 1n .It uint32_t: List ID assigned by warts, included if flag 1 is set .It uint32_t: Cycle ID assigned by warts, included if flag 2 is set .It uint32_t: Src IP address ID assigned by warts, included if flag 3 is set .It uint32_t: Dst IP address ID assigned by warts, included if flag 4 is set .It timeval: Time traceroute commenced, included if flag 5 is set .It uint8_t: Stop reason, included if flag 6 is set .It uint8_t: Stop data, included if flag 7 is set .It uint8_t: Trace flags, included if flag 8 is set .It uint8_t: Attempts, included if flag 9 is set .It uint8_t: Hoplimit, included if flag 10 is set .It uint8_t: Trace type, included if flag 11 is set .It uint16_t: Probe size, included if flag 12 is set .It uint16_t: Source port, included if flag 13 is set .It uint16_t: Destination port, included if flag 14 is set .It uint8_t: TTL of first probe, included if flag 15 is set .It uint8_t: IP ToS set in probe packets, included if flag 16 is set .It uint8_t: Timeout length for each probe in seconds, included if flag 17 is set .It uint8_t: How many loops are allowed before probing halts, included if flag 18 is set .It uint16_t: Number of hops probed, included if flag 19 is set .It uint8_t: Gap limit before probing halts, included if flag 20 is set .It uint8_t: What to do when the gap limit is reached, included if flag 21 is set .It uint8_t: What to do when a loop is found, included if flag 22 is set .It uint16_t: Number of probes sent, included if flag 23 is set .It uint8_t: Minimum time to wait between probes in centiseconds, included if flag 24 is set .It uint8_t: Confidence level to attain that all hops have replied at a given distance in the path, included if flag 25 is set .It address: Source address used in probes, included if flag 26 is set .It address: Destination address used in probes, included if flag 27 is set .It uint32_t: User ID assigned to the traceroute, included if flag 28 is set .El .Pp The traceroute flags field has the following fields: .Bl -dash -offset 2n -compact -width 1n .It If bit 1 is set, traceroute sent all allotted attempts. .It If bit 2 is set, traceroute was instructed to conduct path MTU discovery. .It If bit 3 is set, traceroute should use the datalink to obtain timestamps. .It If bit 4 is set, traceroute should not halt probing if a TTL expired message is received from the destination. .It If bit 5 is set, traceroute should use Doubletree to reduce redundant probing. .It If bit 6 is set, the ICMP checksum used in echo probes can be found is stored where the UDP destination port value is. .El .Pp Hop records are written in series. Each hop record takes the following form: .Bl -dash -offset 2n -compact -width 1n .It Variable: Flags describing which hop parameters are recorded .It uint16_t: Parameter length, included if any flags are set .It uint32_t: Hop address, ID corresponding to global warts address; included if flag 1 is set .It uint8_t: IP TTL of probe packet, included if flag 2 is set .It uint8_t: IP TTL of reply packet, included if flag 3 is set .It uint8_t: Hop flags, included if flag 4 is set .It uint8_t: Hop probe ID - how many probes have been sent for the given TTL. Included if flag 5 is set. .It RTT: Round trip time - the length of time in microseconds it took this reply to arrive after the probe was transmitted. Included if flag 6 is set. .It uint16_t: ICMP type, code. The first byte is the ICMP type of the response, the second byte is the ICMP code. Included if flag 7 is set. .It uint16_t: Probe size - the size of the probe sent. Included if flag 8 is set. .It uint16_t: Reply size - the size of the response received. Included if flag 9 is set. .It uint16_t: IPID - the IP identifier value set in the response packet. Included if flag 10 is set, else it is zero. .It uint8_t: Type of Service - the value of the ToS byte in the IP header, including ECN bits. Included if flag 11 is set. .It uint16_t: Next-hop MTU - the value of the next-hop MTU field if the response is an ICMP packet too big message. Included if flag 12 is set. .It uint16_t: Quoted IP length - the value of the IP length field found in the ICMP quotation. Included if flag 13 is set, else it is the same as the probe size. .It uint8_t: Quoted TTL - the value of the IP TTL field found in the ICMP quotation. Included if flag 14 is set, else it is one. .It uint8_t: TCP flags - the value of the TCP flags received in response to TCP probes. Included if flag 15 is set. .It uint8_t: Quoted TOS - the value of the IP ToS byte found in the ICMP quotation. Included if flag 16 is set. .It icmpext: ICMP extension data, included if flag 17 is set. .It address: Hop address, included if flag 18 is set. .It timeval: Hop tx, included if flag 19 is set. .El .Pp Optional traceroute data, such as PMTUD and doubletree control and result structures are included after hop records. Optional traceroute data begins with a 16-bit header; the first four bits define the type of record, and the remaining 12 bits specify the length of the record. Currently, three types of optional data are defined: PMTUD data (1), Last-ditch probing results (2), and doubletree (3). .Pp The format of the last-ditch data is: .Bl -dash -offset 2n -compact -width 1n .It uint16_t: traceroute optional data header, type = 1. .It Variable: Flags describing which last-ditch parameters are recorded. Currently, no flags are defined. .It uint16_t: Parameter length, included if any flags are set. .It uint16_t: Number of responses received to last-ditch probing, recorded as hop records. .It Variable: Hop records. .El .Pp The format of PMTUD data is: .Bl -dash -offset 2n -compact -width 1n .It uint16_t: traceroute optional data header, type = 2. .It Variable: PMTUD flags and parameters .It uint16_t: Number of hop records that follow .It Variable: Hop Records, if any .It Variable: Notes, if any .El The format of the PMTUD flags and attributes is: .Bl -dash -offset 2n -compact -width 1n .It Variable: Flags describing which hop parameters are recorded .It uint16_t: Parameter length, included if any flags are set .It uint16_t: MTU of the interface, included if flag 1 is set. .It uint16_t: Path MTU, included if flag 2 is set. .It uint16_t: MTU to the first hop, included if flag 3 is set and if it differs to the MTU of the interface. .It uint8_t: verson of the PMTUD attribute, included if flag 4 is set, otherwise version 1 can be assumed. .It uint8_t: note count - number of PMTUD note structures that follow the hops. .El The format of the PMTUD notes is: .Bl -dash -offset 2n -compact -width 1n .It Variable: Flags describing which hop parameters are recorded .It uint16_t: Parameter length, included if any flags are set .It uint8_t: type of note, included if flag 1 is set. .It uint16_t: next-hop MTU inferred, included if flag 2 is set. .It uint16_t: Index of corresponding hop record in the PMTUD hops, included if flag 3 is set. .El The tree types of PMTUD notes are: ordinary PTB (1), PTB with invalid next-hop MTU (2), and an inferred MTU in the absence of a PTB (3). .Sh PING STRUCTURE Ping structures consist of ping parameters and responses. The general form of a ping recorded in warts is as follows: .Bl -dash -offset 2n -compact -width 1n .It 8 bytes: Warts header, type 0x0007 .It Variable: Flags describing ping parameters and high-level outcomes .It uint16_t: Parameter length, included if any flags are set .It Variable: ping parameters, depending on flags .It uint16_t: Ping reply count .It Variable: Ping replies, if ping reply count > 0 .El .Pp The flags and data types that describe ping are as follows: .Bl -dash -offset 2n -compact -width 1n .It uint32_t: List ID assigned by warts, included if flag 1 is set .It uint32_t: Cycle ID assigned by warts, included if flag 2 is set .It uint32_t: Src IP address ID assigned by warts, included if flag 3 is set .It uint32_t: Dst IP address ID assigned by warts, included if flag 4 is set .It timeval: Time ping commenced, included if flag 5 is set .It uint8_t: Stop reason, included if flag 6 is set .It uint8_t: Stop data, included if flag 7 is set .It uint16_t: Data length, included if flag 8 is set .It Variable: data bytes, included if flag 9 is set .It uint16_t: Probe count, included if flag 10 is set .It uint16_t: Probe size, included if flag 11 is set .It uint8_t: Probe wait (seconds), included if flag 12 is set .It uint8_t: Probe TTL, included if flag 13 is set .It uint16_t: Reply count, included if flag 14 is set .It uint16_t: Pings sent, included if flag 15 is set .It uint8_t: Ping method, included if flag 16 is set .It uint16_t: Probe source port, included if flag 17 is set .It uint16_t: Probe destination port, included if flag 18 is set .It uint32_t: User ID, included if flag 19 is set .It address: Source address used, included if flag 20 is set .It address: Destination address used, included if flag 21 is set .It uint8_t: Ping flags, included if flag 22 is set .It uint8_t: Probe TOS, included if flag 23 is set .It variable: Probe Pre-specified timestamp option, included if flag 24 is set .It uint16_t: Probe ICMP checksum, included if flag 25 is set .It uint16_t: Reply psuedo Path MTU, included if flag 26 is set .It uint8_t: Probe timeout, included if flag 27 is set .It uint32_t: Probe wait (microseconds), included if flag 28 is set .El .Pp Ping response records are written in series. Each record takes the following form: .Sh SEE ALSO .Xr scamper 1 , .Xr libscamperfile 3 , .Xr sc_wartsdump 1 , .Rs .%A "M. Luckie" .%T "Scamper: a Scalable and Extensible Packet Prober for Active Measurement of the Internet" .%O "Proc. ACM/SIGCOMM Internet Measurement Conference 2010" .Re .Sh AUTHORS .Nm was written by Matthew Luckie . scamper-cvs-20171204/scamper/scamper_osinfo.h000644 001751 000000 00000002753 11752253572 020745 0ustar00mjlwheel000000 000000 /* * scamper_osinfo.h * * $Id: scamper_osinfo.h,v 1.1 2012/05/08 17:27:22 mjl Exp $ * * Copyright (C) 2006 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #define SCAMPER_OSINFO_OS_NULL 0 #define SCAMPER_OSINFO_OS_FREEBSD 1 #define SCAMPER_OSINFO_OS_OPENBSD 2 #define SCAMPER_OSINFO_OS_NETBSD 3 #define SCAMPER_OSINFO_OS_SUNOS 4 #define SCAMPER_OSINFO_OS_LINUX 5 #define SCAMPER_OSINFO_OS_DARWIN 6 #define SCAMPER_OSINFO_OS_WINDOWS 7 typedef struct scamper_osinfo { /* name of the OS, and an ID for it */ char *os; int os_id; /* parse the OS version string into integers */ long *os_rel; int os_rel_dots; } scamper_osinfo_t; #define SCAMPER_OSINFO_IS_SUNOS(os) ((os)->os_id == SCAMPER_OSINFO_OS_SUNOS) int scamper_osinfo_init(void); void scamper_osinfo_cleanup(void); const scamper_osinfo_t *scamper_osinfo_get(void); scamper-cvs-20171204/scamper/scamper_outfiles.c000644 001751 000000 00000017321 13210743023 021254 0ustar00mjlwheel000000 000000 /* * scamper_outfiles: hold a collection of output targets together * * $Id: scamper_outfiles.c,v 1.47 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_outfiles.c,v 1.47 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_debug.h" #include "scamper_file.h" #include "scamper_privsep.h" #include "scamper_outfiles.h" #include "utils.h" #include "mjl_splaytree.h" struct scamper_outfile { char *name; scamper_file_t *sf; int refcnt; }; static splaytree_t *outfiles = NULL; static scamper_outfile_t *outfile_def = NULL; static int outfile_cmp(const scamper_outfile_t *a, const scamper_outfile_t *b) { return strcasecmp(b->name, a->name); } static scamper_outfile_t *outfile_alloc(char *name, scamper_file_t *sf) { scamper_outfile_t *sof = NULL; if((sof = malloc_zero(sizeof(scamper_outfile_t))) == NULL) { printerror(__func__, "could not malloc sof"); goto err; } sof->sf = sf; sof->refcnt = 1; if((sof->name = strdup(name)) == NULL) { printerror(__func__, "could not strdup"); goto err; } if(splaytree_insert(outfiles, sof) == NULL) { printerror(__func__, "could not insert"); goto err; } scamper_debug(__func__, "name %s fd %d", name, scamper_file_getfd(sf)); return sof; err: if(sof != NULL) { if(sof->name != NULL) free(sof->name); free(sof); } return NULL; } static void outfile_free(scamper_outfile_t *sof) { assert(sof != NULL); if(sof->name != NULL && sof->sf != NULL) scamper_debug(__func__, "name %s fd %d", sof->name, scamper_file_getfd(sof->sf)); if(sof->name != NULL) { splaytree_remove_item(outfiles, sof); free(sof->name); } if(sof->sf != NULL) { scamper_file_close(sof->sf); } free(sof); return; } int scamper_outfile_getrefcnt(const scamper_outfile_t *sof) { return sof->refcnt; } scamper_file_t *scamper_outfile_getfile(scamper_outfile_t *sof) { return sof->sf; } const char *scamper_outfile_getname(const scamper_outfile_t *sof) { return sof->name; } scamper_outfile_t *scamper_outfile_use(scamper_outfile_t *sof) { if(sof != NULL) { sof->refcnt++; } return sof; } void scamper_outfile_free(scamper_outfile_t *sof) { assert(sof->refcnt > 0); if(--sof->refcnt == 0) outfile_free(sof); return; } int scamper_outfile_close(scamper_outfile_t *sof) { if(sof->refcnt > 1) { scamper_debug(__func__,"not closing %s refcnt %d",sof->name,sof->refcnt); return -1; } outfile_free(sof); return 0; } scamper_outfile_t *scamper_outfiles_get(const char *name) { const scamper_outfile_t findme = {(char *)name, NULL, 0}; if(name == NULL) return outfile_def; return splaytree_find(outfiles, &findme); } /* * scamper_outfiles_swap * * swap the files around. the name and refcnt parameters are unchanged. */ void scamper_outfiles_swap(scamper_outfile_t *a, scamper_outfile_t *b) { scamper_file_t *sf; sf = b->sf; b->sf = a->sf; a->sf = sf; return; } scamper_outfile_t *scamper_outfile_open(char *name, char *file, char *mo) { scamper_outfile_t *sof; scamper_file_t *sf; int flags; mode_t mode; char sf_mode; int fd; #if defined(WITHOUT_PRIVSEP) && !defined(_WIN32) uid_t uid; #endif if(name == NULL || file == NULL || mo == NULL) { return NULL; } if((sof = scamper_outfiles_get(name)) != NULL) { return NULL; } if(strcasecmp(mo, "append") == 0) { flags = O_RDWR | O_APPEND | O_CREAT; sf_mode = 'a'; } else if(strcasecmp(mo, "truncate") == 0) { flags = O_WRONLY | O_TRUNC | O_CREAT; sf_mode = 'w'; } else { return NULL; } #ifndef _WIN32 mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; #else mode = _S_IREAD | _S_IWRITE; flags |= O_BINARY; #endif #if defined(WITHOUT_PRIVSEP) fd = open(file, flags, mode); #else fd = scamper_privsep_open_file(file, flags, mode); #endif /* make sure the fd is valid, otherwise bail */ if(fd == -1) return NULL; #if defined(WITHOUT_PRIVSEP) && !defined(_WIN32) if((uid = getuid()) != geteuid() && fchown(fd, uid, -1) != 0) printerror(__func__, "could not fchown"); #endif if((sf = scamper_file_openfd(fd, file, sf_mode, "warts")) == NULL) { close(fd); return NULL; } if((sof = outfile_alloc(name, sf)) == NULL) { scamper_file_close(sf); return NULL; } return sof; } static int outfile_opendef(char *filename, char *type) { scamper_file_t *sf; int flags; mode_t mode; char sf_mode; int fd; flags = O_WRONLY | O_TRUNC | O_CREAT; sf_mode = 'w'; #ifndef _WIN32 mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; #else mode = _S_IREAD | _S_IWRITE; flags |= O_BINARY; #endif if(strcmp(filename, "-") == 0) { fd = STDOUT_FILENO; } else { #if defined(WITHOUT_PRIVSEP) fd = open(filename, flags, mode); #else fd = scamper_privsep_open_file(filename, flags, mode); #endif } if(fd == -1) { return -1; } if((sf = scamper_file_openfd(fd, filename, sf_mode, type)) == NULL) { close(fd); return -1; } if((outfile_def = outfile_alloc(filename, sf)) == NULL) { scamper_file_close(sf); return -1; } return 0; } scamper_outfile_t *scamper_outfile_openfd(char *name, int fd, char *type) { scamper_outfile_t *sof = NULL; scamper_file_t *sf = NULL; if(fd == -1 || (sf = scamper_file_openfd(fd, NULL, 'w', type)) == NULL) return NULL; if((sof = outfile_alloc(name, sf)) == NULL) { scamper_file_free(sf); return NULL; } return sof; } scamper_outfile_t *scamper_outfile_opennull(char *name, char *format) { scamper_outfile_t *sof; scamper_file_t *sf; if((sf = scamper_file_opennull('w', format)) == NULL) { printerror(__func__, "could not opennull"); return NULL; } if((sof = outfile_alloc(name, sf)) == NULL) { scamper_file_free(sf); return NULL; } return sof; } void scamper_outfiles_foreach(void *p, int (*func)(void *p, scamper_outfile_t *sof)) { splaytree_inorder(outfiles, (splaytree_inorder_t)func, p); return; } int scamper_outfiles_init(char *def_filename, char *def_type) { if((outfiles = splaytree_alloc((splaytree_cmp_t)outfile_cmp)) == NULL) { printerror(__func__, "could not alloc outfiles tree"); return -1; } if(outfile_opendef(def_filename, def_type) != 0) return -1; return 0; } void scamper_outfiles_cleanup() { if(outfile_def != NULL) { if(--outfile_def->refcnt > 0) { scamper_debug(__func__, "default outfile refcnt %d", outfile_def->refcnt); } outfile_free(outfile_def); outfile_def = NULL; } if(outfiles != NULL) { splaytree_free(outfiles, NULL); outfiles = NULL; } return; } scamper-cvs-20171204/scamper/scamper_outfiles.h000644 001751 000000 00000003672 13130372145 021271 0ustar00mjlwheel000000 000000 /* * scamper_outfiles: hold a collection of output targets together * * $Id: scamper_outfiles.h,v 1.19 2017/07/09 09:16:21 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_OUTFILES_H #define __SCAMPER_OUTFILES_H typedef struct scamper_outfile scamper_outfile_t; struct scamper_file; struct scamper_file *scamper_outfile_getfile(scamper_outfile_t *sof); const char *scamper_outfile_getname(const scamper_outfile_t *sof); int scamper_outfile_getrefcnt(const scamper_outfile_t *sof); scamper_outfile_t *scamper_outfile_open(char *alias, char *file, char *mo); int scamper_outfile_close(scamper_outfile_t *sof); scamper_outfile_t *scamper_outfile_use(scamper_outfile_t *sof); void scamper_outfile_free(scamper_outfile_t *sof); scamper_outfile_t *scamper_outfile_openfd(char *name, int fd, char *type); scamper_outfile_t *scamper_outfile_opennull(char *name, char *format); scamper_outfile_t *scamper_outfiles_get(const char *alias); void scamper_outfiles_swap(scamper_outfile_t *a, scamper_outfile_t *b); void scamper_outfiles_foreach(void *p, int (*func)(void *p, scamper_outfile_t *sof)); int scamper_outfiles_init(char *def_filename, char *def_type); void scamper_outfiles_cleanup(void); #endif scamper-cvs-20171204/scamper/scamper_privsep.c000644 001751 000000 00000077457 13210743023 021132 0ustar00mjlwheel000000 000000 /* * scamper_privsep.c: code that does root-required tasks * * $Id: scamper_privsep.c,v 1.89 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2013-2014 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef WITHOUT_PRIVSEP #ifndef lint static const char rcsid[] = "$Id: scamper_privsep.c,v 1.89 2017/12/03 09:38:27 mjl Exp $"; #endif #include "internal.h" #include "scamper_privsep.h" #include "scamper_debug.h" #include "scamper_dl.h" #include "scamper_rtsock.h" #include "scamper_firewall.h" #include "scamper_icmp4.h" #include "scamper_icmp6.h" #include "scamper_udp4.h" #include "scamper_ip4.h" #include "utils.h" typedef struct privsep_msg { uint16_t plen; uint16_t type; } privsep_msg_t; typedef struct privsep_func { int (*dofunc)(uint16_t len, const uint8_t *param); int (*txfunc)(int, int, uint8_t); } privsep_func_t; static pid_t root_pid = -1; /* the process id of the root code */ static int root_fd = -1; /* the fd the root code send/recv on */ static int lame_fd = -1; /* the fd that the lame code uses */ static void *cmsgbuf = NULL; /* cmsgbuf sized for one fd */ /* * the privilege separation code works by allowing the lame process to send * request messages to the root process. these define the messages that * the root process understands. */ #define SCAMPER_PRIVSEP_EXIT 0x00U #define SCAMPER_PRIVSEP_OPEN_DATALINK 0x01U #define SCAMPER_PRIVSEP_OPEN_FILE 0x02U #define SCAMPER_PRIVSEP_OPEN_RTSOCK 0x03U #define SCAMPER_PRIVSEP_OPEN_ICMP 0x04U #define SCAMPER_PRIVSEP_OPEN_SOCK 0x05U #define SCAMPER_PRIVSEP_OPEN_RAWUDP 0x06U #define SCAMPER_PRIVSEP_OPEN_UNIX 0x07U #define SCAMPER_PRIVSEP_OPEN_RAWIP 0x08U #define SCAMPER_PRIVSEP_UNLINK 0x09U #define SCAMPER_PRIVSEP_IPFW_INIT 0x0aU #define SCAMPER_PRIVSEP_IPFW_CLEANUP 0x0bU #define SCAMPER_PRIVSEP_IPFW_ADD 0x0cU #define SCAMPER_PRIVSEP_IPFW_DEL 0x0dU #define SCAMPER_PRIVSEP_PF_INIT 0x0eU #define SCAMPER_PRIVSEP_PF_CLEANUP 0x0fU #define SCAMPER_PRIVSEP_PF_ADD 0x10U #define SCAMPER_PRIVSEP_PF_DEL 0x11U #define SCAMPER_PRIVSEP_MAXTYPE (SCAMPER_PRIVSEP_PF_DEL) /* * privsep_open_rawsock * * open a raw icmp socket. one integer parameter corresponding to the 'type' * is supplied in param. * */ static int privsep_open_icmp(uint16_t plen, const uint8_t *param) { int type; if(plen != sizeof(type)) { scamper_debug(__func__, "plen %d != %d", plen, sizeof(type)); return -1; } memcpy(&type, param, sizeof(type)); if(type == AF_INET) return scamper_icmp4_open_fd(); if(type == AF_INET6) return scamper_icmp6_open_fd(); scamper_debug(__func__, "type %d != AF_INET || AF_INET6", type); errno = EINVAL; return -1; } /* * privsep_open_rtsock * * open a routing socket. there are no parameters permitted to this * method call. */ static int privsep_open_rtsock(uint16_t plen, const uint8_t *param) { if(plen != 0) { scamper_debug(__func__, "plen %d != 0", plen, 0); errno = EINVAL; return -1; } return scamper_rtsock_open_fd(); } /* * privsep_open_datalink * * open a BPF or PF_PACKET socket to the datalink. the param has a single * field: the ifindex of the device to monitor. */ static int privsep_open_datalink(uint16_t plen, const uint8_t *param) { int ifindex; /* the payload should have an integer field - no more, no less. */ if(plen != sizeof(ifindex)) { scamper_debug(__func__, "plen %d != %d", plen, sizeof(ifindex)); errno = EINVAL; return -1; } memcpy(&ifindex, param, sizeof(ifindex)); return scamper_dl_open_fd(ifindex); } static int privsep_open_sock(uint16_t plen, const uint8_t *param) { struct sockaddr_in sin4; struct sockaddr_in6 sin6; int domain, type, protocol, port; const size_t size = sizeof(domain) + sizeof(protocol) + sizeof(port); size_t off = 0; int fd = -1; if(plen != size) { scamper_debug(__func__, "plen %d != %d", plen, size); errno = EINVAL; goto err; } off = 0; memcpy(&domain, param+off, sizeof(domain)); off += sizeof(domain); memcpy(&protocol, param+off, sizeof(protocol)); off += sizeof(protocol); memcpy(&port, param+off, sizeof(port)); off += sizeof(port); if(off != plen) goto inval; if(port < 1 || port > 65535) { scamper_debug(__func__, "refusing to bind to port %d", port); goto inval; } if(protocol == IPPROTO_TCP) type = SOCK_STREAM; else if(protocol == IPPROTO_UDP) type = SOCK_DGRAM; else { scamper_debug(__func__, "unhandled IPv4 protocol %d", protocol); goto inval; } if(domain == AF_INET) { if((fd = socket(AF_INET, type, protocol)) == -1) { printerror(__func__, "could not open IPv4 socket"); goto err; } sockaddr_compose((struct sockaddr *)&sin4, AF_INET, NULL, port); if(bind(fd, (struct sockaddr *)&sin4, sizeof(sin4)) == -1) { printerror(__func__, "could not bind to IPv4 protocol %d port %d", protocol, port); goto err; } } else if(domain == AF_INET6) { if((fd = socket(AF_INET6, type, protocol)) == -1) { printerror(__func__, "could not open IPv6 socket"); goto err; } sockaddr_compose((struct sockaddr *)&sin6, AF_INET6, NULL, port); if(bind(fd, (struct sockaddr *)&sin6, sizeof(sin6)) == -1) { printerror(__func__, "could not bind to IPv6 protocol %d port %d", protocol, port); goto err; } } else return -1; return fd; inval: errno = EINVAL; err: if(fd != -1) close(fd); return -1; } static int privsep_open_rawudp(uint16_t plen, const uint8_t *param) { struct in_addr in; if(plen != 4) { scamper_debug(__func__, "plen %d != 4", plen); errno = EINVAL; return -1; } memcpy(&in, param+0, sizeof(in)); return scamper_udp4_openraw_fd(&in); } static int privsep_open_rawip(uint16_t plen, const uint8_t *param) { if(plen != 0) { scamper_debug(__func__, "plen %d != 4", plen); errno = EINVAL; return -1; } return scamper_ip4_openraw_fd(); } static int privsep_ipfw_init(uint16_t plen, const uint8_t *param) { #ifdef HAVE_IPFW if(plen != 0) { scamper_debug(__func__, "plen %d != 0", plen); errno = EINVAL; return -1; } return scamper_firewall_ipfw_init(); #else scamper_debug(__func__, "not on ipfw system"); errno = EINVAL; return -1; #endif } static int privsep_ipfw_cleanup(uint16_t plen, const uint8_t *param) { #ifdef HAVE_IPFW if(plen != 0) { scamper_debug(__func__, "plen %d != 0", plen); errno = EINVAL; return -1; } scamper_firewall_ipfw_cleanup(); return 0; #else scamper_debug(__func__, "not on ipfw system"); errno = EINVAL; return -1; #endif } static int privsep_ipfw_add(uint16_t plen, const uint8_t *param) { #ifdef HAVE_IPFW int n, af, p, sp, dp; struct in_addr s4, d4; struct in6_addr s6, d6; void *s, *d = NULL; uint8_t df; uint16_t off = 0, al; if(plen < 1 + sizeof(int)) { scamper_debug(__func__, "plen %d < %d", plen, 1 + sizeof(int)); goto inval; } df = param[0]; off++; if(df != 0 && df != 1) { scamper_debug(__func__, "df %d", df); goto inval; } memcpy(&af, param+off, sizeof(af)); off += sizeof(af); if(af == AF_INET) { s = &s4; al = 4; if(df == 0) { if(plen != 1 + (sizeof(int) * 5) + sizeof(struct in_addr)) goto inval; } else { if(plen != 1 + (sizeof(int) * 5) + (sizeof(struct in_addr) * 2)) goto inval; d = &d4; } } else if(af == AF_INET6) { s = &s6; al = 16; if(df == 0) { if(plen != 1 + (sizeof(int) * 5) + sizeof(struct in6_addr)) goto inval; } else { if(plen != 1 + (sizeof(int) * 5) + (sizeof(struct in6_addr) * 2)) goto inval; d = &d6; } } else goto inval; memcpy(&n, param+off, sizeof(n)); off += sizeof(n); memcpy(&p, param+off, sizeof(p)); off += sizeof(p); memcpy(s, param+off, al); off += al; if(df != 0) { memcpy(d, param+off, al); off += al; } memcpy(&sp, param+off, sizeof(sp)); off += sizeof(sp); memcpy(&dp, param+off, sizeof(dp)); off += sizeof(dp); if(off != plen) goto inval; if(sp < 0 || sp > 65535 || dp < 0 || dp > 65535) goto inval; if(p != IPPROTO_TCP && p != IPPROTO_UDP) goto inval; return scamper_firewall_ipfw_add(n, af, p, s, d, sp, dp); inval: errno = EINVAL; return -1; #else scamper_debug(__func__, "not on ipfw system"); errno = EINVAL; return -1; #endif } static int privsep_ipfw_del(uint16_t plen, const uint8_t *param) { #ifdef HAVE_IPFW int n, af; uint16_t off = 0; if(plen != sizeof(int) * 2) { scamper_debug(__func__, "plen %d != %d", plen, sizeof(int) * 2); goto inval; } memcpy(&n, param+off, sizeof(n)); off += sizeof(n); memcpy(&af, param+off, sizeof(af)); off += sizeof(af); if(off != plen) goto inval; return scamper_firewall_ipfw_del(n, af); inval: errno = EINVAL; return -1; #else scamper_debug(__func__, "not on ipfw system"); errno = EINVAL; return -1; #endif } static int privsep_pf_init(uint16_t plen, const uint8_t *param) { #ifdef HAVE_PF const char *name = (const char *)param; if(plen == 0) { scamper_debug(__func__, "plen == 0", plen); errno = EINVAL; return -1; } if(string_isprint(name, plen) == 0) { scamper_debug(__func__, "name is not printable"); errno = EINVAL; return -1; } if(name[plen] != '\0' || strlen(name) + 1 != plen) { scamper_debug(__func__, "malformed initialisation"); errno = EINVAL; return -1; } return scamper_firewall_pf_init(name); #else scamper_debug(__func__, "not on pf system"); errno = EINVAL; return -1; #endif } static int privsep_pf_cleanup(uint16_t plen, const uint8_t *param) { #ifdef HAVE_PF if(plen != 0) { scamper_debug(__func__, "plen %d != 0", plen); errno = EINVAL; return -1; } scamper_firewall_pf_cleanup(); return 0; #else scamper_debug(__func__, "not on pf system"); errno = EINVAL; return -1; #endif } static int privsep_pf_add(uint16_t plen, const uint8_t *param) { #ifdef HAVE_PF int n, af, p, sp, dp; struct in_addr s4, d4; struct in6_addr s6, d6; void *s, *d; uint16_t off = 0, al; if(plen < sizeof(int)) { scamper_debug(__func__, "plen %d < %d", plen, sizeof(int)); goto inval; } memcpy(&af, param+off, sizeof(af)); off += sizeof(af); if(af == AF_INET) { if(plen != (sizeof(int) * 5) + (sizeof(struct in_addr) * 2)) goto inval; s = &s4; d = &d4; al = 4; } else if(af == AF_INET6) { if(plen != (sizeof(int) * 5) + (sizeof(struct in6_addr) * 2)) goto inval; s = &s6; d = &d6; al = 16; } else goto inval; memcpy(&n, param+off, sizeof(n)); off += sizeof(n); memcpy(&p, param+off, sizeof(p)); off += sizeof(p); memcpy(s, param+off, al); off += al; memcpy(d, param+off, al); off += al; memcpy(&sp, param+off, sizeof(sp)); off += sizeof(sp); memcpy(&dp, param+off, sizeof(dp)); off += sizeof(dp); if(off != plen) goto inval; if(sp < 0 || sp > 65535 || dp < 0 || dp > 65535) goto inval; if(p != IPPROTO_TCP && p != IPPROTO_UDP) goto inval; return scamper_firewall_pf_add(n, af, p, s, d, sp, dp); inval: errno = EINVAL; return -1; #else scamper_debug(__func__, "not on pf system"); errno = EINVAL; return -1; #endif } static int privsep_pf_del(uint16_t plen, const uint8_t *param) { #ifdef HAVE_PF int n; if(plen != sizeof(int)) { scamper_debug(__func__, "plen %d != %d", plen, sizeof(int)); errno = EINVAL; return -1; } memcpy(&n, param, sizeof(n)); return scamper_firewall_pf_del(n); #else scamper_debug(__func__, "not on pf system"); errno = EINVAL; return -1; #endif } static int privsep_unlink(uint16_t plen, const uint8_t *param) { const char *name = (const char *)param; uid_t uid, euid; if(plen < 2 || name[plen-1] != '\0') return -1; uid = getuid(); euid = geteuid(); if(seteuid(uid) != 0) return -1; unlink(name); if(seteuid(euid) != 0) exit(-errno); return 0; } static int privsep_open_unix(uint16_t plen, const uint8_t *param) { const char *name = (const char *)param; struct sockaddr_un sn; uid_t uid, euid; int fd, brc; if(plen < 2 || name[plen-1] != '\0') return -1; if(sockaddr_compose_un((struct sockaddr *)&sn, name) != 0) return -1; /* set our effective uid to be the user who started scamper */ uid = getuid(); euid = geteuid(); if(seteuid(uid) != 0) return -1; /* open the socket, bind it, and make it listen */ if((fd = socket(AF_UNIX, SOCK_STREAM, 0)) != -1) { if((brc = bind(fd, (struct sockaddr *)&sn, sizeof(sn))) != 0 || listen(fd, -1) != 0) { close(fd); fd = -1; if(brc == 0) unlink(name); } } if(seteuid(euid) != 0) { if(fd != -1) close(fd); exit(-errno); } return fd; } /* * privsep_open_file * * switch to the user running the process and open the file specified. * the param has two fields in it: the mode of open, and the file to open. */ static int privsep_open_file(uint16_t plen, const uint8_t *param) { const char *file; uid_t uid, euid; int flags; mode_t mode = 0; uint16_t off; int fd; /* * if the payload of param is not large enough to hold the flags and a * filename, then don't go any further */ if(plen < sizeof(int) + 2) return -1; memcpy(&flags, param, sizeof(int)); off = sizeof(int); /* if the O_CREAT flag is set, we need to fetch the mode parameter too */ if(flags & O_CREAT) { /* * the payload length of the parameter must be large enough to hold * the flags, mode, and a filename */ if(plen < off + sizeof(mode_t) + 2) return -1; memcpy(&mode, param+off, sizeof(mode)); off += sizeof(mode); } file = (const char *)(param + off); /* * make sure the length of the file to open checks out. * the last byte of the string must be a null character. */ if(file[plen-off-1] != '\0') { scamper_debug(__func__, "filename not terminated with a null"); return -1; } uid = getuid(); euid = geteuid(); /* set our effective uid to be the user who started scamper */ if(seteuid(uid) == -1) { return -1; } if(flags & O_CREAT) fd = open(file, flags, mode); else fd = open(file, flags); /* * ask for our root permissions back. if we can't get them back, then * this process is crippled and it might as well exit now. */ if(seteuid(euid) == -1) { if(fd != -1) close(fd); exit(-errno); } return fd; } static int privsep_send_rc(int rc, int error, uint8_t msg_type) { uint8_t buf[sizeof(int) * 2]; struct msghdr msg; struct iovec vec; scamper_debug(__func__, "rc: %d, error: %d, msg_type: 0x%02x", rc, error, msg_type); memset(&vec, 0, sizeof(vec)); memset(&msg, 0, sizeof(msg)); memcpy(buf, &rc, sizeof(int)); memcpy(buf+sizeof(int), &error, sizeof(int)); vec.iov_base = (void *)buf; vec.iov_len = sizeof(buf); msg.msg_iov = &vec; msg.msg_iovlen = 1; if(sendmsg(root_fd, &msg, 0) == -1) return -1; return 0; } /* * privsep_send_fd * * send the fd created using the priviledged code. if the fd was not * successfully created, we send the errno back in the payload of the * message. */ static int privsep_send_fd(int fd, int error, uint8_t msg_type) { struct msghdr msg; struct iovec vec; struct cmsghdr *cmsg; scamper_debug(__func__, "fd: %d error: %d msg_type: 0x%02x", fd, error, msg_type); memset(&vec, 0, sizeof(vec)); memset(&msg, 0, sizeof(msg)); vec.iov_base = (void *)&error; vec.iov_len = sizeof(error); msg.msg_iov = &vec; msg.msg_iovlen = 1; if(fd != -1) { msg.msg_control = (caddr_t)cmsgbuf; msg.msg_controllen = CMSG_SPACE(sizeof(fd)); cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_len = CMSG_LEN(sizeof(fd)); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; *(int *)CMSG_DATA(cmsg) = fd; } if(sendmsg(root_fd, &msg, 0) == -1) { printerror(__func__, "couldnt send fd"); return -1; } return 0; } static int privsep_recv_fd(void) { struct msghdr msg; struct iovec vec; ssize_t rc; int fd = -1, error = 0; struct cmsghdr *cmsg; memset(&vec, 0, sizeof(vec)); memset(&msg, 0, sizeof(msg)); vec.iov_base = (char *)&error; vec.iov_len = sizeof(error); msg.msg_iov = &vec; msg.msg_iovlen = 1; msg.msg_control = cmsgbuf; msg.msg_controllen = CMSG_SPACE(sizeof(fd)); if((rc = recvmsg(lame_fd, &msg, 0)) == -1) { printerror(__func__, "recvmsg failed"); return -1; } else if(rc != sizeof(error)) { return -1; } if(error == 0) { cmsg = CMSG_FIRSTHDR(&msg); if(cmsg != NULL && cmsg->cmsg_type == SCM_RIGHTS) { fd = (*(int *)CMSG_DATA(cmsg)); } } else { errno = error; } return fd; } /* * privsep_do * * this is the only piece of code with root priviledges. we use it to * create raw sockets, routing/netlink sockets, BPF/PF_PACKET sockets, and * ordinary files that scamper itself cannot do by itself. */ static int privsep_do(void) { static const privsep_func_t funcs[] = { {NULL, NULL}, {privsep_open_datalink, privsep_send_fd}, {privsep_open_file, privsep_send_fd}, {privsep_open_rtsock, privsep_send_fd}, {privsep_open_icmp, privsep_send_fd}, {privsep_open_sock, privsep_send_fd}, {privsep_open_rawudp, privsep_send_fd}, {privsep_open_unix, privsep_send_fd}, {privsep_open_rawip, privsep_send_fd}, {privsep_unlink, privsep_send_rc}, {privsep_ipfw_init, privsep_send_rc}, {privsep_ipfw_cleanup, privsep_send_rc}, {privsep_ipfw_add, privsep_send_rc}, {privsep_ipfw_del, privsep_send_rc}, {privsep_pf_init, privsep_send_rc}, {privsep_pf_cleanup, privsep_send_rc}, {privsep_pf_add, privsep_send_rc}, {privsep_pf_del, privsep_send_rc}, }; privsep_msg_t msg; void *data = NULL; int ret = 0, error; int fd; #if defined(HAVE_SETPROCTITLE) setproctitle("%s", "[priv]"); #endif /* might as well set our copy of the root_pid to something useful */ root_pid = getpid(); /* * the priviledged process does not need the lame file descriptor for * anything, so get rid of it */ close(lame_fd); lame_fd = -1; for(;;) { /* read the msg header */ if((ret = read_wrap(root_fd, (uint8_t *)&msg, NULL, sizeof(msg))) != 0) { if(ret == -1) printerror(__func__, "could not read msg hdr"); break; } /* if we've been told to exit, then do so now */ if(msg.type == SCAMPER_PRIVSEP_EXIT) break; if(msg.type > SCAMPER_PRIVSEP_MAXTYPE) { scamper_debug(__func__, "msg %d > maxtype", msg.type); ret = -EINVAL; break; } /* if there is more data to read, read it now */ if(msg.plen != 0) { if((data = malloc_zero(msg.plen)) == NULL) { printerror(__func__, "couldnt malloc data"); ret = (-errno); break; } if((ret = read_wrap(root_fd, data, NULL, msg.plen)) != 0) { printerror(__func__, "couldnt read data"); free(data); break; } } else data = NULL; if((fd = funcs[msg.type].dofunc(msg.plen, data)) == -1) error = errno; else error = 0; /* we don't need the data we read anymore */ if(data != NULL) free(data); if(funcs[msg.type].txfunc(fd, error, msg.type) != 0) break; if(funcs[msg.type].txfunc == privsep_send_fd && fd != -1) close(fd); } close(root_fd); return ret; } /* * privsep_lame_send * * compose and send the messages necessary to communicate with the root * process. */ static int privsep_lame_send(const uint16_t type, const uint16_t len, const uint8_t *param) { privsep_msg_t msg; assert(type != SCAMPER_PRIVSEP_EXIT); assert(type <= SCAMPER_PRIVSEP_MAXTYPE); /* send the header first */ msg.type = type; msg.plen = len; if(write_wrap(lame_fd, &msg, NULL, sizeof(msg)) == -1) { printerror(__func__, "could not send msg header"); return -1; } /* if there is a parameter data to send, send it now */ if(len != 0 && write_wrap(lame_fd, param, NULL, len) == -1) { printerror(__func__, "could not send msg param"); return -1; } return 0; } /* * privsep_getfd * * send a request to the piece of code running as root to do open a file * descriptor that requires priviledge to do. return the file descriptor. */ static int privsep_getfd(uint16_t type, uint16_t len, const uint8_t *param) { if(privsep_lame_send(type, len, param) == -1) { return -1; } return privsep_recv_fd(); } static int privsep_dotask(uint16_t type, uint16_t len, const uint8_t *param) { uint8_t buf[sizeof(int)*2]; int error; int rc; if(privsep_lame_send(type, len, param) == -1) return -1; if(read_wrap(lame_fd, buf, NULL, sizeof(buf)) == -1) return -1; memcpy(&rc, buf, sizeof(rc)); memcpy(&error, buf+sizeof(int), sizeof(error)); if(rc != 0) errno = error; return rc; } static int privsep_getfd_1int(const uint16_t type, const int p1) { uint8_t param[sizeof(p1)]; memcpy(param, &p1, sizeof(p1)); return privsep_getfd(type, sizeof(param), param); } static int privsep_getfd_3int(const uint16_t type, const int p1, const int p2, const int p3) { uint8_t param[sizeof(p1)+sizeof(p2)+sizeof(p3)]; size_t off = 0; memcpy(param+off, &p1, sizeof(p1)); off += sizeof(p1); memcpy(param+off, &p2, sizeof(p2)); off += sizeof(p2); memcpy(param+off, &p3, sizeof(p3)); return privsep_getfd(type, sizeof(param), param); } int scamper_privsep_open_datalink(const int ifindex) { return privsep_getfd_1int(SCAMPER_PRIVSEP_OPEN_DATALINK, ifindex); } int scamper_privsep_open_unix(const char *file) { int len = strlen(file) + 1; return privsep_getfd(SCAMPER_PRIVSEP_OPEN_UNIX, len, (const uint8_t *)file); } int scamper_privsep_open_file(const char *file, const int flags, const mode_t mode) { uint8_t *param; int off, len, fd; /* * decide how big the message is going to be. don't pass it if the message * length parameter constrains us */ len = sizeof(flags) + strlen(file) + 1; if(flags & O_CREAT) len += sizeof(mode); /* * the len is fixed because the length parameter used in the privsep * header is a 16-bit unsigned integer. */ if(len > 65535) return -1; /* allocate the parameter */ if((param = malloc_zero(len)) == NULL) return -1; /* copy in the flags parameter, and the mode parameter if necessary */ memcpy(param, &flags, sizeof(flags)); off = sizeof(flags); if(flags & O_CREAT) { memcpy(param+off, &mode, sizeof(mode)); off += sizeof(mode); } /* finally copy in the name of the file to open */ memcpy(param+off, file, len-off); /* get the file descriptor and return it */ fd = privsep_getfd(SCAMPER_PRIVSEP_OPEN_FILE, len, param); free(param); return fd; } int scamper_privsep_open_rtsock(void) { return privsep_getfd(SCAMPER_PRIVSEP_OPEN_RTSOCK, 0, NULL); } int scamper_privsep_open_icmp(const int domain) { return privsep_getfd_1int(SCAMPER_PRIVSEP_OPEN_ICMP, domain); } int scamper_privsep_open_tcp(const int domain, const int port) { return privsep_getfd_3int(SCAMPER_PRIVSEP_OPEN_SOCK,domain,IPPROTO_TCP,port); } int scamper_privsep_open_udp(const int domain, const int port) { return privsep_getfd_3int(SCAMPER_PRIVSEP_OPEN_SOCK,domain,IPPROTO_UDP,port); } int scamper_privsep_open_rawudp(const void *addr) { uint8_t param[4]; if(addr == NULL) memset(param, 0, 4); else memcpy(param, addr, 4); return privsep_getfd(SCAMPER_PRIVSEP_OPEN_RAWUDP, sizeof(param), param); } int scamper_privsep_open_rawip(void) { return privsep_getfd(SCAMPER_PRIVSEP_OPEN_RAWIP, 0, NULL); } int scamper_privsep_unlink(const char *file) { int len = strlen(file) + 1; return privsep_dotask(SCAMPER_PRIVSEP_UNLINK, len, (const uint8_t *)file); } int scamper_privsep_ipfw_init(void) { return privsep_dotask(SCAMPER_PRIVSEP_IPFW_INIT, 0, NULL); } int scamper_privsep_ipfw_cleanup(void) { return privsep_dotask(SCAMPER_PRIVSEP_IPFW_CLEANUP, 0, NULL); } int scamper_privsep_ipfw_add(int n,int af,int p,void *s,void *d,int sp,int dp) { uint8_t param[1 + (sizeof(int) * 5) + (16 * 2)]; uint16_t len = 0; uint16_t al; if(d == NULL) param[0] = 0; else param[0] = 1; len++; if(af == AF_INET) al = 4; else if(af == AF_INET6) al = 16; else return -1; memcpy(param+len, &af, sizeof(af)); len += sizeof(af); memcpy(param+len, &n, sizeof(n)); len += sizeof(n); memcpy(param+len, &p, sizeof(p)); len += sizeof(p); memcpy(param+len, s, al); len += al; if(d != NULL) { memcpy(param+len, d, al); len += al; } memcpy(param+len, &sp, sizeof(sp)); len += sizeof(sp); memcpy(param+len, &dp, sizeof(dp)); len += sizeof(dp); return privsep_dotask(SCAMPER_PRIVSEP_IPFW_ADD, len, param); } int scamper_privsep_ipfw_del(int n, int af) { uint8_t param[(sizeof(int) * 2)]; uint16_t len = 0; memcpy(param+len, &n, sizeof(int)); len += sizeof(n); memcpy(param+len, &af, sizeof(int)); len += sizeof(af); return privsep_dotask(SCAMPER_PRIVSEP_IPFW_DEL, len, param); } int scamper_privsep_pf_init(const char *anchor) { int len = strlen(anchor) + 1; return privsep_dotask(SCAMPER_PRIVSEP_PF_INIT, len, (const uint8_t *)anchor); } int scamper_privsep_pf_cleanup(void) { return privsep_dotask(SCAMPER_PRIVSEP_PF_CLEANUP, 0, NULL); } int scamper_privsep_pf_add(int n,int af,int p,void *s,void *d,int sp,int dp) { uint8_t param[(sizeof(int) * 5) + (16 * 2)]; uint16_t len = 0; uint16_t al; if(af == AF_INET) al = 4; else if(af == AF_INET6) al = 16; else return -1; memcpy(param+len, &af, sizeof(af)); len += sizeof(af); memcpy(param+len, &n, sizeof(n)); len += sizeof(n); memcpy(param+len, &p, sizeof(p)); len += sizeof(p); memcpy(param+len, s, al); len += al; memcpy(param+len, d, al); len += al; memcpy(param+len, &sp, sizeof(sp)); len += sizeof(sp); memcpy(param+len, &dp, sizeof(dp)); len += sizeof(dp); return privsep_dotask(SCAMPER_PRIVSEP_PF_ADD, len, param); } int scamper_privsep_pf_del(int n) { uint8_t param[sizeof(int)]; memcpy(param, &n, sizeof(int)); return privsep_dotask(SCAMPER_PRIVSEP_PF_DEL, sizeof(int), param); } /* * scamper_privsep * * start a child process that has the root priviledges that scamper starts * with. then, revoke scamper's priviledges to the minimum scamper can * obtain */ int scamper_privsep_init() { struct addrinfo hints, *res0; struct timeval tv; struct passwd *pw; struct stat sb; mode_t mode; uid_t uid; gid_t gid; int sockets[2]; pid_t pid; int ret; time_t t; /* check to see if the PRIVSEP_DIR exists */ if(stat(PRIVSEP_DIR, &sb) == -1) { /* if the directory does not exist, try and create it now */ if(errno == ENOENT) { /* * get the uid of the user who will get ownership of the directory. * by default, this will be root. */ if((pw = getpwnam(PRIVSEP_DIR_USER)) == NULL) { printerror(__func__, "could not getpwnam " PRIVSEP_DIR_USER); endpwent(); return -1; } uid = pw->pw_uid; endpwent(); gid = 0; /* create the directory as 555 : no one can write to it */ mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; if(mkdir(PRIVSEP_DIR, mode) == -1) { printerror(__func__, "could not mkdir " PRIVSEP_DIR); return -1; } /* assign ownership appropriately */ if(chown(PRIVSEP_DIR, uid, gid) == -1) { printerror(__func__, "could not chown " PRIVSEP_DIR); rmdir(PRIVSEP_DIR); return -1; } } else { printerror(__func__, "could not stat " PRIVSEP_DIR); return -1; } } /* * open up the unix domain sockets that will allow the prober to talk * with the priviledged process */ if(socketpair(AF_UNIX, SOCK_STREAM, 0, sockets) == -1) { printerror(__func__, "could not socketpair"); return -1; } lame_fd = sockets[0]; root_fd = sockets[1]; if((cmsgbuf = malloc_zero(CMSG_SPACE(sizeof(int)))) == NULL) { printerror(__func__, "could not malloc cmsgbuf"); return -1; } if((pid = fork()) == -1) { printerror(__func__, "could not fork"); return -1; } else if(pid == 0) /* child */ { /* * this is the process that will do the root tasks. * when this function exits, we call exit() on the forked process. */ ret = privsep_do(); exit(ret); } /* set our copy of the root_pid to the relevant process id */ root_pid = pid; /* * we don't need our copy of the file descriptor passed to the priviledged * process any longer */ close(root_fd); root_fd = -1; /* * get the details for the PRIVSEP_USER login, which the rest of scamper * will use to get things done */ if((pw = getpwnam(PRIVSEP_USER)) == NULL) { printerror(__func__, "could not getpwnam " PRIVSEP_USER); return -1; } uid = pw->pw_uid; gid = pw->pw_gid; memset(pw->pw_passwd, 0, strlen(pw->pw_passwd)); endpwent(); /* * call localtime now, as then the unpriviledged process will have the * local time zone information cached in the process, so localtime will * actually mean something */ gettimeofday_wrap(&tv); t = tv.tv_sec; localtime(&t); /* * call getaddrinfo now, as then the unpriviledged process will load * whatever files it needs to to help resolve IP addresses; the need for * this was first noticed in SunOS */ memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = IPPROTO_UDP; hints.ai_family = AF_INET; getaddrinfo("localhost", NULL, &hints, &res0); freeaddrinfo(res0); /* change the root directory of the unpriviledged directory */ if(chroot(PRIVSEP_DIR) == -1) { printerror(__func__, "could not chroot to " PRIVSEP_DIR); return -1; } /* go into the chroot environment */ if(chdir("/") == -1) { printerror(__func__, "could not chdir /"); return -1; } /* change the operating group */ if(setgroups(1, &gid) == -1) { printerror(__func__, "could not setgroups"); return -1; } if(setgid(gid) == -1) { printerror(__func__, "could not setgid"); return -1; } /* change the operating user */ if(setuid(uid) == -1) { printerror(__func__, "could not setuid"); return -1; } return lame_fd; } void scamper_privsep_cleanup() { privsep_msg_t msg; if(root_pid != -1) { msg.plen = 0; msg.type = SCAMPER_PRIVSEP_EXIT; write_wrap(lame_fd, (uint8_t *)&msg, NULL, sizeof(msg)); root_pid = -1; } if(lame_fd != -1) { close(lame_fd); lame_fd = -1; } if(cmsgbuf != NULL) { free(cmsgbuf); cmsgbuf = NULL; } return; } #endif /* ifndef WITHOUT_PRIVSEP */ scamper-cvs-20171204/scamper/scamper_privsep.h000644 001751 000000 00000003766 12751606454 021146 0ustar00mjlwheel000000 000000 /* * scamper_privsep.h * * $Id: scamper_privsep.h,v 1.25 2016/08/07 10:27:56 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_PRIVSEP_H #define __SCAMPER_PRIVSEP_H #ifndef WITHOUT_PRIVSEP int scamper_privsep_open_datalink(const int ifindex); int scamper_privsep_open_file(const char *file, const int flags, const mode_t mode); int scamper_privsep_open_rtsock(void); int scamper_privsep_open_icmp(const int domain); int scamper_privsep_open_udp(const int domain, const int port); int scamper_privsep_open_tcp(const int domain, const int port); int scamper_privsep_open_rawudp(const void *addr); int scamper_privsep_open_rawip(void); int scamper_privsep_open_unix(const char *file); int scamper_privsep_ipfw_init(void); int scamper_privsep_ipfw_cleanup(void); int scamper_privsep_ipfw_add(int n,int af,int p,void *s,void *d,int sp,int dp); int scamper_privsep_ipfw_del(int n,int af); int scamper_privsep_pf_init(const char *anchor); int scamper_privsep_pf_cleanup(void); int scamper_privsep_pf_add(int n,int af,int p,void *s,void *d,int sp,int dp); int scamper_privsep_pf_del(int n); int scamper_privsep_unlink(const char *file); int scamper_privsep_init(void); void scamper_privsep_cleanup(void); #endif #endif scamper-cvs-20171204/scamper/scamper_probe.c000644 001751 000000 00000055014 13210743023 020532 0ustar00mjlwheel000000 000000 /* * scamper_probe.c * * $Id: scamper_probe.c,v 1.74 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012 Matthew Luckie * Copyright (C) 2013 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_probe.c,v 1.74 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_dl.h" #include "scamper_fds.h" #include "scamper_rtsock.h" #include "scamper_task.h" #include "scamper_probe.h" #include "scamper_udp4.h" #include "scamper_udp6.h" #include "scamper_icmp4.h" #include "scamper_icmp6.h" #include "scamper_tcp4.h" #include "scamper_tcp6.h" #include "scamper_ip4.h" #include "scamper_ip6.h" #include "scamper_dl.h" #include "scamper_dlhdr.h" #include "scamper_osinfo.h" #include "scamper_debug.h" #include "utils.h" /* * probe_state_t: * * an internal probe structure to store a built packet as it makes its * way into the network. the len field is the size of the IP packet, * and the buf field is 16 bytes larger (at the front) to allow space for * layer-2 headers to be added without having to re-copy the packet. */ typedef struct probe_state { scamper_probe_t *pr; scamper_task_t *task; scamper_task_anc_t *anc; scamper_fd_t *rtsock; scamper_route_t *rt; scamper_dlhdr_t *dlhdr; uint8_t *buf; size_t len; struct timeval tv; int mode; int error; } probe_state_t; #define PROBE_MODE_RT 1 #define PROBE_MODE_DL 2 #define PROBE_MODE_TX 3 #define PROBE_MODE_ERR 4 /* * this pad macro determines the number of extra bytes we have to allocate * so that the next element (the IP header) of the buffer is aligned * appropriately after the datalink header. */ #define PAD(s) ((s > 0) ? (1 + ((s - 1) | (sizeof(long) - 1)) - s) : 0) static uint8_t *pktbuf = NULL; static size_t pktbuf_len = 0; static int ipid_dl = 0; static int rawtcp = 0; #ifdef HAVE_SCAMPER_DEBUG static char *tcp_flags(char *buf, size_t len, scamper_probe_t *probe) { uint8_t flags = probe->pr_tcp_flags; uint8_t flag; size_t off; int i; buf[0] = '\0'; if(probe->pr_len != 0) flags &= ~(TH_ACK); off = 0; for(i=0; i<8 && flags != 0; i++) { flag = 1 << i; if((flags & flag) == 0) continue; flags &= ~flag; switch(flag) { case TH_SYN: string_concat(buf, len, &off, " syn"); break; case TH_RST: string_concat(buf, len, &off, " rst"); break; case TH_FIN: string_concat(buf, len, &off, " fin"); break; case TH_ACK: string_concat(buf, len, &off, " ack"); break; case TH_PUSH: string_concat(buf, len, &off, " psh"); break; case TH_URG: string_concat(buf, len, &off, " urg"); break; case TH_ECE: string_concat(buf, len, &off, " ece"); break; case TH_CWR: string_concat(buf, len, &off, " cwr"); break; } } return buf; } static char *tcp_pos(char *buf, size_t len, scamper_probe_t *probe) { size_t off = 0; string_concat(buf, len, &off, "%u", probe->pr_tcp_seq); if(probe->pr_tcp_flags & TH_ACK) string_concat(buf, len, &off, ":%u", probe->pr_tcp_ack); if(probe->pr_len > 0) string_concat(buf, len, &off, "(%u)", probe->pr_len); return buf; } static void probe_print(scamper_probe_t *probe) { size_t iphl; char tcp[16]; char pos[32]; char addr[128]; char icmp[16]; char tos[8]; assert(probe->pr_ip_dst != NULL); scamper_addr_tostr(probe->pr_ip_dst, addr, sizeof(addr)); tos[0] = '\0'; icmp[0] = '\0'; if(probe->pr_ip_proto == IPPROTO_TCP) { if((probe->pr_ip_tos & IPTOS_ECN_CE) == IPTOS_ECN_CE) snprintf(tos, sizeof(tos), ", ce"); else if(probe->pr_ip_tos & IPTOS_ECN_ECT1) snprintf(tos, sizeof(tos), ", ect1"); else if(probe->pr_ip_tos & IPTOS_ECN_ECT0) snprintf(tos, sizeof(tos), ", ect0"); } if(probe->pr_ip_dst->type == SCAMPER_ADDR_TYPE_IPV4) { if(scamper_ip4_hlen(probe, &iphl) != 0) return; if((probe->pr_ip_off & IP_OFFMASK) != 0) { scamper_debug("tx", "frag %s %04x:%d ttl %d, len %d", addr, probe->pr_ip_id, probe->pr_ip_off << 3, probe->pr_ip_ttl, iphl + probe->pr_len); return; } switch(probe->pr_ip_proto) { case IPPROTO_UDP: scamper_debug("tx", "udp %s, ttl %d, %d:%d, len %d", addr, probe->pr_ip_ttl, probe->pr_udp_sport, probe->pr_udp_dport, iphl + 8 + probe->pr_len); break; case IPPROTO_TCP: scamper_debug("tx", "tcp %s%s, ttl %d, %d:%d%s, ipid %04x, %s, len %d", addr, tos, probe->pr_ip_ttl, probe->pr_tcp_sport, probe->pr_tcp_dport, tcp_flags(tcp, sizeof(tcp), probe), probe->pr_ip_id, tcp_pos(pos, sizeof(pos), probe), iphl + scamper_tcp4_hlen(probe) + probe->pr_len); break; case IPPROTO_ICMP: if(probe->pr_icmp_type == ICMP_ECHO) { if(probe->pr_icmp_sum != 0) { snprintf(icmp, sizeof(icmp), ", sum %04x", ntohs(probe->pr_icmp_sum)); } scamper_debug("tx", "icmp %s echo, ttl %d%s, seq %d, len %d", addr, probe->pr_ip_ttl, icmp, probe->pr_icmp_seq, iphl + 8 + probe->pr_len); } else if(probe->pr_icmp_type == ICMP_UNREACH) { if(probe->pr_icmp_code == ICMP_UNREACH_NEEDFRAG) snprintf(icmp,sizeof(icmp),"ptb %d", probe->pr_icmp_mtu); else snprintf(icmp,sizeof(icmp),"unreach %d", probe->pr_icmp_code); scamper_debug("tx", "icmp %s %s, len %d", addr, icmp, iphl + 8 + probe->pr_len); } else if(probe->pr_icmp_type == ICMP_TSTAMP) { scamper_debug("tx", "icmp %s ts, ttl %d, seq %d, len %d", addr, probe->pr_ip_ttl, probe->pr_icmp_seq, iphl + 20); } else { scamper_debug("tx", "icmp %s type %d, code %d, len %d", addr, probe->pr_icmp_type, probe->pr_icmp_code, iphl + 8 + probe->pr_len); } break; } } else if(probe->pr_ip_dst->type == SCAMPER_ADDR_TYPE_IPV6) { if(scamper_ip6_hlen(probe, &iphl) != 0) return; if(probe->pr_ip_off != 0) { scamper_debug("tx", "frag %s off %04x, ttl %d, len %d", addr, probe->pr_ip_off, probe->pr_ip_ttl, iphl + probe->pr_len); return; } switch(probe->pr_ip_proto) { case IPPROTO_UDP: scamper_debug("tx", "udp %s, ttl %d, %d:%d, len %d", addr, probe->pr_ip_ttl, probe->pr_udp_sport, probe->pr_udp_dport, iphl + 8 + probe->pr_len); break; case IPPROTO_TCP: scamper_debug("tx", "tcp %s%s, ttl %d, %d:%d%s, %s, len %d", addr, tos, probe->pr_ip_ttl, probe->pr_tcp_sport, probe->pr_tcp_dport, tcp_flags(tcp, sizeof(tcp), probe), tcp_pos(pos, sizeof(pos), probe), iphl + scamper_tcp6_hlen(probe) + probe->pr_len); break; case IPPROTO_ICMPV6: if(probe->pr_icmp_type == ICMP6_ECHO_REQUEST) { if(probe->pr_icmp_sum != 0) { snprintf(icmp, sizeof(icmp), ", sum %04x", ntohs(probe->pr_icmp_sum)); } scamper_debug("tx", "icmp %s echo, ttl %d%s, seq %d, len %d", addr, probe->pr_ip_ttl, icmp, probe->pr_icmp_seq, iphl + 8 + probe->pr_len); } else if(probe->pr_icmp_type == ICMP6_PACKET_TOO_BIG) { scamper_debug("tx", "icmp %s ptb %d, len %d", addr, probe->pr_icmp_mtu, iphl + 8 + probe->pr_len); } else if(probe->pr_icmp_type == ICMP6_DST_UNREACH) { scamper_debug("tx", "icmp %s unreach %d, len %d", addr, probe->pr_icmp_code, iphl + 8 + probe->pr_len); } else { scamper_debug("tx", "icmp %s type %d, code %d, len %d", addr, probe->pr_icmp_type, probe->pr_icmp_code, iphl + 8 + probe->pr_len); } break; } } return; } #else #define probe_print(probe) ((void)0) #endif static void probe_free(scamper_probe_t *pr) { if(pr == NULL) return; if(pr->pr_ip_dst != NULL) scamper_addr_free(pr->pr_ip_dst); if(pr->pr_ip_src != NULL) scamper_addr_free(pr->pr_ip_src); if(pr->pr_ipopts != NULL) free(pr->pr_ipopts); if(pr->pr_data != NULL) free(pr->pr_data); free(pr); return; } static scamper_probe_t *probe_dup(scamper_probe_t *pr) { scamper_probe_t *pd = NULL; size_t len; if((pd = memdup(pr, sizeof(scamper_probe_t))) == NULL) goto err; pd->pr_dl = NULL; pd->pr_dl_buf = NULL; pd->pr_dl_len = 0; pd->pr_ipopts = NULL; pd->pr_data = NULL; if(pr->pr_ip_src != NULL) pd->pr_ip_src = scamper_addr_use(pr->pr_ip_src); if(pr->pr_ip_dst != NULL) pd->pr_ip_dst = scamper_addr_use(pr->pr_ip_dst); if(pr->pr_ipoptc > 0) { len = pr->pr_ipoptc * sizeof(scamper_probe_ipopt_t); if((pd->pr_ipopts = memdup(pr->pr_ipopts, len)) == NULL) goto err; } if(pr->pr_len > 0) { if((pd->pr_data = memdup(pr->pr_data, pr->pr_len)) == NULL) goto err; } return pd; err: probe_free(pd); return NULL; } static void probe_state_free_cb(void *vpt) { probe_state_t *pt = vpt; if(pt == NULL) return; if(pt->pr != NULL) probe_free(pt->pr); if(pt->buf != NULL && pt->buf != pktbuf) free(pt->buf); if(pt->rt != NULL) scamper_route_free(pt->rt); if(pt->dlhdr != NULL) scamper_dlhdr_free(pt->dlhdr); free(pt); return; } static void probe_state_free(probe_state_t *pt) { if(pt == NULL) return; if(pt->anc != NULL) scamper_task_anc_del(pt->task, pt->anc); probe_state_free_cb(pt); return; } /* * probe_state_alloc * * determine how to build the packet and call the appropriate function * to do so. */ static probe_state_t *probe_state_alloc(scamper_probe_t *pr) { int (*build_func)(scamper_probe_t *, uint8_t *, size_t *) = NULL; probe_state_t *pt = NULL; size_t len; if((pt = malloc_zero(sizeof(probe_state_t))) == NULL) { pr->pr_errno = errno; goto err; } if(rawtcp != 0 && pr->pr_ip_proto == IPPROTO_TCP && SCAMPER_ADDR_TYPE_IS_IPV4(pr->pr_ip_dst)) { if((pt->pr = probe_dup(pr)) == NULL) { pr->pr_errno = errno; goto err; } return pt; } if(SCAMPER_ADDR_TYPE_IS_IPV4(pr->pr_ip_dst)) { if((pr->pr_ip_off & IP_OFFMASK) != 0) build_func = scamper_ip4_frag_build; else if(pr->pr_ip_proto == IPPROTO_UDP) build_func = scamper_udp4_build; else if(pr->pr_ip_proto == IPPROTO_ICMP) build_func = scamper_icmp4_build; else if(pr->pr_ip_proto == IPPROTO_TCP) build_func = scamper_tcp4_build; } else if(SCAMPER_ADDR_TYPE_IS_IPV6(pr->pr_ip_dst)) { if(pr->pr_ip_off != 0) build_func = scamper_ip6_frag_build; if(pr->pr_ip_proto == IPPROTO_UDP) build_func = scamper_udp6_build; else if(pr->pr_ip_proto == IPPROTO_ICMPV6) build_func = scamper_icmp6_build; else if(pr->pr_ip_proto == IPPROTO_TCP) build_func = scamper_tcp6_build; } if(build_func == NULL) { pr->pr_errno = EINVAL; goto err; } /* allow 16 bytes at the front of the packet for layer-2 headers */ if(16 >= pktbuf_len) len = 0; else len = pktbuf_len-16; if(build_func(pr, pktbuf+16, &len) != 0) { /* reallocate the packet buffer */ if(realloc_wrap((void **)&pktbuf, len+16) != 0) { pr->pr_errno = errno; goto err; } pktbuf_len = len+16; if(build_func(pr, pktbuf+16, &len) != 0) { pr->pr_errno = EINVAL; goto err; } } pt->buf = pktbuf; pt->len = len; return pt; err: if(pt != NULL) probe_state_free(pt); return NULL; } static void probe_dlhdr_cb(scamper_dlhdr_t *dlhdr) { probe_state_t *pr = dlhdr->param; scamper_fd_t *fd = NULL; scamper_dl_t *dl = NULL; uint8_t *pkt; if(dlhdr->error != 0) { pr->error = dlhdr->error; goto err; } assert(dlhdr->len < 16); pkt = pr->buf+16-dlhdr->len; if(dlhdr->len > 0) memcpy(pkt, dlhdr->buf, dlhdr->len); if((fd = scamper_task_fd_dl(pr->task, pr->rt->ifindex)) == NULL) { pr->error = EINVAL; goto err; } if(pr->buf == pktbuf) gettimeofday_wrap(&pr->tv); dl = scamper_fd_dl_get(fd); if(scamper_dl_tx(dl, pkt, dlhdr->len + pr->len) == -1) { pr->error = errno; goto err; } pr->mode = PROBE_MODE_TX; goto done; err: pr->mode = PROBE_MODE_ERR; done: if(pr->anc != NULL) probe_state_free(pr); return; } static void probe_route_cb(scamper_route_t *rt) { scamper_fd_t *fd = NULL; scamper_dl_t *dl = NULL; probe_state_t *pr = rt->param; if(rt->error != 0 || rt->ifindex < 0) { pr->error = rt->error; goto err; } if((fd = scamper_task_fd_dl(pr->task, rt->ifindex)) == NULL) { pr->error = errno; goto err; } if(rawtcp != 0 && pr->pr != NULL && pr->pr->pr_ip_proto == IPPROTO_TCP && SCAMPER_ADDR_TYPE_IS_IPV4(pr->pr->pr_ip_dst)) { if((fd = scamper_task_fd_ip4(pr->task)) != NULL) { pr->pr->pr_fd = scamper_fd_fd_get(fd); if(scamper_tcp4_probe(pr->pr) != 0) pr->mode = PROBE_MODE_ERR; } if(pr->anc != NULL) probe_state_free(pr); return; } if((pr->dlhdr = scamper_dlhdr_alloc()) == NULL) { pr->error = errno; goto err; } dl = scamper_fd_dl_get(fd); pr->dlhdr->dst = scamper_addr_use(rt->dst); pr->dlhdr->gw = rt->gw != NULL ? scamper_addr_use(rt->gw) : NULL; pr->dlhdr->ifindex = rt->ifindex; pr->dlhdr->txtype = scamper_dl_tx_type(dl); pr->dlhdr->param = pr; pr->dlhdr->cb = probe_dlhdr_cb; pr->mode = PROBE_MODE_DL; if(scamper_dlhdr_get(pr->dlhdr) != 0) { pr->error = pr->dlhdr->error; goto err; } return; err: pr->mode = PROBE_MODE_ERR; if(pr->anc != NULL) probe_state_free(pr); return; } static int probe_task_dl(scamper_probe_t *pr, scamper_task_t *task) { probe_state_t *pt = NULL; if((pt = probe_state_alloc(pr)) == NULL) { pr->pr_errno = errno; goto err; } pt->task = task; pt->mode = PROBE_MODE_RT; if((pt->rt = scamper_route_alloc(pr->pr_ip_dst,pt,probe_route_cb)) == NULL) { pr->pr_errno = errno; goto err; } #ifndef _WIN32 if((pt->rtsock = scamper_task_fd_rtsock(task)) == NULL) { pr->pr_errno = errno; goto err; } if(scamper_rtsock_getroute(pt->rtsock, pt->rt) != 0) { pr->pr_errno = errno; goto err; } #else if(scamper_rtsock_getroute(pt->rt) != 0) { pr->pr_errno = errno; goto err; } #endif if(pt->mode == PROBE_MODE_ERR) { pr->pr_errno = pt->error; goto err; } if(pt->mode != PROBE_MODE_TX) { if(pt->len > 0 && (pt->buf = memdup(pktbuf, pt->len + 16)) == NULL) { pr->pr_errno = errno; goto err; } if((pt->anc = scamper_task_anc_add(task,pt,probe_state_free_cb)) == NULL) { pr->pr_errno = errno; goto err; } gettimeofday_wrap(&pr->pr_tx); } else { timeval_cpy(&pr->pr_tx, &pt->tv); probe_state_free(pt); } return 0; err: if(pt != NULL) probe_state_free(pt); return -1; } static int probe_task_ipv4(scamper_probe_t *pr, scamper_task_t *task, scamper_fd_t *icmp) { scamper_fd_t *fd; if(pr->pr_ip_proto == IPPROTO_UDP) { fd = scamper_task_fd_udp4(task, pr->pr_ip_src->addr, pr->pr_udp_sport); if(fd == NULL) { pr->pr_errno = errno; return -1; } pr->pr_fd = scamper_fd_fd_get(fd); if(scamper_udp4_probe(pr) != 0) { pr->pr_errno = errno; return -1; } } else if(pr->pr_ip_proto == IPPROTO_ICMP) { pr->pr_fd = scamper_fd_fd_get(icmp); if(scamper_icmp4_probe(pr) != 0) { pr->pr_errno = errno; return -1; } } else { scamper_debug(__func__, "unhandled protocol %d", pr->pr_ip_proto); pr->pr_errno = EINVAL; /* actually a bug in the caller */ return -1; } return 0; } static int probe_task_ipv6(scamper_probe_t *pr, scamper_task_t *task, scamper_fd_t *icmp) { scamper_fd_t *fd; if(pr->pr_ip_proto == IPPROTO_UDP) { fd = scamper_task_fd_udp6(task, pr->pr_ip_src->addr, pr->pr_udp_sport); if(fd == NULL) { pr->pr_errno = errno; return -1; } pr->pr_fd = scamper_fd_fd_get(fd); if(scamper_udp6_probe(pr) != 0) { pr->pr_errno = errno; return -1; } } else if(pr->pr_ip_proto == IPPROTO_ICMPV6) { pr->pr_fd = scamper_fd_fd_get(icmp); if(scamper_icmp6_probe(pr) != 0) { pr->pr_errno = errno; return -1; } } else { pr->pr_errno = EINVAL; /* actually a bug in the caller */ return -1; } return 0; } int scamper_probe_task(scamper_probe_t *pr, scamper_task_t *task) { scamper_fd_t *icmp = NULL; int dl = 0; probe_print(pr); /* get an ICMP socket to listen for responses */ if(SCAMPER_ADDR_TYPE_IS_IPV4(pr->pr_ip_dst)) { if((pr->pr_flags & SCAMPER_PROBE_FLAG_SPOOF) == 0 && (icmp = scamper_task_fd_icmp4(task, pr->pr_ip_src->addr)) == NULL) { pr->pr_errno = errno; goto err; } } else if(SCAMPER_ADDR_TYPE_IS_IPV6(pr->pr_ip_dst)) { if((pr->pr_flags & SCAMPER_PROBE_FLAG_SPOOF) == 0 && (icmp = scamper_task_fd_icmp6(task, pr->pr_ip_src->addr)) == NULL) { pr->pr_errno = errno; goto err; } } else { scamper_debug(__func__, "missing destination address"); pr->pr_errno = EINVAL; goto err; } /* * even though many operating systems allow the use of RAW TCP sockets to * send TCP probes, we still need to be able to receive TCP responses. * so we use a datalink socket to both send and receive TCP probes rather * than open both a socket to send and another to receive. */ if(pr->pr_ip_proto == IPPROTO_TCP || (ipid_dl != 0 && SCAMPER_PROBE_IS_IPID(pr)) || (pr->pr_flags & SCAMPER_PROBE_FLAG_NOFRAG) != 0 || (pr->pr_flags & SCAMPER_PROBE_FLAG_SPOOF) != 0 || (pr->pr_flags & SCAMPER_PROBE_FLAG_DL) != 0) dl = 1; if(dl != 0) { if(probe_task_dl(pr, task) != 0) goto err; } else if(SCAMPER_ADDR_TYPE_IS_IPV4(pr->pr_ip_dst)) { if(probe_task_ipv4(pr, task, icmp) != 0) goto err; } else if(SCAMPER_ADDR_TYPE_IS_IPV6(pr->pr_ip_dst)) { if(probe_task_ipv6(pr, task, icmp) != 0) goto err; } else { pr->pr_errno = EINVAL; goto err; } return 0; err: printerror_msg(__func__, "could not probe: %s", strerror(pr->pr_errno)); return -1; } /* * scamper_probe_send * * this meta-function is responsible for * 1. sending a probe * 2. handling any error condition incurred when sending the probe * 3. recording details of the probe with the trace's state */ int scamper_probe(scamper_probe_t *probe) { int (*send_func)(scamper_probe_t *) = NULL; int (*build_func)(scamper_probe_t *, uint8_t *, size_t *) = NULL; size_t pad, len; uint8_t *buf; probe->pr_errno = 0; probe_print(probe); /* determine which function scamper should use to build or send the probe */ if(probe->pr_ip_dst->type == SCAMPER_ADDR_TYPE_IPV4) { if((probe->pr_ip_off & IP_OFFMASK) != 0) { build_func = scamper_ip4_frag_build; } else if(probe->pr_ip_proto == IPPROTO_UDP) { send_func = scamper_udp4_probe; build_func = scamper_udp4_build; } else if(probe->pr_ip_proto == IPPROTO_TCP) { build_func = scamper_tcp4_build; if(probe->pr_fd != -1) send_func = scamper_tcp4_probe; } else if(probe->pr_ip_proto == IPPROTO_ICMP) { send_func = scamper_icmp4_probe; build_func = scamper_icmp4_build; } } else if(probe->pr_ip_dst->type == SCAMPER_ADDR_TYPE_IPV6) { if(probe->pr_ip_off != 0) { build_func = scamper_ip6_frag_build; } else if(probe->pr_ip_proto == IPPROTO_UDP) { send_func = scamper_udp6_probe; build_func = scamper_udp6_build; } else if(probe->pr_ip_proto == IPPROTO_TCP) { build_func = scamper_tcp6_build; } else if(probe->pr_ip_proto == IPPROTO_ICMPV6) { send_func = scamper_icmp6_probe; build_func = scamper_icmp6_build; } } /* if we're not using the datalink to send the packet, then send it now */ if(probe->pr_dl == NULL) { if(send_func != NULL) return send_func(probe); probe->pr_errno = EINVAL; return -1; } /* if the header type is not known (we cannot build it) then bail */ if(build_func == NULL) { probe->pr_errno = EINVAL; return -1; } /* * determine a suitable value for the length parameter for passing * to build_func. to do so we also need to calculate the number of pad * bytes to put at the front of the packet buffer so that the IP layer * is properly aligned for the architecture */ pad = PAD(probe->pr_dl_len); if(pad + probe->pr_dl_len >= pktbuf_len) len = 0; else len = pktbuf_len - pad - probe->pr_dl_len; /* * try building the probe. if it returns -1, then hopefully the len field * will supply a clue as to what it should be */ if(build_func(probe, pktbuf + pad + probe->pr_dl_len, &len) != 0) { assert(pktbuf_len < pad + probe->pr_dl_len + len); /* reallocate the packet buffer */ len += pad + probe->pr_dl_len; if((buf = realloc(pktbuf, len)) == NULL) { probe->pr_errno = errno; printerror(__func__, "could not realloc"); return -1; } pktbuf = buf; pktbuf_len = len; len = pktbuf_len - pad - probe->pr_dl_len; if(build_func(probe, pktbuf + pad + probe->pr_dl_len, &len) != 0) { probe->pr_errno = EINVAL; return -1; } } /* add the datalink header size back to the length field */ len += probe->pr_dl_len; /* pre-pend the datalink header, if there is one */ if(probe->pr_dl_len > 0) memcpy(pktbuf+pad, probe->pr_dl_buf, probe->pr_dl_len); gettimeofday_wrap(&probe->pr_tx); if(scamper_dl_tx(probe->pr_dl, pktbuf+pad, len) == -1) { probe->pr_errno = errno; return -1; } probe->pr_tx_raw = pktbuf + pad + probe->pr_dl_len; probe->pr_tx_rawlen = len - probe->pr_dl_len; return 0; } int scamper_probe_init(void) { const scamper_osinfo_t *osinfo = scamper_osinfo_get(); if(SCAMPER_OSINFO_IS_SUNOS(osinfo)) ipid_dl = 1; if(scamper_option_planetlab() || scamper_option_rawtcp()) rawtcp = 1; return 0; } void scamper_probe_cleanup(void) { if(pktbuf != NULL) { free(pktbuf); pktbuf = NULL; } pktbuf_len = 0; return; } scamper-cvs-20171204/scamper/scamper_probe.h000644 001751 000000 00000017147 12510550365 020553 0ustar00mjlwheel000000 000000 /* * scamper_probe.h * * $Id: scamper_probe.h,v 1.44 2015/04/06 18:31:17 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012 Matthew Luckie * Copyright (C) 2012-2015 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_PROBE_H #define __SCAMPER_PROBE_H /* * scamper_probe_ipopt * * this structure is used to hold IPv4 options and IPv6 extension headers. */ typedef struct scamper_probe_ipopt { uint8_t type; union { struct v4tsps { struct in_addr ips[4]; uint8_t ipc; } v4tsps; struct v6rh0 { struct in6_addr *ips; uint8_t ipc; } v6rh0; struct v6frag { uint16_t off; uint32_t id; } v6frag; struct quickstart { uint8_t func; uint8_t rate; uint8_t ttl; uint32_t nonce; } quickstart; } un; } scamper_probe_ipopt_t; #define opt_v4tsps_ips un.v4tsps.ips #define opt_v4tsps_ipc un.v4tsps.ipc #define opt_v6rh0_ips un.v6rh0.ips #define opt_v6rh0_ipc un.v6rh0.ipc #define opt_v6frag_off un.v6frag.off #define opt_v6frag_id un.v6frag.id #define opt_qs_nonce un.quickstart.nonce #define opt_qs_ttl un.quickstart.ttl #define opt_qs_rate un.quickstart.rate #define opt_qs_func un.quickstart.func #define SCAMPER_PROBE_IPOPTS_V6ROUTE0 0 #define SCAMPER_PROBE_IPOPTS_V6FRAG 1 #define SCAMPER_PROBE_IPOPTS_V4RR 2 #define SCAMPER_PROBE_IPOPTS_V4TSPS 3 /* TS: prespecified interfaces */ #define SCAMPER_PROBE_IPOPTS_V4TSO 4 /* TS: record only timestamps */ #define SCAMPER_PROBE_IPOPTS_V4TSAA 5 /* TS: record IP and timestamps */ #define SCAMPER_PROBE_IPOPTS_QUICKSTART 6 /* RFC 4782 */ #define SCAMPER_PROBE_FLAG_IPID 0x0001 #define SCAMPER_PROBE_FLAG_NOFRAG 0x0002 #define SCAMPER_PROBE_FLAG_SPOOF 0x0004 #define SCAMPER_PROBE_FLAG_DL 0x0008 #define SCAMPER_PROBE_TCPOPT_SACK 0x01 #define SCAMPER_PROBE_TCPOPT_TS 0x02 #define SCAMPER_PROBE_TCPOPT_FO 0x04 #define SCAMPER_PROBE_TCPOPT_FO_EXP 0x08 #define SCAMPER_PROBE_IS_IPID(pr) ( \ ((pr)->pr_flags & SCAMPER_PROBE_FLAG_IPID) != 0 && \ (pr)->pr_ip_dst != NULL && SCAMPER_ADDR_TYPE_IS_IPV4((pr)->pr_ip_dst)) /* * scamper_probe * * this structure details how a probe should be formed and sent. * it records any error code */ typedef struct scamper_probe { /* * the following fields define the socket to use. note: they are optional * (and ignored) if the scamper_probe_task function is called with a * scamper_probe structure as it determines how to send the packet. * if the caller requires the packet to be sent on a datalink socket, it * must supply the datalink socket to use (in pr_dl) and a datalink header. */ int pr_fd; scamper_dl_t *pr_dl; uint8_t *pr_dl_buf; uint16_t pr_dl_len; /* flags set on input */ uint16_t pr_flags; /* IP header parameters */ scamper_addr_t *pr_ip_src; scamper_addr_t *pr_ip_dst; uint8_t pr_ip_tos; uint8_t pr_ip_ttl; uint8_t pr_ip_proto; uint16_t pr_ip_id; /* IPv4 ID */ uint16_t pr_ip_off; uint32_t pr_ip_flow; /* IPv6 flow id */ /* IPv4 options / IPv6 extension headers */ scamper_probe_ipopt_t *pr_ipopts; int pr_ipoptc; /* UDP header parameters */ uint16_t pr_udp_sport; uint16_t pr_udp_dport; /* ICMP header parameters */ uint8_t pr_icmp_type; uint8_t pr_icmp_code; uint16_t pr_icmp_sum; uint16_t pr_icmp_id; uint16_t pr_icmp_seq; uint16_t pr_icmp_mtu; /* TCP header parameters */ uint16_t pr_tcp_sport; uint16_t pr_tcp_dport; uint32_t pr_tcp_seq; uint32_t pr_tcp_ack; uint8_t pr_tcp_flags; uint8_t pr_tcp_opts; uint8_t pr_tcp_wscale; uint16_t pr_tcp_win; uint16_t pr_tcp_mss; uint32_t pr_tcp_tsval; uint32_t pr_tcp_tsecr; uint32_t pr_tcp_sack[8]; uint8_t pr_tcp_sackb; uint8_t *pr_tcp_fo_cookie; uint8_t pr_tcp_fo_cookielen; /* the contents of the packet's body */ uint8_t *pr_data; uint16_t pr_len; /* the time immediately before the call to sendto was made */ struct timeval pr_tx; /* the actual transmitted packet, IP header and down, when datalink tx'd */ uint8_t *pr_tx_raw; uint16_t pr_tx_rawlen; /* if an error occurs in the probe function, the errno is recorded */ int pr_errno; } scamper_probe_t; int scamper_probe(scamper_probe_t *probe); #ifdef __SCAMPER_TASK_H int scamper_probe_task(scamper_probe_t *probe, scamper_task_t *task); #endif /* convenience macro to construct an ICMP echo packet */ #define SCAMPER_PROBE_ICMP_ECHO(pr, id, seq) do { \ assert((pr)->pr_ip_dst != NULL); \ assert((pr)->pr_ip_dst->type == SCAMPER_ADDR_TYPE_IPV4 || \ (pr)->pr_ip_dst->type == SCAMPER_ADDR_TYPE_IPV6); \ if((pr)->pr_ip_dst->type == SCAMPER_ADDR_TYPE_IPV4) \ { \ (pr)->pr_ip_proto = IPPROTO_ICMP; \ (pr)->pr_icmp_type = ICMP_ECHO; \ } \ else \ { \ (pr)->pr_ip_proto = IPPROTO_ICMPV6; \ (pr)->pr_icmp_type = ICMP6_ECHO_REQUEST; \ } \ (pr)->pr_icmp_id = (id); \ (pr)->pr_icmp_seq = (seq); \ } while(0) /* convenience macro to construct an ICMP timestamp request packet */ #define SCAMPER_PROBE_ICMP_TIME(pr, id, seq) do { \ assert((pr)->pr_ip_dst != NULL); \ assert((pr)->pr_ip_dst->type == SCAMPER_ADDR_TYPE_IPV4); \ (pr)->pr_ip_proto = IPPROTO_ICMP; \ (pr)->pr_icmp_type = ICMP_TSTAMP; \ (pr)->pr_icmp_id = (id); \ (pr)->pr_icmp_seq = (seq); \ } while(0) #define SCAMPER_PROBE_ICMP_PTB(pr, mtu) do { \ assert((pr)->pr_ip_dst != NULL); \ assert((pr)->pr_ip_dst->type == SCAMPER_ADDR_TYPE_IPV4 || \ (pr)->pr_ip_dst->type == SCAMPER_ADDR_TYPE_IPV6); \ if((pr)->pr_ip_dst->type == SCAMPER_ADDR_TYPE_IPV4) \ { \ (pr)->pr_ip_proto = IPPROTO_ICMP; \ (pr)->pr_icmp_type = ICMP_UNREACH; \ (pr)->pr_icmp_code = ICMP_UNREACH_NEEDFRAG; \ } \ else \ { \ (pr)->pr_ip_proto = IPPROTO_ICMPV6; \ (pr)->pr_icmp_type = ICMP6_PACKET_TOO_BIG; \ } \ (pr)->pr_icmp_mtu = (mtu); \ } while(0) /* * scamper_probe_cleanup: * cleanup any state kept inside the scamper_probe module */ int scamper_probe_init(void); void scamper_probe_cleanup(void); #endif /* __SCAMPER_PROBE_H */ scamper-cvs-20171204/scamper/scamper_queue.c000644 001751 000000 00000025661 13210743023 020554 0ustar00mjlwheel000000 000000 /* * scamper_queue.c * * $Id: scamper_queue.c,v 1.43 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2015-2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_queue.c,v 1.43 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_task.h" #include "scamper_queue.h" #include "scamper_debug.h" #include "utils.h" #include "mjl_list.h" #include "mjl_heap.h" struct scamper_queue { /* when the scamper task should timeout from whatever queue it is on */ struct timeval timeout; /* the current queue (and associated node) the task is in */ void *queue; void *node; union { struct scamper_task *task; void *ptr; } un; scamper_queue_event_cb_t cb; }; static dlist_t *probe_queue = NULL; static heap_t *wait_queue = NULL; static heap_t *done_queue = NULL; static heap_t *event_queue = NULL; static int count = 0; static int queue_cmp(const scamper_queue_t *a, const scamper_queue_t *b) { return timeval_cmp(&b->timeout, &a->timeout); } static void queue_onremove(void *item) { scamper_queue_t *sq = item; sq->queue = NULL; sq->node = NULL; return; } /* * queue_unlink * * detach a task from whichever queue it is in */ static void queue_unlink(scamper_queue_t *sq) { if(sq->queue == NULL) return; if(sq->queue == probe_queue) dlist_node_pop(sq->queue, sq->node); else if(sq->queue == wait_queue || sq->queue == done_queue || sq->queue == event_queue) heap_delete(sq->queue, sq->node); count--; return; } /* * queue_link * * given a task and a queue to insert it in, put the task into the queue. * to is a timeout value of when the task should be removed from the queue. */ static int queue_link(scamper_queue_t *sq, void *queue) { void *node; assert(sq->queue == NULL); assert(sq->node == NULL); /* now, put it in the correct queue */ if(queue == probe_queue) { node = dlist_tail_push(queue, sq); } else { assert(queue == wait_queue || queue == done_queue); node = heap_insert(queue, sq); } /* ensure we've got a node */ if(node != NULL) { sq->queue = queue; sq->node = node; count++; return 0; } return -1; } /* * scamper_queue_event_waittime * * report the earliest event time on the event queue. */ int scamper_queue_event_waittime(struct timeval *tv) { scamper_queue_t *sq; if((sq = (scamper_queue_t *)heap_head_item(event_queue)) != NULL) { timeval_cpy(tv, &sq->timeout); return 1; } return 0; } /* * scamper_queue_event_proc * * process all events on the queue whose time has come. */ int scamper_queue_event_proc(const struct timeval *tv) { scamper_queue_t *sq = heap_head_item(event_queue); while(sq != NULL && timeval_cmp(tv, &sq->timeout) >= 0) { heap_remove(event_queue); if(sq->cb(sq->un.ptr) != 0) return -1; sq = heap_head_item(event_queue); } return 0; } /* * scamper_queue_event_update * * update the event time on the queued event */ int scamper_queue_event_update_time(scamper_queue_t *sq, const struct timeval *tv) { assert(sq->queue == NULL || sq->queue == event_queue); timeval_cpy(&sq->timeout, tv); if(sq->queue == NULL) { if((sq->node = heap_insert(event_queue, sq)) == NULL) { printerror(__func__, "could not add to heap"); return -1; } sq->queue = event_queue; } else { heap_remake(event_queue); } return 0; } void scamper_queue_event_update_cb(scamper_queue_t *sq, scamper_queue_event_cb_t cb, void *ptr) { sq->cb = cb; sq->un.ptr = ptr; return; } /* * scamper_queue_event * * add an event to the event queue. */ scamper_queue_t *scamper_queue_event(const struct timeval *tv, scamper_queue_event_cb_t cb, void *ptr) { scamper_queue_t *sq = NULL; if((sq = malloc_zero(sizeof(scamper_queue_t))) == NULL) { printerror(__func__, "could not alloc sq"); goto err; } timeval_cpy(&sq->timeout, tv); sq->queue = event_queue; sq->un.ptr = ptr; sq->cb = cb; if((sq->node = heap_insert(event_queue, sq)) == NULL) { printerror(__func__, "could add to heap"); goto err; } return sq; err: return NULL; } /* * scamper_queue_probe_head * * special function to put a particular task at the head of the probe * queue for immediate attention. this function should be used sparingly. */ int scamper_queue_probe_head(scamper_queue_t *sq) { dlist_node_t *node; queue_unlink(sq); if((node = dlist_head_push(probe_queue, sq)) == NULL) { printerror(__func__, "could not push node"); return -1; } sq->queue = probe_queue; sq->node = node; count++; return 0; } int scamper_queue_probe(scamper_queue_t *sq) { queue_unlink(sq); return queue_link(sq, probe_queue); } int scamper_queue_isprobe(scamper_queue_t *sq) { if(sq->queue == probe_queue) return 1; return 0; } int scamper_queue_wait(scamper_queue_t *sq, int msec) { queue_unlink(sq); gettimeofday_wrap(&sq->timeout); timeval_add_ms(&sq->timeout, &sq->timeout, msec); return queue_link(sq, wait_queue); } int scamper_queue_iswait(scamper_queue_t *sq) { if(sq->queue == wait_queue) return 1; return 0; } int scamper_queue_wait_tv(scamper_queue_t *sq, const struct timeval *tv) { queue_unlink(sq); timeval_cpy(&sq->timeout, tv); return queue_link(sq, wait_queue); } int scamper_queue_done(scamper_queue_t *sq, int msec) { queue_unlink(sq); gettimeofday_wrap(&sq->timeout); timeval_add_ms(&sq->timeout, &sq->timeout, msec); return queue_link(sq, done_queue); } int scamper_queue_isdone(scamper_queue_t *sq) { if(sq->queue == done_queue) return 1; return 0; } void scamper_queue_detach(scamper_queue_t *sq) { queue_unlink(sq); return; } /* * scamper_queue_select * * return the next task in the probe queue to deal with */ struct scamper_task *scamper_queue_select() { scamper_queue_t *sq; if((sq = dlist_head_pop(probe_queue)) != NULL) { count--; return sq->un.task; } return NULL; } /* * scamper_queue_getdone * */ struct scamper_task *scamper_queue_getdone(const struct timeval *tv) { scamper_queue_t *sq; if((sq = (scamper_queue_t *)heap_head_item(done_queue)) == NULL) return NULL; if(timeval_cmp(tv, &sq->timeout) >= 0) { queue_unlink(sq); return sq->un.task; } return NULL; } /* * scamper_queue_waittime * * tell the caller how long it should wait in select before it makes a * pass through the queues. note that this function does not check the * probe queue where something is immediately ready to be probed. * * if there is nothing in any of the queues, we return 0. otherwise we * return the number of active queues and the tv parameter contains the * time that the first queue will have something to deal with. */ int scamper_queue_waittime(struct timeval *tv) { scamper_queue_t *sq; heap_t *queues[2]; int i, set = 0; queues[0] = wait_queue; queues[1] = done_queue; for(i=(sizeof(queues)/sizeof(heap_t *))-1; i >= 0; i--) { if((sq = (scamper_queue_t *)heap_head_item(queues[i])) != NULL) { if(set == 0 || timeval_cmp(tv, &sq->timeout) > 0) { timeval_cpy(tv, &sq->timeout); set++; } } } return set; } /* * scamper_queue_readycount * * this function causes the wait queue to be checked to see if any of the * members should be punted onto the probe queue for * action. * * we then return the count of ready tasks, which is the count of items on * the probe queue. */ int scamper_queue_readycount() { scamper_queue_t *sq; struct timeval tv; if(heap_count(wait_queue) > 0) { gettimeofday_wrap(&tv); /* timeout any tasks on the wait queue that are due to be probed again */ while((sq = heap_head_item(wait_queue)) != NULL) { if(timeval_cmp(&tv, &sq->timeout) < 0) break; queue_unlink(sq); scamper_task_handletimeout(sq->un.task); if(sq->queue == NULL) queue_link(sq, probe_queue); } } return dlist_count(probe_queue); } int scamper_queue_windowcount() { return dlist_count(probe_queue) + heap_count(wait_queue); } /* * scamper_queue_empty * * for whatever reason, the queue of 'active' tasks must be flushed. * drop all active tasks by removing them from the probe and wait queues. */ void scamper_queue_empty() { scamper_queue_t *sq; while((sq = (scamper_queue_t *)heap_remove(wait_queue)) != NULL) count--; while((sq = (scamper_queue_t *)dlist_head_pop(probe_queue)) != NULL) count--; return; } int scamper_queue_count() { return count; } scamper_queue_t *scamper_queue_alloc(scamper_task_t *task) { scamper_queue_t *sq; if((sq = malloc_zero(sizeof(scamper_queue_t))) != NULL) sq->un.task = task; return sq; } void scamper_queue_free(scamper_queue_t *sq) { if(sq == NULL) return; queue_unlink(sq); free(sq); return; } int scamper_queue_init() { if((probe_queue = dlist_alloc()) == NULL) { printerror(__func__, "could not alloc probe_queue"); return -1; } dlist_onremove(probe_queue, queue_onremove); if((wait_queue = heap_alloc((heap_cmp_t)queue_cmp)) == NULL) { printerror(__func__, "could not alloc wait_queue"); return -1; } heap_onremove(wait_queue, queue_onremove); if((done_queue = heap_alloc((heap_cmp_t)queue_cmp)) == NULL) { printerror(__func__, "could not alloc done_queue"); return -1; } heap_onremove(done_queue, queue_onremove); if((event_queue = heap_alloc((heap_cmp_t)queue_cmp)) == NULL) { printerror(__func__, "could not alloc event_queue"); return -1; } heap_onremove(event_queue, queue_onremove); return 0; } void scamper_queue_cleanup() { if(event_queue != NULL) { heap_free(event_queue, NULL); event_queue = NULL; } if(done_queue != NULL) { heap_free(done_queue, NULL); done_queue = NULL; } if(wait_queue != NULL) { heap_free(wait_queue, NULL); wait_queue = NULL; } if(probe_queue != NULL) { dlist_free(probe_queue); probe_queue = NULL; } return; } scamper-cvs-20171204/scamper/scamper_queue.h000644 001751 000000 00000006745 12742124753 020577 0ustar00mjlwheel000000 000000 /* * scamper_queue.h * * $Id: scamper_queue.h,v 1.16 2016/07/15 09:16:27 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Copyright (C) 2015-2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_QUEUE_H #define __SCAMPER_QUEUE_H typedef struct scamper_queue scamper_queue_t; typedef int (*scamper_queue_event_cb_t)(void *param); /* * a scamper task can be in one of the following queues at any one time * * the probe queue is for storing tasks that are ready to be probed now. * the wait queue is for storing tasks that have to wait a particular amount * of time before timing out and going back into the probe queue. * the done queue is for storing tasks that have completed and will not * go back into the probe queue. some tasks may have to spend some amount * of time in the done queue before being taken out. */ int scamper_queue_probe(scamper_queue_t *queue); int scamper_queue_probe_head(scamper_queue_t *sq); int scamper_queue_wait(scamper_queue_t *queue, int msec); int scamper_queue_done(scamper_queue_t *queue, int msec); int scamper_queue_wait_tv(scamper_queue_t *queue, const struct timeval *tv); int scamper_queue_isprobe(scamper_queue_t *queue); int scamper_queue_iswait(scamper_queue_t *queue); int scamper_queue_isdone(scamper_queue_t *queue); scamper_queue_t *scamper_queue_alloc(scamper_task_t *task); void scamper_queue_free(scamper_queue_t *queue); /* if a node needs to be removed from a queue, this function will do that */ void scamper_queue_detach(scamper_queue_t *queue); /* get the next task to do something with */ struct scamper_task *scamper_queue_select(void); /* get the next task that is completed and ready to be written out */ struct scamper_task *scamper_queue_getdone(const struct timeval *tv); /* return the time that the first task on the queue will time out */ int scamper_queue_waittime(struct timeval *tv); /* return the number of tasks in the various queues */ int scamper_queue_count(void); /* return the number of tasks that are ready to be probed now */ int scamper_queue_readycount(void); /* return the number of tasks in the probe and wait queues */ int scamper_queue_windowcount(void); /* flush the queues of all non-completed tasks */ void scamper_queue_empty(void); /* put things on the event queue, which are not probe related */ int scamper_queue_event_waittime(struct timeval *tv); int scamper_queue_event_proc(const struct timeval *tv); scamper_queue_t *scamper_queue_event(const struct timeval *tv, scamper_queue_event_cb_t cb, void *ptr); int scamper_queue_event_update_time(scamper_queue_t *sq, const struct timeval *tv); void scamper_queue_event_update_cb(scamper_queue_t *sq, scamper_queue_event_cb_t cb, void *ptr); int scamper_queue_init(void); void scamper_queue_cleanup(void); #endif /* __SCAMPER_QUEUE_H */ scamper-cvs-20171204/scamper/scamper_rtsock.c000644 001751 000000 00000050242 13210743023 020726 0ustar00mjlwheel000000 000000 /* * scamper_rtsock: code to deal with a route socket or equivalent * * $Id: scamper_rtsock.c,v 1.82 2017/12/03 09:38:27 mjl Exp $ * * Matthew Luckie * * Supported by: * The University of Waikato * NLANR Measurement and Network Analysis * CAIDA * The WIDE Project * * The purpose of this code is to obtain the outgoing interface's index * using whatever mechanisms the operating system supports. A route * socket is created where necessary and is kept open for the lifetime * of scamper. * * scamper_rtsock_getifindex returns the interface index on success. * if an error occurs, it returns -1. as route sockets are unreliable * sockets, if we do not get an expected response, we return -2 to * indicate to the caller to try again. * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Copyright (C) 2014 The Regents of the University of California * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_rtsock.c,v 1.82 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #if defined(__APPLE__) static int broken = -1; #endif /* include support for the netlink socket in linux */ #if defined(__linux__) struct nlmsghdr { uint32_t nlmsg_len; uint16_t nlmsg_type; uint16_t nlmsg_flags; uint32_t nlmsg_seq; uint32_t nlmsg_pid; }; struct nlmsgerr { int error; struct nlmsghdr msg; }; struct rtattr { unsigned short rta_len; unsigned short rta_type; }; struct rtmsg { unsigned char rtm_family; unsigned char rtm_dst_len; unsigned char rtm_src_len; unsigned char rtm_tos; unsigned char rtm_table; unsigned char rtm_protocol; unsigned char rtm_scope; unsigned char rtm_type; unsigned rtm_flags; }; #define NLMSG_ERROR 0x2 #define NLMSG_ALIGNTO 4 #define NLMSG_ALIGN(len) (((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1)) #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(sizeof(struct nlmsghdr))) #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) #define RTA_ALIGNTO 4 #define RTA_ALIGN(len) (((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1)) #define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len)) #define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0))) #define RTA_OK(rta,len) ((len) > 0 && (rta)->rta_len >= sizeof(struct rtattr) && \ (rta)->rta_len <= (len)) #define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \ (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len))) #define RTA_UNSPEC 0 #define RTA_DST 1 #define RTA_SRC 2 #define RTA_IIF 3 #define RTA_OIF 4 #define RTA_GATEWAY 5 #define RTA_PRIORITY 6 #define RTA_PREFSRC 7 #define RTA_METRICS 8 #define RTA_MULTIPATH 9 #define RTA_PROTOINFO 10 #define RTA_FLOW 11 #define RTA_CACHEINFO 12 #define RTA_SESSION 13 #define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + \ NLMSG_ALIGN(sizeof(struct rtmsg)))) #define RTM_BASE 0x10 #define RTM_NEWROUTE (RTM_BASE+8) #define RTM_GETROUTE (RTM_BASE+10) #define NLM_F_REQUEST 1 #define NETLINK_ROUTE 0 #endif #include "scamper.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_fds.h" #include "scamper_rtsock.h" #include "scamper_privsep.h" #include "scamper_osinfo.h" #include "scamper_debug.h" #include "utils.h" #include "mjl_list.h" extern scamper_addrcache_t *addrcache; #ifndef _WIN32 typedef struct rtsock_pair { scamper_route_t *route; /* query */ uint16_t seq; /* sequence number used */ dlist_node_t *node; /* pointer to node in pair dlist */ } rtsock_pair_t; static pid_t pid; /* [unpriviledged] process id */ static uint16_t seq = 0; /* next sequence number to use */ static dlist_t *pairs = NULL; /* list of addresses queried with their seq */ static rtsock_pair_t *rtsock_pair_alloc(scamper_route_t *route, int seq) { rtsock_pair_t *pair; if((pair = malloc_zero(sizeof(rtsock_pair_t))) == NULL) return NULL; pair->route = route; pair->seq = seq; if((pair->node = dlist_head_push(pairs, pair)) == NULL) { free(pair); return NULL; } route->internal = pair; return pair; } static void rtsock_pair_free(rtsock_pair_t *pair) { if(pair == NULL) return; pair->route->internal = NULL; if(pair->node != NULL) dlist_node_pop(pairs, pair->node); free(pair); return; } static rtsock_pair_t *rtsock_pair_get(uint16_t seq) { rtsock_pair_t *pair; dlist_node_t *node; for(node=dlist_head_node(pairs); node != NULL; node=dlist_node_next(node)) { pair = dlist_node_item(node); if(pair->seq != seq) continue; dlist_node_pop(pairs, node); pair->node = NULL; return pair; } return NULL; } #if defined(HAVE_BSD_ROUTE_SOCKET) #if 0 static void rtmsg_dump(const uint8_t *buf, size_t len) { char str[80]; size_t i, off = 0; int k = 0; for(i=0; ios_id == SCAMPER_OSINFO_OS_DARWIN && osinfo->os_rel_dots > 0 && osinfo->os_rel[0] >= 10) broken = 1; else broken = 0; } if(broken != 0) { if(len > 0) return (1 + ((len - 1) | (sizeof(uint32_t) - 1))); else return sizeof(uint32_t); } #endif return ((len > 0) ? (1 + ((len - 1) | (sizeof(long) - 1))) : sizeof(long)); } /* * scamper_rtsock_getifindex * * figure out the outgoing interface id / route using route sockets * * route(4) gives an overview of the functions called in here */ static int scamper_rtsock_getifindex(int fd, scamper_addr_t *dst) { struct sockaddr_storage sas; struct sockaddr_dl *sdl; struct rt_msghdr *rtm; uint8_t buf[1024]; size_t len; ssize_t ss; int slen; if(SCAMPER_ADDR_TYPE_IS_IPV4(dst)) sockaddr_compose((struct sockaddr *)&sas, AF_INET, dst->addr, 0); else if(SCAMPER_ADDR_TYPE_IS_IPV6(dst)) sockaddr_compose((struct sockaddr *)&sas, AF_INET6, dst->addr, 0); else return -1; if((slen = sockaddr_len((struct sockaddr *)&sas)) <= 0) return -1; len = sizeof(struct rt_msghdr) + scamper_rtsock_roundup(slen) + scamper_rtsock_roundup(sizeof(struct sockaddr_dl)); if(len > sizeof(buf)) return -1; memset(buf, 0, len); rtm = (struct rt_msghdr *)buf; rtm->rtm_msglen = len; rtm->rtm_version = RTM_VERSION; rtm->rtm_type = RTM_GET; rtm->rtm_addrs = RTA_DST | RTA_IFP; rtm->rtm_pid = pid; rtm->rtm_seq = seq; memcpy(buf + sizeof(struct rt_msghdr), &sas, (size_t)slen); sdl = (struct sockaddr_dl *)(buf + sizeof(struct rt_msghdr) + scamper_rtsock_roundup(slen)); sdl->sdl_family = AF_LINK; #if !defined(__sun__) sdl->sdl_len = sizeof(struct sockaddr_dl); #endif if((ss = write(fd, buf, len)) < 0 || (size_t)ss != len) { printerror(__func__, "could not write routing socket"); return -1; } return 0; } #endif /* HAVE_BSD_ROUTE_SOCKET */ #if defined(__linux__) /* * scamper_rtsock_getifindex * * figure out the outgoing interface id / route using linux netlink * * this works on Linux systems with netlink compiled into the kernel. * i think netlink comes compiled into the kernel with most distributions * these days. * * the man pages netlink(3), netlink(7), rtnetlink(3), and rtnetlink(7) * give an overview of the functions and structures used in here, but the * documentation in those man pages is pretty crap. * you'd be better off studying netlink.h and rtnetlink.h */ static int scamper_rtsock_getifindex(int fd, scamper_addr_t *dst) { struct nlmsghdr *nlmsg; struct rtmsg *rtmsg; struct rtattr *rta; int error; int dst_len; uint8_t buf[1024]; int af; if(SCAMPER_ADDR_TYPE_IS_IPV4(dst)) { dst_len = 4; af = AF_INET; } else if(SCAMPER_ADDR_TYPE_IS_IPV6(dst)) { dst_len = 16; af = AF_INET6; } else { return -1; } /* * fill out a route request. * we use the standard netlink header, with a route msg subheader * to query for the outgoing interface. * the message includes one attribute - the destination address * we are querying the route for. */ memset(buf, 0, sizeof(buf)); nlmsg = (struct nlmsghdr *)buf; nlmsg->nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); nlmsg->nlmsg_type = RTM_GETROUTE; nlmsg->nlmsg_flags = NLM_F_REQUEST; nlmsg->nlmsg_seq = seq; nlmsg->nlmsg_pid = pid; /* netlink wants the bit length of each address */ rtmsg = NLMSG_DATA(nlmsg); rtmsg->rtm_family = af; rtmsg->rtm_flags = 0; rtmsg->rtm_dst_len = dst_len * 8; rta = (struct rtattr *)(buf + NLMSG_ALIGN(nlmsg->nlmsg_len)); rta->rta_type = RTA_DST; rta->rta_len = RTA_LENGTH(dst_len); nlmsg->nlmsg_len += RTA_LENGTH(dst_len); memcpy(RTA_DATA(rta), dst->addr, dst_len); /* send the request */ if((error = send(fd, buf, nlmsg->nlmsg_len, 0)) != nlmsg->nlmsg_len) { printerror(__func__, "could not send"); return -1; } return 0; } #endif int scamper_rtsock_getroute(scamper_fd_t *fdn, scamper_route_t *route) { int fd; /* get the route socket fd */ if((fd = scamper_fd_fd_get(fdn)) == -1) return -1; /* ask the question */ if(scamper_rtsock_getifindex(fd, route->dst) != 0) return -1; /* keep track of the question */ if(rtsock_pair_alloc(route, seq++) == NULL) return -1; return 0; } #if defined(__linux__) #if 0 static void rtattr_dump(struct rtattr *rta) { char *rta_type; char rta_data[64]; int i; switch(rta->rta_type) { case RTA_UNSPEC: rta_type = "unspec"; break; case RTA_DST: rta_type = "dst"; break; case RTA_SRC: rta_type = "src"; break; case RTA_IIF: rta_type = "iif"; break; case RTA_OIF: rta_type = "oif"; break; case RTA_GATEWAY: rta_type = "gateway"; break; case RTA_PRIORITY: rta_type = "priority"; break; case RTA_PREFSRC: rta_type = "prefsrc"; break; case RTA_METRICS: rta_type = "metrics"; break; case RTA_MULTIPATH: rta_type = "multipath"; break; case RTA_PROTOINFO: rta_type = "protoinfo"; break; case RTA_FLOW: rta_type = "flow"; break; case RTA_CACHEINFO: rta_type = "cacheinfo"; break; case RTA_SESSION: rta_type = "session"; break; default: rta_type = ""; break; } for(i=0;irta_len-sizeof(struct rtattr)&&i<(sizeof(rta_data)/2)-1;i++) { snprintf(&rta_data[i*2], 3, "%02x", *(uint8_t *)(((char *)rta) + sizeof(struct rtattr) + i)); } if(i != 0) { scamper_debug(__func__, "type %s len %d data %s", rta_type, rta->rta_len-sizeof(struct rtattr), rta_data); } else { scamper_debug(__func__, "type %s\n", rta_type); } return; } #endif static void rtsock_parsemsg(uint8_t *buf, size_t len) { struct nlmsghdr *nlmsg; struct nlmsgerr *nlerr; struct rtmsg *rtmsg; struct rtattr *rta; void *gwa = NULL; int ifindex = -1; scamper_addr_t *gw = NULL; rtsock_pair_t *pair = NULL; scamper_route_t *route = NULL; if(len < sizeof(struct nlmsghdr)) { scamper_debug(__func__, "len %d != %d", len, sizeof(struct nlmsghdr)); return; } nlmsg = (struct nlmsghdr *)buf; /* if the message isn't addressed to this pid, drop it */ if(nlmsg->nlmsg_pid != pid) return; if((pair = rtsock_pair_get(nlmsg->nlmsg_seq)) == NULL) return; route = pair->route; rtsock_pair_free(pair); if(nlmsg->nlmsg_type == RTM_NEWROUTE) { rtmsg = NLMSG_DATA(nlmsg); /* this is the payload length of the response packet */ len = nlmsg->nlmsg_len - NLMSG_LENGTH(sizeof(struct rtmsg)); /* hunt through the payload for the RTA_OIF entry */ rta = RTM_RTA(rtmsg); while(RTA_OK(rta, len)) { switch(rta->rta_type) { case RTA_OIF: ifindex = *(unsigned *)RTA_DATA(rta); break; case RTA_GATEWAY: gwa = RTA_DATA(rta); break; } rta = RTA_NEXT(rta, len); } if(gwa != NULL) { if(rtmsg->rtm_family == AF_INET) gw = scamper_addrcache_get_ipv4(addrcache, gwa); else if(rtmsg->rtm_family == AF_INET6) gw = scamper_addrcache_get_ipv6(addrcache, gwa); else route->error = EINVAL; } } else if(nlmsg->nlmsg_type == NLMSG_ERROR) { nlerr = NLMSG_DATA(nlmsg); route->error = nlerr->error; } else goto skip; route->gw = gw; route->ifindex = ifindex; route->cb(route); return; skip: if(route != NULL) scamper_route_free(route); return; } #endif #if defined(HAVE_BSD_ROUTE_SOCKET) static void rtsock_parsemsg(uint8_t *buf, size_t len) { struct rt_msghdr *rtm; struct sockaddr *addrs[RTAX_MAX]; struct sockaddr_dl *sdl; struct sockaddr *sa; struct in6_addr *ip6; size_t off, tmp, x; int i, ifindex; void *addr; scamper_addr_t *gw; rtsock_pair_t *pair; scamper_route_t *route; x = 0; while(x < len) { if(len - x < sizeof(struct rt_msghdr)) { scamper_debug(__func__,"len %d != %d",len,sizeof(struct rt_msghdr)); return; } /* * check if the message is something we want, and that we have * a pair for it */ rtm = (struct rt_msghdr *)(buf + x); if(rtm->rtm_pid != pid || rtm->rtm_msglen > len - x || rtm->rtm_type != RTM_GET || (rtm->rtm_flags & RTF_DONE) == 0 || (pair = rtsock_pair_get(rtm->rtm_seq)) == NULL) { x += rtm->rtm_msglen; continue; } route = pair->route; rtsock_pair_free(pair); ifindex = -1; addr = NULL; gw = NULL; if(rtm->rtm_errno != 0) { route->error = rtm->rtm_errno; goto done; } off = sizeof(struct rt_msghdr); memset(addrs, 0, sizeof(addrs)); for(i=0; irtm_addrs & (1 << i)) { addrs[i] = sa = (struct sockaddr *)(buf + x + off); if((tmp = sockaddr_len(sa)) == -1) { printerror_msg(__func__, "unhandled af %d", sa->sa_family); route->error = EINVAL; goto done; } off += scamper_rtsock_roundup(tmp); } } if((sdl = (struct sockaddr_dl *)addrs[RTAX_IFP]) != NULL) { if(sdl->sdl_family != AF_LINK) { printerror_msg(__func__, "sdl_family %d", sdl->sdl_family); route->error = EINVAL; goto done; } ifindex = sdl->sdl_index; } if((sa = addrs[RTAX_GATEWAY]) != NULL) { if(sa->sa_family == AF_INET) { i = SCAMPER_ADDR_TYPE_IPV4; addr = &((struct sockaddr_in *)sa)->sin_addr; } else if(sa->sa_family == AF_INET6) { /* * check to see if the gw address is a link local address. if * it is, then drop the embedded index from the gateway address */ ip6 = &((struct sockaddr_in6 *)sa)->sin6_addr; if(IN6_IS_ADDR_LINKLOCAL(ip6)) { ip6->s6_addr[2] = 0; ip6->s6_addr[3] = 0; } i = SCAMPER_ADDR_TYPE_IPV6; addr = ip6; } else if(sa->sa_family == AF_LINK) { sdl = (struct sockaddr_dl *)sa; if(sdl->sdl_type == IFT_ETHER && sdl->sdl_alen == ETHER_ADDR_LEN) { i = SCAMPER_ADDR_TYPE_ETHERNET; addr = sdl->sdl_data + sdl->sdl_nlen; } } /* * if we have got a gateway address that we know what to do with, * then store it here. */ if(addr != NULL && (gw = scamper_addrcache_get(addrcache, i, addr)) == NULL) { scamper_debug(__func__, "could not get rtsmsg->rr.gw"); route->error = EINVAL; goto done; } } done: route->gw = gw; route->ifindex = ifindex; route->cb(route); x += rtm->rtm_msglen; } return; } #endif /* * scamper_rtsock_read_cb * * this callback handles reading a message from the route socket. * we check to see if the message is something that we have sent by parsing * the message out. if we did send the message, then we search for the * address-sequence pair, which matches the sequence number with a route * lookup. * if we get a pair back, then we remove it from the list and look for a * trace matching the address. we then take the result from the route * lookup and apply it to the trace. */ void scamper_rtsock_read_cb(const int fd, void *param) { uint8_t buf[2048]; ssize_t len; if((len = recv(fd, buf, sizeof(buf), 0)) < 0) { printerror(__func__, "recv failed"); return; } if(len > 0) rtsock_parsemsg(buf, len); return; } void scamper_rtsock_close(int fd) { close(fd); return; } int scamper_rtsock_open_fd() { #if defined(HAVE_BSD_ROUTE_SOCKET) return socket(PF_ROUTE, SOCK_RAW, AF_UNSPEC); #elif defined(__linux__) return socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); #else #error "route socket support for this system not implemented" #endif } int scamper_rtsock_open() { int fd; #if defined(WITHOUT_PRIVSEP) if((fd = scamper_rtsock_open_fd()) == -1) #else if((fd = scamper_privsep_open_rtsock()) == -1) #endif { printerror(__func__, "could not open route socket"); return -1; } return fd; } #endif #ifdef _WIN32 static int scamper_rtsock_getroute4(scamper_route_t *route) { struct in_addr *in = route->dst->addr; MIB_IPFORWARDROW fw; DWORD dw; if((dw = GetBestRoute(in->s_addr, 0, &fw)) != NO_ERROR) { route->error = dw; return -1; } route->ifindex = fw.dwForwardIfIndex; /* determine the gateway address to use, if one is specified */ if((dw = fw.dwForwardNextHop) != 0) { if((route->gw = scamper_addrcache_get_ipv4(addrcache, &dw)) == NULL) { route->error = errno; return -1; } } return 0; } int scamper_rtsock_getroute(scamper_route_t *route) { if(SCAMPER_ADDR_TYPE_IS_IPV4(route->dst) && scamper_rtsock_getroute4(route) == 0) { route->cb(route); return 0; } return -1; } #endif void scamper_route_free(scamper_route_t *route) { if(route == NULL) return; #ifndef _WIN32 if(route->internal != NULL) rtsock_pair_free(route->internal); #endif if(route->dst != NULL) scamper_addr_free(route->dst); if(route->gw != NULL) scamper_addr_free(route->gw); free(route); return; } scamper_route_t *scamper_route_alloc(scamper_addr_t *dst, void *param, void (*cb)(scamper_route_t *rt)) { scamper_route_t *route; if((route = malloc_zero(sizeof(scamper_route_t))) == NULL) return NULL; route->dst = scamper_addr_use(dst); route->param = param; route->cb = cb; return route; } int scamper_rtsock_init() { #ifndef _WIN32 if((pairs = dlist_alloc()) == NULL) { printerror(__func__, "could not allocate pair list"); return -1; } pid = getpid(); #endif return 0; } void scamper_rtsock_cleanup() { #ifndef _WIN32 rtsock_pair_t *pair; if(pairs != NULL) { while((pair = dlist_head_pop(pairs)) != NULL) { pair->node = NULL; rtsock_pair_free(pair); } dlist_free(pairs); pairs = NULL; } #endif return; } scamper-cvs-20171204/scamper/scamper_rtsock.h000644 001751 000000 00000004425 11752250527 020750 0ustar00mjlwheel000000 000000 /* * scamper_rtsock.h * * $Id: scamper_rtsock.h,v 1.18 2012/05/08 17:01:11 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_RTSOCK_H #define __SCAMPER_RTSOCK_H int scamper_rtsock_init(void); void scamper_rtsock_cleanup(void); int scamper_rtsock_roundup(size_t len); typedef struct scamper_route scamper_route_t; #ifdef __SCAMPER_ADDR_H scamper_route_t *scamper_route_alloc(scamper_addr_t *dst, void *param, void (*cb)(scamper_route_t *rt)); #endif void scamper_route_free(scamper_route_t *route); #ifndef _WIN32 int scamper_rtsock_open(void); int scamper_rtsock_open_fd(void); void scamper_rtsock_read_cb(const int fd, void *param); void scamper_rtsock_close(int fd); #endif #if defined(_WIN32) int scamper_rtsock_getroute(scamper_route_t *route); #elif defined(__SCAMPER_FD_H) int scamper_rtsock_getroute(scamper_fd_t *fd, scamper_route_t *route); #endif #if defined(__SCAMPER_ADDR_H) struct scamper_route { /* * parameters supplied on input: * - destination address to look up, * - function to call back with a result, * - parameter that the caller can set for its own use. */ scamper_addr_t *dst; void (*cb)(scamper_route_t *rt); void *param; /* * result of route lookup: * - gateway to use, if any, * - interface to use, * - an error code if the lookup failed. */ scamper_addr_t *gw; int ifindex; int error; /* a pointer that is used internally by the routing code */ void *internal; }; #endif #endif /* SCAMPER_RTSOCK_H */ scamper-cvs-20171204/scamper/scamper_source_cmdline.c000644 001751 000000 00000005543 13210743023 022420 0ustar00mjlwheel000000 000000 /* * scamper_source_cmdline.c * * $Id: scamper_source_cmdline.c,v 1.11 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Copyright (C) 2014 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_source_cmdline.c,v 1.11 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_debug.h" #include "scamper_task.h" #include "scamper_outfiles.h" #include "scamper_sources.h" #include "scamper_source_cmdline.h" #include "utils.h" static int command_assemble(char **out, size_t *len, const char *cmd, size_t cmdlen, const char *addr) { size_t addrlen = strlen(addr); size_t reqlen = cmdlen + 1 + addrlen + 1; char *tmp; if(reqlen > *len) { if(*len != 0) { if((tmp = realloc(*out, reqlen)) == NULL) { printerror(__func__, "could not realloc %d bytes", reqlen); return -1; } } else { if((tmp = malloc_zero(reqlen)) == NULL) { printerror(__func__, "could not malloc %d bytes", reqlen); return -1; } memcpy(tmp, cmd, cmdlen); tmp[cmdlen] = ' '; } *out = tmp; *len = reqlen; } memcpy((*out)+cmdlen+1, addr, addrlen + 1); return 0; } scamper_source_t *scamper_source_cmdline_alloc(scamper_source_params_t *ssp, const char *cmd, char **arg, int arg_cnt) { scamper_source_t *source = NULL; size_t cmd_len, len = 0; char *buf = NULL; int i; ssp->type = SCAMPER_SOURCE_TYPE_CMDLINE; if((source = scamper_source_alloc(ssp)) == NULL) { goto err; } if(cmd != NULL) { cmd_len = strlen(cmd); for(i=0; isource) == 0 && ssc->isfinished == 0) { ssc->signalmore(ssc->param); } return 0; } static void ssc_freedata(void *data) { free(data); return; } static int ssc_isfinished(void *data) { return ((scamper_source_control_t *)data)->isfinished; } static char *ssc_tostr(void *data, char *str, size_t len) { scamper_source_control_t *ssc = data; size_t off = 0; char buf[128]; string_concat(str, len, &off, "type control "); if(ssc->tostr(ssc->param, buf, sizeof(buf)) != NULL) string_concat(str, len, &off, "%s ", buf); if(ssc->isfinished == 0) string_concat(str, len, &off, "more"); else string_concat(str, len, &off, "nomore"); return str; } /* * scamper_source_control_finish * * the control socket has finished supplying commands, so make a note of * that for the next time the sources code cares to look. */ void scamper_source_control_finish(scamper_source_t *source) { scamper_source_control_t *ssc; assert(scamper_source_gettype(source) == SCAMPER_SOURCE_TYPE_CONTROL); ssc = (scamper_source_control_t *)scamper_source_getdata(source); assert(ssc != NULL); if(ssc->isfinished != 0) return; ssc->isfinished = 1; if(scamper_source_isfinished(source) != 0) { scamper_source_finished(source); } return; } /* * scamper_source_control_alloc * * allocate a new source that is setup to interact with a control socket * connection that supplies commands. the control socket is regulated * (on / off) by using the acceptready callback provided. */ scamper_source_t *scamper_source_control_alloc(scamper_source_params_t *ssp, void (*signalmore)(void *), char *(*tostr)(void *,char *,size_t), void *param) { scamper_source_control_t *ssc = NULL; scamper_source_t *source = NULL; if(ssp == NULL || signalmore == NULL || param == NULL) { goto err; } /* allocate state to keep with the particular control socket */ if((ssc = malloc_zero(sizeof(scamper_source_control_t))) == NULL) { goto err; } ssc->signalmore = signalmore; ssc->param = param; ssc->tostr = tostr; /* append parameters to the source parameters struct */ ssp->data = ssc; ssp->take = ssc_take; ssp->freedata = ssc_freedata; ssp->isfinished = ssc_isfinished; ssp->tostr = ssc_tostr; ssp->type = SCAMPER_SOURCE_TYPE_CONTROL; if((source = scamper_source_alloc(ssp)) == NULL) { goto err; } ssc->source = source; return source; err: if(ssc != NULL) free(ssc); if(source != NULL) scamper_source_free(source); return NULL; } scamper-cvs-20171204/scamper/scamper_source_control.h000644 001751 000000 00000002272 11651662414 022501 0ustar00mjlwheel000000 000000 /* * scamper_source_control.h * * $Id: scamper_source_control.h,v 1.5 2011/10/26 01:40:28 mjl Exp $ * * Copyright (C) 2007-2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_SOURCE_CONTROL_H #define __SCAMPER_SOURCE_CONTROL_H scamper_source_t *scamper_source_control_alloc(scamper_source_params_t *ssp, void (*signalmore)(void *), char *(*tostr)(void *,char *,size_t), void *param); void scamper_source_control_finish(scamper_source_t *source); #endif /* __SCAMPER_SOURCE_CONTROL_H */ scamper-cvs-20171204/scamper/scamper_source_file.c000644 001751 000000 00000030731 13210743023 021721 0ustar00mjlwheel000000 000000 /* * scamper_source_file.c * * $Id: scamper_source_file.c,v 1.23 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2014 The Regents of the University of California * Copyright (C) 2017 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_source_file.c,v 1.23 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_debug.h" #include "scamper_outfiles.h" #include "scamper_task.h" #include "scamper_sources.h" #include "scamper_linepoll.h" #include "scamper_fds.h" #include "scamper_privsep.h" #include "scamper_source_file.h" #include "utils.h" typedef struct scamper_source_file { /* back-pointer to the parent source */ scamper_source_t *source; /* parameters for the file */ char *filename; char *command; size_t command_len; int cycles; int autoreload; /* run-time state */ int reload; time_t mtime; scamper_fd_t *fd; scamper_linepoll_t *lp; } scamper_source_file_t; static int stdin_used = 0; /* * ssf_free * * free up all resources related to an address-list-file. */ static void ssf_free(scamper_source_file_t *ssf) { int fd = -1; if(ssf->lp != NULL) { scamper_linepoll_free(ssf->lp, 0); ssf->lp = NULL; } if(ssf->filename != NULL) { free(ssf->filename); ssf->filename = NULL; } if(ssf->command != NULL) { free(ssf->command); ssf->command = NULL; } if(ssf->fd != NULL) { fd = scamper_fd_fd_get(ssf->fd); scamper_fd_free(ssf->fd); ssf->fd = NULL; } if(fd != -1) { close(fd); } free(ssf); return; } static int ssf_open(const char *filename) { int fd = -1; /* get a file descriptor to the file */ if(strcmp(filename, "-") != 0) { #if defined(WITHOUT_PRIVSEP) fd = open(filename, O_RDONLY); #else fd = scamper_privsep_open_file(filename, O_RDONLY, 0); #endif } else if(stdin_used == 0) { fd = STDIN_FILENO; stdin_used = 1; } if(fd == -1) { goto err; } #ifdef O_NONBLOCK if(fcntl_set(fd, O_NONBLOCK) == -1) { goto err; } #endif return fd; err: if(fd != -1) close(fd); return -1; } /* * ssf_read_line * * this callback receives a single line per call, which should contain an * address in string form. it combines that address with the source's * default command and then passes the string to source_command for further * processing. the line eventually ends up in the commands queue. */ static int ssf_read_line(void *param, uint8_t *buf, size_t len) { scamper_source_file_t *ssf = (scamper_source_file_t *)param; scamper_source_t *source = ssf->source; char *str = (char *)buf; char cmd_buf[256], *cmd = NULL; size_t reqd_len; /* make sure the string contains only printable characters */ if(string_isprint(str, len) == 0) { goto err; } if(ssf->command != NULL) { /* null terminate at these characters */ string_nullterm(str, " \r\t#", NULL); if(str[0] == '\0' || str[0] == '#') return 0; /* figure out if the cmd_buf above is large enough */ len = strlen(str); if(sizeof(cmd_buf) >= (reqd_len = ssf->command_len + 1 + len + 1)) { cmd = cmd_buf; } else { if((cmd = malloc_zero(reqd_len)) == NULL) { goto err; } } /* build the command string */ memcpy(cmd, ssf->command, ssf->command_len); cmd[ssf->command_len] = ' '; memcpy(cmd + ssf->command_len + 1, str, len+1); } else { string_nullterm(str, "\r\t#", NULL); if(str[0] == '\0' || str[0] == '#') return 0; cmd = str; } /* add the command to the source */ if(scamper_source_command(source, cmd) != 0) { goto err; } if(cmd != cmd_buf && cmd != str) free(cmd); return 0; err: if(cmd != cmd_buf && cmd != str) free(cmd); return -1; } static void ssf_read(const int fd, void *param) { scamper_source_file_t *ssf = (scamper_source_file_t *)param; scamper_source_t *source = ssf->source; uint8_t buf[1024]; ssize_t rc; time_t mtime; int reload = 0; int newfd; assert(ssf->cycles != 0); if((rc = read(fd, buf, sizeof(buf))) > 0) { /* got data to read. parse the buffer for addresses, one per line. */ scamper_linepoll_handle(ssf->lp, buf, (size_t)rc); /* * if probe queue for this source is sufficiently large, then * don't read any more for the time being */ if(scamper_source_getcommandcount(source) >= scamper_pps_get()) { scamper_fd_read_pause(ssf->fd); } } else if(rc == 0 && ssf->cycles == 1) { /* got EOF; this is the last cycle over an input file */ scamper_linepoll_flush(ssf->lp); ssf->cycles = 0; scamper_fd_read_pause(ssf->fd); if(scamper_source_isfinished(source) != 0) scamper_source_finished(source); } else if(rc == 0) { scamper_linepoll_flush(ssf->lp); /* a cycle value of -1 means cycle indefinitely */ if(ssf->cycles != -1) { ssf->cycles--; } /* decide if we should reload the file at this point */ if(ssf->reload == 1) { /* stat the file so we have an mtime value for later */ if(stat_mtime(ssf->filename, &mtime) == 0) { reload = 1; } } else if(ssf->autoreload == 1) { /* * reload is conditional on being able to stat the file, and the * mtime being different to whatever our record of the mtime is */ if(stat_mtime(ssf->filename, &mtime) == 0 && ssf->mtime != mtime) { reload = 1; } } /* we have to reload the file (if we can open it) */ if(reload == 1 && (newfd = ssf_open(ssf->filename)) != -1) { /* use the new file descriptor */ if(scamper_fd_fd_set(ssf->fd, newfd) == -1) { goto err; } /* close the existing file */ close(fd); /* update file details; ensure reload is reset to zero */ ssf->mtime = mtime; ssf->reload = 0; } else { /* rewind the current file position */ if(lseek(fd, 0, SEEK_SET) == -1) { goto err; } } /* check to see if we should pause, or allow reading to continue */ if(scamper_source_getcyclecount(ssf->source) < 1) { scamper_fd_read_unpause(ssf->fd); } else { scamper_fd_read_pause(ssf->fd); } /* create a new cycle record, etc */ if(scamper_source_cycle(source) != 0) { goto err; } } else { assert(rc == -1); if(errno != EAGAIN && errno != EINTR) { printerror(__func__, "read failed fd %d", fd); goto err; } } return; err: /* * an error occurred. the simplest way to cause the source to disappear * gracefully is to set the cycles parameter to zero, which will signal * to the sources code that there are no more commands to come */ ssf->cycles = 0; return; } /* * ssf_tostr * * this function generates a printable representation of the source */ static char *ssf_tostr(void *data, char *str, size_t len) { scamper_source_file_t *ssf = (scamper_source_file_t *)data; size_t off = 0; if(len < 1) return NULL; string_concat(str, len, &off, "type file "); if(ssf->fd != NULL) string_concat(str, len, &off, "fd %d ", scamper_fd_fd_get(ssf->fd)); if(ssf->filename != NULL) string_concat(str, len, &off, "file \"%s\" ", ssf->filename); if(ssf->command != NULL) string_concat(str, len, &off, "cmd \"%s\" ", ssf->command); string_concat(str, len, &off, "cycles %d", ssf->cycles); return str; } /* * ssf_take * * this function is used to quench the source from sending more commands */ static int ssf_take(void *data) { scamper_source_file_t *ssf = (scamper_source_file_t *)data; if(scamper_source_getcyclecount(ssf->source) < 2 && scamper_source_getcommandcount(ssf->source) < scamper_pps_get() && ssf->cycles != 0) { scamper_fd_read_unpause(ssf->fd); } return 0; } static void ssf_freedata(void *data) { ssf_free((scamper_source_file_t *)data); return; } /* * ssf_isfinished * * advise the caller if the source may be supplying more commands or not. * in the address-list-file case, more addresses will be supplied until * the cycles count reaches zero. */ static int ssf_isfinished(void *data) { scamper_source_file_t *ssf = (scamper_source_file_t *)data; if(ssf->cycles != 0) { return 0; } return 1; } int scamper_source_file_getcycles(const scamper_source_t *source) { scamper_source_file_t *ssf; if((ssf = (scamper_source_file_t *)scamper_source_getdata(source)) != NULL) { return ssf->cycles; } return -1; } int scamper_source_file_getautoreload(const scamper_source_t *source) { scamper_source_file_t *ssf; if((ssf = (scamper_source_file_t *)scamper_source_getdata(source)) != NULL) { return ssf->autoreload; } return -1; } const char *scamper_source_file_getfilename(const scamper_source_t *source) { scamper_source_file_t *ssf; if((ssf = (scamper_source_file_t *)scamper_source_getdata(source)) != NULL) { return ssf->filename; } return NULL; } int scamper_source_file_update(scamper_source_t *source, const int *autoreload, const int *cycles) { scamper_source_file_t *ssf; scamper_source_event_t sse; if(scamper_source_gettype(source) != SCAMPER_SOURCE_TYPE_FILE || (ssf = (scamper_source_file_t *)scamper_source_getdata(source)) == NULL) { return -1; } memset(&sse, 0, sizeof(sse)); if(autoreload != NULL) { sse.sse_update_flags |= 0x01; sse.sse_update_autoreload = *autoreload; ssf->autoreload = *autoreload; } if(cycles != NULL) { sse.sse_update_flags |= 0x02; sse.sse_update_cycles = *cycles; ssf->cycles = *cycles; } if(sse.sse_update_flags != 0) { scamper_source_event_post(source, SCAMPER_SOURCE_EVENT_UPDATE, &sse); } return 0; } scamper_source_t *scamper_source_file_alloc(scamper_source_params_t *ssp, const char *filename, const char *command, int cycles, int autoreload) { scamper_source_file_t *ssf = NULL; int fd = -1; /* sanity checks */ if(ssp == NULL || filename == NULL) { goto err; } /* allocate the structure for keeping track of the address list file */ if((ssf = malloc_zero(sizeof(scamper_source_file_t))) == NULL || (ssf->filename = strdup(filename)) == NULL) { goto err; } ssf->cycles = cycles; ssf->autoreload = autoreload; /* addresses are matched with a command to execute */ if(command != NULL) { if((ssf->command = strdup(command)) == NULL) goto err; ssf->command_len = strlen(ssf->command); } if((fd = ssf_open(filename)) == -1) { goto err; } /* allocate a scamper_fd_t to monitor when new data is able to be read */ if(strcmp(filename, "-") != 0) ssf->fd = scamper_fd_file(fd, ssf_read, ssf); else ssf->fd = scamper_fd_private(fd, ssf, ssf_read, NULL); if(ssf->fd == NULL) goto err; fd = -1; if((ssf->lp = scamper_linepoll_alloc(ssf_read_line, ssf)) == NULL) { goto err; } /* * data and callback functions that scamper_source_alloc needs to know about */ ssp->data = ssf; ssp->take = ssf_take; ssp->freedata = ssf_freedata; ssp->isfinished = ssf_isfinished; ssp->tostr = ssf_tostr; ssp->type = SCAMPER_SOURCE_TYPE_FILE; /* allocate the parent source structure */ if((ssf->source = scamper_source_alloc(ssp)) == NULL) { goto err; } return ssf->source; err: if(ssf != NULL) { assert(ssf->source == NULL); ssf_free(ssf); } if(fd != -1) close(fd); return NULL; } scamper-cvs-20171204/scamper/scamper_source_file.h000644 001751 000000 00000002714 11634537540 021743 0ustar00mjlwheel000000 000000 /* * scamper_source_file.h * * $Id: scamper_source_file.h,v 1.3 2011/09/16 03:15:44 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2008 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_SOURCE_FILE_H #define __SCAMPER_SOURCE_FILE_H scamper_source_t *scamper_source_file_alloc(scamper_source_params_t *ssp, const char *filename, const char *command, int cycles, int autoreload); const char *scamper_source_file_getfilename(const scamper_source_t *source); int scamper_source_file_getcycles(const scamper_source_t *source); int scamper_source_file_getautoreload(const scamper_source_t *source); int scamper_source_file_update(scamper_source_t *source, const int *autoreload, const int *cycles); #endif /* __SCAMPER_SOURCE_FILE_H */ scamper-cvs-20171204/scamper/scamper_source_tsps.c000644 001751 000000 00000016327 13210743023 022000 0ustar00mjlwheel000000 000000 /* * scamper_source_tsps.c * * $Id: scamper_source_tsps.c,v 1.10 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_source_tsps.c,v 1.10 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_debug.h" #include "scamper_outfiles.h" #include "scamper_task.h" #include "scamper_sources.h" #include "scamper_linepoll.h" #include "scamper_fds.h" #include "scamper_privsep.h" #include "scamper_source_tsps.h" #include "utils.h" typedef struct scamper_source_tsps { scamper_source_t *source; char *filename; scamper_fd_t *fd; scamper_linepoll_t *lp; int done; } scamper_source_tsps_t; static int stdin_used = 0; /* * ssf_free * * free up all resources related to an address-list-file. */ static void ssf_free(scamper_source_tsps_t *ssf) { int fd = -1; if(ssf->lp != NULL) { scamper_linepoll_free(ssf->lp, 0); ssf->lp = NULL; } if(ssf->filename != NULL) { free(ssf->filename); ssf->filename = NULL; } if(ssf->fd != NULL) { fd = scamper_fd_fd_get(ssf->fd); scamper_fd_free(ssf->fd); ssf->fd = NULL; } if(fd != -1) { close(fd); } free(ssf); return; } static int ssf_open(const char *filename) { int fd = -1; /* get a file descriptor to the file */ if(strcmp(filename, "-") != 0) { #if defined(WITHOUT_PRIVSEP) fd = open(filename, O_RDONLY); #else fd = scamper_privsep_open_file(filename, O_RDONLY, 0); #endif } else if(stdin_used == 0) { fd = 1; stdin_used = 1; } if(fd == -1) goto err; #ifdef O_NONBLOCK if(fcntl_set(fd, O_NONBLOCK) == -1) goto err; #endif return fd; err: if(fd != -1) close(fd); return -1; } /* * ssf_read_line * * this callback receives a single line per call, which should contain an * address in string form. it combines that address with the source's * default command and then passes the string to source_command for further * processing. the line eventually ends up in the commands queue. */ static int ssf_read_line(void *param, uint8_t *buf, size_t len) { scamper_source_tsps_t *ssf = (scamper_source_tsps_t *)param; scamper_source_t *source = ssf->source; char *str = (char *)buf; char *bits[5]; int i, bitc = 0; char cb[256]; size_t off = 0; /* make sure the string contains only printable characters */ if(string_isprint(str, len) == 0) goto err; /* make sure the line isn't blank or a comment line */ if(str[0] == '\0' || str[0] == '#') return 0; for(;;) { if(bitc == 5) goto err; bits[bitc++] = str; while(isdigit((int)*str) != 0 || *str == '.') str++; if(*str == '\0') break; if(*str == ' ' || *str == '\t') { *str = '\0'; str++; if(*str == '\0') goto err; } else goto err; } string_concat(cb, sizeof(cb), &off, "ping"); if(bitc > 1) { string_concat(cb, sizeof(cb), &off, " -T tsprespec=%s", bits[1]); for(i=2; isource; uint8_t buf[1024]; ssize_t rc; assert(ssf->done == 0); if((rc = read(fd, buf, sizeof(buf))) > 0) { /* got data to read. parse the buffer for addresses, one per line. */ scamper_linepoll_handle(ssf->lp, buf, (size_t)rc); /* * if probe queue for this source is sufficiently large, then * don't read any more for the time being */ if(scamper_source_getcommandcount(source) >= scamper_pps_get()) { scamper_fd_read_pause(ssf->fd); } } else if(rc == 0) { scamper_linepoll_flush(ssf->lp); ssf->done = 1; scamper_fd_read_pause(ssf->fd); } else { if(errno != EAGAIN && errno != EINTR) { printerror(__func__, "read failed"); goto err; } } return; err: /* * an error occurred. the simplest way to cause the source to disappear * gracefully is to set the done parameter to one, which will signal * to the sources code that there are no more commands to come */ ssf->done = 1; return; } static int ssf_take(void *data) { scamper_source_tsps_t *ssf = (scamper_source_tsps_t *)data; if(scamper_source_getcommandcount(ssf->source) < scamper_pps_get() && ssf->done == 0) { scamper_fd_read_unpause(ssf->fd); } return 0; } static void ssf_freedata(void *data) { ssf_free((scamper_source_tsps_t *)data); return; } static int ssf_isfinished(void *data) { scamper_source_tsps_t *ssf = (scamper_source_tsps_t *)data; return ssf->done; } const char *scamper_source_tsps_getfilename(const scamper_source_t *source) { scamper_source_tsps_t *ssf; if((ssf = (scamper_source_tsps_t *)scamper_source_getdata(source)) != NULL) return ssf->filename; return NULL; } scamper_source_t *scamper_source_tsps_alloc(scamper_source_params_t *ssp, const char *filename) { scamper_source_tsps_t *ssf = NULL; int fd = -1; /* sanity checks */ if(ssp == NULL || filename == NULL) { goto err; } /* allocate the structure for keeping track of the address list file */ if((ssf = malloc_zero(sizeof(scamper_source_tsps_t))) == NULL || (ssf->filename = strdup(filename)) == NULL) { goto err; } if((fd = ssf_open(filename)) == -1) { goto err; } /* allocate a scamper_fd_t to monitor when new data is able to be read */ if((ssf->fd = scamper_fd_file(fd, ssf_read, ssf)) == NULL) { goto err; } fd = -1; if((ssf->lp = scamper_linepoll_alloc(ssf_read_line, ssf)) == NULL) { goto err; } /* * data and callback functions that scamper_source_alloc needs to know about */ ssp->data = ssf; ssp->take = ssf_take; ssp->freedata = ssf_freedata; ssp->isfinished = ssf_isfinished; ssp->type = SCAMPER_SOURCE_TYPE_TSPS; /* allocate the parent source structure */ if((ssf->source = scamper_source_alloc(ssp)) == NULL) { goto err; } return ssf->source; err: if(ssf != NULL) { assert(ssf->source == NULL); ssf_free(ssf); } if(fd != -1) close(fd); return NULL; } scamper-cvs-20171204/scamper/scamper_source_tsps.h000644 001751 000000 00000002141 11372135732 022003 0ustar00mjlwheel000000 000000 /* * scamper_source_tsps.h * * $Id: scamper_source_tsps.h,v 1.1 2010/05/11 02:07:22 mjl Exp $ * * Copyright (C) 2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_SOURCE_TSPS_H #define __SCAMPER_SOURCE_TSPS_H scamper_source_t *scamper_source_tsps_alloc(scamper_source_params_t *ssp, const char *filename); const char *scamper_source_tsps_getfilename(const scamper_source_t *source); #endif /* __SCAMPER_SOURCE_TSPS_H */ scamper-cvs-20171204/scamper/scamper_sources.c000644 001751 000000 00000135160 13210743023 021107 0ustar00mjlwheel000000 000000 /* * scamper_source * * $Id: scamper_sources.c,v 1.56 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012 Matthew Luckie * Copyright (C) 2012 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_sources.c,v 1.56 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_task.h" #include "scamper_file.h" #include "scamper_outfiles.h" #include "scamper_sources.h" #include "scamper_cyclemon.h" #include "trace/scamper_trace_do.h" #include "ping/scamper_ping_do.h" #include "tracelb/scamper_tracelb_do.h" #include "dealias/scamper_dealias_do.h" #include "sting/scamper_sting_do.h" #include "neighbourdisc/scamper_neighbourdisc_do.h" #include "tbit/scamper_tbit_do.h" #include "sniff/scamper_sniff_do.h" #include "scamper_debug.h" #include "utils.h" #include "mjl_list.h" #include "mjl_splaytree.h" /* * scamper_source * * this structure maintains state regarding tasks that come from a particular * source. some of the state is stored in scamper_list_t and scamper_cycle_t * structures with the resulting data object. * */ struct scamper_source { /* basic data collection properties to store with the source */ scamper_list_t *list; scamper_cycle_t *cycle; /* properties of the source */ uint32_t priority; int type; int refcnt; scamper_outfile_t *sof; scamper_cyclemon_t *cyclemon; /* * commands: a list of commands for the source that are queued, ready to * be passed out as tasks * cycle_points: the number of cycle points in the commands list * onhold: a list of commands that are on hold. * tasks: a list of tasks currently active from the source. * id: the next id number to assign * idtree: a tree of id numbers currently in use */ dlist_t *commands; int cycle_points; dlist_t *onhold; dlist_t *tasks; uint32_t id; splaytree_t *idtree; /* * nodes to keep track of whether the source is in the active or blocked * lists, and a node to keep track of the source in a splaytree */ void *list_; void *list_node; splaytree_node_t *tree_node; /* data and callback functions specific to the type of source this is */ void *data; int (*take)(void *data); void (*freedata)(void *data); int (*isfinished)(void *data); char * (*tostr)(void *data, char *str, size_t len); }; struct scamper_sourcetask { scamper_source_t *source; scamper_task_t *task; dlist_node_t *node; uint32_t id; splaytree_node_t *idnode; }; /* * scamper_source_observer * * this structure records details of an observer interested in monitoring * source events. * * func: the callback function to use when an event occurs * param: the parameter to pass to the function * node: the appropriate dlist_node in the observers dlist. */ struct scamper_source_observer { scamper_source_eventf_t func; void *param; dlist_node_t *node; }; /* * command_funcs * * a utility struct to save passing loads of functions around individually * that are necessary to start a probe command. */ typedef struct command_func { char *command; size_t len; void *(*allocdata)(char *); scamper_task_t *(*alloctask)(void *, scamper_list_t *, scamper_cycle_t *); void (*freedata)(void *data); } command_func_t; static const command_func_t command_funcs[] = { { "trace", 5, scamper_do_trace_alloc, scamper_do_trace_alloctask, scamper_do_trace_free, }, { "ping", 4, scamper_do_ping_alloc, scamper_do_ping_alloctask, scamper_do_ping_free, }, { "tracelb", 7, scamper_do_tracelb_alloc, scamper_do_tracelb_alloctask, scamper_do_tracelb_free, }, { "dealias", 7, scamper_do_dealias_alloc, scamper_do_dealias_alloctask, scamper_do_dealias_free, }, { "sting", 5, scamper_do_sting_alloc, scamper_do_sting_alloctask, scamper_do_sting_free, }, { "neighbourdisc", 13, scamper_do_neighbourdisc_alloc, scamper_do_neighbourdisc_alloctask, scamper_do_neighbourdisc_free, }, { "tbit", 4, scamper_do_tbit_alloc, scamper_do_tbit_alloctask, scamper_do_tbit_free, }, { "sniff", 5, scamper_do_sniff_alloc, scamper_do_sniff_alloctask, scamper_do_sniff_free, }, }; static size_t command_funcc = sizeof(command_funcs) / sizeof(command_func_t); /* * command * * type: COMMAND_PROBE or COMMAND_CYCLE or COMMAND_TASK * funcs: pointer to appropriate command_func_t * data: pointer to data allocated for task * param: additional parameters specific to the command's type. */ typedef struct command { uint8_t type; union { struct command_probe { const command_func_t *funcs; void *data; scamper_cyclemon_t *cyclemon; } pr; scamper_cycle_t *cycle; scamper_sourcetask_t *sourcetask; } un; } command_t; #define COMMAND_PROBE 0x00 #define COMMAND_CYCLE 0x01 #define COMMAND_TASK 0x02 #define COMMAND_TYPE_MIN 0x00 #define COMMAND_TYPE_MAX 0x02 /* * command_onhold * * structure to keep details of a command on hold. * * st: the task that is waiting on another task to complete * block: the task that has blocked this task from executing * source: pointer to the source that wants to execute the command * node: pointer to the dlist_node in the source's onhold dlist * cookie: cookie returned by scamper_task_onhold. */ typedef struct command_onhold { scamper_task_t *block; scamper_sourcetask_t *st; scamper_source_t *source; dlist_node_t *node; void *cookie; } command_onhold_t; /* * global variables for managing sources: * * a source is stored in one of two lists depending on its state. it is * either stored in the active list, a round-robin circular list, or in * the blocked list. * * the source, if any, currently being used (that is, has not used up its * priority quantum) is pointed to by source_cur. the number of tasks that * have been read from the current source in this rotation is held in * source_cnt. * * the sources are stored in a tree that is searchable by name. */ static clist_t *active = NULL; static dlist_t *blocked = NULL; static dlist_t *finished = NULL; static scamper_source_t *source_cur = NULL; static uint32_t source_cnt = 0; static splaytree_t *source_tree = NULL; static dlist_t *observers = NULL; /* forward declare */ static void source_free(scamper_source_t *source); #if !defined(NDEBUG) && defined(SOURCES_DEBUG) static int command_assert(void *item, void *param) { command_t *c = item; int *cycles = param; assert(c->type <= COMMAND_TYPE_MAX); switch(c->type) { case COMMAND_PROBE: assert(c->un.pr.data != NULL); assert(c->un.pr.cyclemon != NULL); break; case COMMAND_TASK: assert(c->un.sourcetask != NULL); break; case COMMAND_CYCLE: *cycles = *cycles + 1; break; } return 0; } static int source_assert(void *item, void *param) { scamper_source_t *s = item; command_onhold_t *c; dlist_node_t *dn; int cycles; /* check the source for valid refcnts */ assert(s->refcnt > 0); if(s->list != NULL) assert(s->list->refcnt > 0); if(s->cycle != NULL) assert(s->cycle->refcnt > 0); if(s->sof != NULL) assert(scamper_outfile_getrefcnt(s->sof) > 0); /* simple checks on parameters in the source struct */ assert(s->type >= SCAMPER_SOURCE_TYPE_MIN); assert(s->type <= SCAMPER_SOURCE_TYPE_MAX); assert(s->tasks != NULL); /* make sure the list pointer makes sense */ assert(s->list_ != NULL); assert(s->list_ == active || s->list_ == blocked || s->list_ == finished); assert(s->list_ == param); /* sanity check queued commands */ assert(s->commands != NULL); cycles = 0; dlist_foreach(s->commands, command_assert, &cycles); /* XXX: should cycles == s->cycle_points? */ /* make sure the onhold list makes sense */ assert(s->onhold != NULL); for(dn=dlist_head_node(s->onhold); dn != NULL; dn = dlist_node_next(dn)) { c = dlist_node_item(dn); assert(c->node == dn); assert(c->source == s); } return 0; } static void sources_assert(void) { assert(active != NULL); clist_foreach(active, source_assert, active); assert(blocked != NULL); dlist_foreach(blocked, source_assert, blocked); assert(finished != NULL); dlist_foreach(finished, source_assert, finished); return; } #else #define sources_assert()((void)0) #endif static int source_refcnt_dec(scamper_source_t *source) { assert(source->refcnt > 0); source->refcnt--; return source->refcnt; } /* * source_event_post_cb * * callback used by source_event_post to send an event to all the observers * in the observers list */ static int source_event_post_cb(void *item, void *param) { scamper_source_observer_t *observer = (scamper_source_observer_t *)item; scamper_source_event_t *event = (scamper_source_event_t *)param; observer->func(event, observer->param); return 0; } /* * scamper_source_event_post * * send all observers notification that a particular event occured. */ void scamper_source_event_post(scamper_source_t *source, int type, scamper_source_event_t *ev) { scamper_source_event_t sse; struct timeval tv; /* check if there is actually anyone observing */ if(observers == NULL) return; /* if null event, then create one from scratch */ if(ev == NULL) { memset(&sse, 0, sizeof(sse)); ev = &sse; } gettimeofday_wrap(&tv); ev->source = source; ev->event = type; ev->sec = tv.tv_sec; dlist_foreach(observers, source_event_post_cb, ev); return; } static scamper_sourcetask_t *sourcetask_alloc(scamper_source_t *source, scamper_task_t *task) { scamper_sourcetask_t *st = NULL; if((st = malloc_zero(sizeof(scamper_sourcetask_t))) == NULL) goto err; if((st->node = dlist_tail_push(source->tasks, st)) == NULL) goto err; st->source = scamper_source_use(source); st->task = task; return st; err: if(st != NULL) free(st); return NULL; } static int idtree_cmp(const scamper_sourcetask_t *a, const scamper_sourcetask_t *b) { if(a->id < b->id) return -1; if(a->id > b->id) return 1; return 0; } static command_t *command_alloc(int type) { command_t *cmd; if((cmd = malloc_zero(sizeof(command_t))) == NULL) { printerror(__func__, "could not malloc command"); return NULL; } cmd->type = type; return cmd; } static void command_free(command_t *command) { if(command->type == COMMAND_PROBE) { if(command->un.pr.funcs->freedata != NULL && command->un.pr.data != NULL) command->un.pr.funcs->freedata(command->un.pr.data); if(command->un.pr.cyclemon != NULL) scamper_cyclemon_unuse(command->un.pr.cyclemon); } free(command); return; } /* * command_cycle * * given the commands list, append a cycle command to it. */ static int command_cycle(scamper_source_t *source, scamper_cycle_t *cycle) { command_t *command = NULL; if((command = command_alloc(COMMAND_CYCLE)) == NULL) goto err; command->un.cycle = cycle; if(dlist_tail_push(source->commands, command) == NULL) goto err; source->cycle_points++; return 0; err: if(command != NULL) command_free(command); return -1; } /* * source_next * * advance to the next source to read addresses from, and reset the * current count of how many addresses have been returned off the list * for this source-cycle */ static scamper_source_t *source_next(void) { void *node; if((node = clist_node_next(source_cur->list_node)) != source_cur->list_node) source_cur = clist_node_item(node); source_cnt = 0; return source_cur; } /* * source_active_detach * * detach the source out of the active list. move to the next source * if it is the current source that is being read from. */ static void source_active_detach(scamper_source_t *source) { void *node; assert(source->list_ == active); source_cur = NULL; source_cnt = 0; if(source->list_node != NULL) { if((node = clist_node_next(source->list_node)) != source->list_node) source_cur = clist_node_item(node); clist_node_pop(active, source->list_node); } source->list_ = NULL; source->list_node = NULL; return; } /* * source_blocked_detach * * detach the source out of the blocked list. */ static void source_blocked_detach(scamper_source_t *source) { assert(source->list_ == blocked); dlist_node_pop(blocked, source->list_node); source->list_ = NULL; source->list_node = NULL; return; } /* * source_finished_detach * * detach the source out of the finished list. */ static void source_finished_detach(scamper_source_t *source) { assert(source->list_ == finished); dlist_node_pop(finished, source->list_node); source->list_ = NULL; source->list_node = NULL; return; } /* * source_active_attach * * some condition has changed, which may mean the source can go back onto * the active list for use by the probing process. * * a caller MUST NOT assume that the source will necessarily end up on the * active list after calling this function. for example, source_active_attach * may be called when new tasks are added to the command list. however, the * source may have a zero priority, which means probing this source is * currently paused. */ static int source_active_attach(scamper_source_t *source) { if(source->list_ == active) return 0; if(source->list_ == finished) return -1; if(source->list_ == blocked) { /* if the source has a zero priority, it must remain blocked */ if(source->priority == 0) return 0; source_blocked_detach(source); } if((source->list_node = clist_tail_push(active, source)) == NULL) return -1; source->list_ = active; if(source_cur == NULL) { source_cur = source; source_cnt = 0; } return 0; } /* * source_blocked_attach * * put the specified source onto the blocked list. */ static int source_blocked_attach(scamper_source_t *source) { if(source->list_ == blocked) return 0; if(source->list_ == finished) return -1; if(source->list_node != NULL) source_active_detach(source); if((source->list_node = dlist_tail_push(blocked, source)) == NULL) return -1; source->list_ = blocked; return 0; } /* * source_finished_attach * * put the specified source onto the finished list. */ static int source_finished_attach(scamper_source_t *source) { if(source->list_ == finished) return 0; if(source->list_ == active) source_active_detach(source); else if(source->list_ == blocked) source_blocked_detach(source); if((source->list_node = dlist_tail_push(finished, source)) == NULL) return -1; source->list_ = finished; return 0; } /* * source_command_unhold * * the task this command was blocked on has now completed, and this callback * was used. put the command at the front of the source's list of things * to do. */ static void source_command_unhold(void *cookie) { command_onhold_t *onhold = (command_onhold_t *)cookie; scamper_source_t *source = onhold->source; scamper_sourcetask_t *st = onhold->st; command_t *cmd = NULL; /* * 1. disconnect the onhold structure from the source * 2. free the onhold structure -- don't need it anymore * 3. put the task at the front of the source's command list * 4. ensure the source is in active rotation */ dlist_node_pop(source->onhold, onhold->node); free(onhold); if((cmd = command_alloc(COMMAND_TASK)) == NULL) goto err; cmd->un.sourcetask = st; st = NULL; if(dlist_head_push(source->commands, cmd) == NULL) goto err; source_active_attach(source); return; err: if(st != NULL) scamper_sourcetask_free(st); if(cmd != NULL) free(cmd); return; } /* * source_command_onhold * * */ static int source_command_onhold(scamper_source_t *source, scamper_task_t *block, scamper_sourcetask_t *st) { command_onhold_t *onhold = NULL; if((onhold = malloc_zero(sizeof(command_onhold_t))) == NULL || (onhold->node = dlist_tail_push(source->onhold, onhold)) == NULL || (onhold->cookie = scamper_task_onhold(block, onhold, source_command_unhold)) == NULL) { goto err; } onhold->block = block; onhold->source = source; onhold->st = st; return 0; err: if(onhold != NULL) { if(onhold->node != NULL) dlist_node_pop(source->onhold, onhold->node); free(onhold); } return -1; } /* * source_task_install * * code to install a task if possible and put it onhold if not. * */ static int source_task_install(scamper_source_t *source, scamper_sourcetask_t *st, scamper_task_t **out) { scamper_task_t *task = st->task; scamper_task_t *block; if((block = scamper_task_sig_block(task)) == NULL) { if(scamper_task_sig_install(task) != 0) return -1; *out = task; } else { if(source_command_onhold(source, block, st) != 0) return -1; *out = NULL; } return 0; } static int command_task_handle(scamper_source_t *source, command_t *command, scamper_task_t **task_out) { scamper_sourcetask_t *st = command->un.sourcetask; command_free(command); return source_task_install(source, st, task_out); } static int command_probe_handle(scamper_source_t *source, command_t *command, scamper_task_t **task_out) { const command_func_t *funcs = command->un.pr.funcs; scamper_sourcetask_t *st = NULL; scamper_cycle_t *cycle; scamper_task_t *task = NULL; sources_assert(); /* get a pointer to the cycle for *this* task */ cycle = scamper_cyclemon_cycle(command->un.pr.cyclemon); /* allocate the task structure to keep everything together */ if((task = funcs->alloctask(command->un.pr.data,source->list,cycle)) == NULL) goto err; scamper_task_setcyclemon(task, command->un.pr.cyclemon); command->un.pr.data = NULL; command_free(command); command = NULL; /* * keep a record in the source that this task is now active * pass the cyclemon structure to the task */ if((st = sourcetask_alloc(source, task)) == NULL) goto err; task = NULL; scamper_task_setsourcetask(st->task, st); if(source_task_install(source, st, task_out) != 0) goto err; sources_assert(); return 0; err: if(st != NULL) scamper_sourcetask_free(st); if(task != NULL) scamper_task_free(task); if(command != NULL) command_free(command); sources_assert(); return -1; } /* * command_cycle_handle * * */ static int command_cycle_handle(scamper_source_t *source, command_t *command) { scamper_source_event_t sse; scamper_cycle_t *cycle = command->un.cycle; scamper_file_t *file; struct timeval tv; char hostname[MAXHOSTNAMELEN]; sources_assert(); /* get the hostname of the system for the cycle point */ if(gethostname(hostname, sizeof(hostname)) == 0) cycle->hostname = strdup(hostname); /* get a timestamp for the cycle start point */ gettimeofday_wrap(&tv); cycle->start_time = (uint32_t)tv.tv_sec; /* write a cycle start point to disk if there is a file to do so */ if(source->sof != NULL && (file = scamper_outfile_getfile(source->sof)) != NULL) { scamper_file_write_cycle_start(file, cycle); } /* post an event saying the cycle point just rolled around */ memset(&sse, 0, sizeof(sse)); sse.sse_cycle_cycle_id = cycle->id; scamper_source_event_post(source, SCAMPER_SOURCE_EVENT_CYCLE, &sse); command_free(command); sources_assert(); return 0; } /* * source_cycle_finish * * when the last cycle is written to disk, we can start on the next cycle. */ static void source_cycle_finish(scamper_cycle_t *cycle, scamper_source_t *source, scamper_outfile_t *outfile) { scamper_file_t *sf; struct timeval tv; sources_assert(); /* timestamp when the cycle ends */ gettimeofday_wrap(&tv); cycle->stop_time = (uint32_t)tv.tv_sec; /* write the cycle stop record out */ if(outfile != NULL) { sf = scamper_outfile_getfile(outfile); scamper_file_write_cycle_stop(sf, cycle); } if(source != NULL) source->cycle_points--; sources_assert(); return; } /* * source_cycle * * allocate and initialise a cycle start object for the source. * write the cycle start to disk. */ static int source_cycle(scamper_source_t *source, uint32_t cycle_id) { scamper_cyclemon_t *cyclemon = NULL; scamper_cycle_t *cycle = NULL; sources_assert(); /* allocate the new cycle object */ if((cycle = scamper_cycle_alloc(source->list)) == NULL) { printerror(__func__, "could not alloc new cycle"); goto err; } /* assign the cycle id */ cycle->id = cycle_id; /* allocate structure to monitor references to the new cycle */ if((cyclemon = scamper_cyclemon_alloc(cycle, source_cycle_finish, source, source->sof)) == NULL) { printerror(__func__, "could not alloc new cyclemon"); goto err; } /* append the cycle record to the source's commands list */ if(command_cycle(source, cycle) != 0) { printerror(__func__, "could not insert cycle marker"); goto err; } /* * if there is a previous cycle object associated with the source, then * free that. also free the cyclemon. */ if(source->cycle != NULL) scamper_cycle_free(source->cycle); if(source->cyclemon != NULL) scamper_cyclemon_unuse(source->cyclemon); /* store the cycle and we're done */ source->cycle = cycle; source->cyclemon = cyclemon; sources_assert(); return 0; err: if(cyclemon != NULL) scamper_cyclemon_free(cyclemon); if(cycle != NULL) scamper_cycle_free(cycle); sources_assert(); return -1; } static int source_cmp(const scamper_source_t *a, const scamper_source_t *b) { return strcasecmp(b->list->name, a->list->name); } /* * source_flush_commands * * remove the ability for the source to supply any more commands, and remove * any commands it currently has queued. */ static void source_flush_commands(scamper_source_t *source) { command_onhold_t *onhold; command_t *command; sources_assert(); if(source->data != NULL) source->freedata(source->data); source->data = NULL; source->take = NULL; source->freedata = NULL; source->isfinished = NULL; source->tostr = NULL; if(source->commands != NULL) { while((command = dlist_head_pop(source->commands)) != NULL) command_free(command); dlist_free(source->commands); source->commands = NULL; } if(source->onhold != NULL) { while((onhold = dlist_head_pop(source->onhold)) != NULL) { scamper_task_dehold(onhold->block, onhold->cookie); free(onhold); } dlist_free(source->onhold); source->onhold = NULL; } sources_assert(); return; } /* * source_flush_tasks * * stop all active tasks that originated from the specified source. */ static void source_flush_tasks(scamper_source_t *source) { scamper_sourcetask_t *st; sources_assert(); /* flush all active tasks. XXX: what about completed tasks? */ if(source->tasks != NULL) { /* scamper_task_free will free scamper_sourcetask_t */ while((st = dlist_head_pop(source->tasks)) != NULL) { st->node = NULL; scamper_task_free(st->task); } dlist_free(source->tasks); source->tasks = NULL; } sources_assert(); return; } /* * source_detach * * remove the source from sources management. */ static void source_detach(scamper_source_t *source) { /* detach the source from whatever list it is in */ if(source->list_ == active) source_active_detach(source); else if(source->list_ == blocked) source_blocked_detach(source); else if(source->list_ == finished) source_finished_detach(source); assert(source->list_ == NULL); assert(source->list_node == NULL); /* remove the source from the tree */ if(source->tree_node != NULL) { splaytree_remove_node(source_tree, source->tree_node); source->tree_node = NULL; /* decrement the reference count held for the source */ if(source_refcnt_dec(source) == 0) source_free(source); } return; } /* * scamper_source_isfinished * * determine if the source has queued all it has to do. * note that the tasks list may still have active items currently processing. */ int scamper_source_isfinished(scamper_source_t *source) { sources_assert(); /* if there are commands queued, then the source cannot be finished */ if(source->commands != NULL && dlist_count(source->commands) > 0) return 0; /* if there are commands that are on hold, the source cannot be finished */ if(source->onhold != NULL && dlist_count(source->onhold) > 0) return 0; /* if there are still tasks underway, the source is not finished */ if(source->tasks != NULL && dlist_count(source->tasks) > 0) return 0; /* * if the source still has commands to come, then it is not finished. * the callback checks with the source-type specific code to see if there * are commands to come. */ if(source->isfinished != NULL && source->isfinished(source->data) == 0) return 0; return 1; } /* * scamper_source_finished * * when a source is known to be finished (say a control socket that will no * longer be supplying tasks) */ void scamper_source_finished(scamper_source_t *source) { sources_assert(); assert(scamper_source_isfinished(source) != 0); if(source->cyclemon != NULL) { assert(scamper_cyclemon_refcnt(source->cyclemon) == 1); scamper_cyclemon_unuse(source->cyclemon); source->cyclemon = NULL; } source_finished_attach(source); sources_assert(); return; } /* * source_free * * clean up the source */ static void source_free(scamper_source_t *source) { char buf[512]; assert(source != NULL); assert(source->refcnt == 0); if(scamper_source_tostr(source, buf, sizeof(buf)) != NULL) scamper_debug(__func__, "%s", buf); /* the source is now finished. post a message saying so */ scamper_source_event_post(source, SCAMPER_SOURCE_EVENT_FINISH, NULL); if(source->cyclemon != NULL) { scamper_cyclemon_source_detach(source->cyclemon); scamper_cyclemon_unuse(source->cyclemon); source->cyclemon = NULL; } /* pull the source out of sources management */ source_detach(source); /* empty the source of commands */ if(source->commands != NULL) source_flush_commands(source); /* empty the source of tasks */ if(source->tasks != NULL) source_flush_tasks(source); /* don't need the idtree any more */ if(source->idtree != NULL) { assert(splaytree_count(source->idtree) == 0); splaytree_free(source->idtree, NULL); } /* release this structure's hold on the scamper_outfile */ if(source->sof != NULL) scamper_outfile_free(source->sof); if(source->list != NULL) scamper_list_free(source->list); if(source->cycle != NULL) scamper_cycle_free(source->cycle); free(source); sources_assert(); return; } /* * scamper_source_getname * * return the name of the source */ const char *scamper_source_getname(const scamper_source_t *source) { if(source->list == NULL) return NULL; return source->list->name; } /* * scamper_source_getdescr * * return the description for the source */ const char *scamper_source_getdescr(const scamper_source_t *source) { if(source->list == NULL) return NULL; return source->list->descr; } /* * scamper_source_getoutfile * * return the name of the outfile associated with the source */ const char *scamper_source_getoutfile(const scamper_source_t *source) { return scamper_outfile_getname(source->sof); } /* * scamper_source_getlistid * * return the list id for the source */ uint32_t scamper_source_getlistid(const scamper_source_t *source) { return source->list->id; } /* * scamper_source_getcycleid * * return the cycle id for the source */ uint32_t scamper_source_getcycleid(const scamper_source_t *source) { return source->cycle->id; } /* * scamper_source_getpriority * * return the priority value for the source */ uint32_t scamper_source_getpriority(const scamper_source_t *source) { return source->priority; } void scamper_source_setpriority(scamper_source_t *source, uint32_t priority) { scamper_source_event_t sse; uint32_t old_priority; sources_assert(); old_priority = source->priority; source->priority = priority; if(priority == 0 && old_priority > 0) source_blocked_attach(source); else if(priority > 0 && old_priority == 0) source_active_attach(source); memset(&sse, 0, sizeof(sse)); sse.sse_update_flags |= 0x04; sse.sse_update_priority = priority; scamper_source_event_post(source, SCAMPER_SOURCE_EVENT_UPDATE, &sse); sources_assert(); return; } const char *scamper_source_type_tostr(const scamper_source_t *source) { switch(source->type) { case SCAMPER_SOURCE_TYPE_FILE: return "file"; case SCAMPER_SOURCE_TYPE_CMDLINE: return "cmdline"; case SCAMPER_SOURCE_TYPE_CONTROL: return "control"; case SCAMPER_SOURCE_TYPE_TSPS: return "tsps"; } return NULL; } char *scamper_source_tostr(const scamper_source_t *src, char *buf, size_t len) { char tmp[512]; size_t off = 0; if(src->list == NULL || src->list->name == NULL) return NULL; string_concat(buf, len, &off, "name %s", src->list->name); if(src->tostr != NULL && src->tostr(src->data, tmp, sizeof(tmp)) != NULL) string_concat(buf, len, &off, " %s", tmp); return buf; } /* * scamper_source_getcommandcount * * return the number of commands queued for the source */ int scamper_source_getcommandcount(const scamper_source_t *source) { if(source->commands != NULL) return dlist_count(source->commands); return -1; } int scamper_source_getcyclecount(const scamper_source_t *source) { return source->cycle_points; } int scamper_source_gettaskcount(const scamper_source_t *source) { if(source->tasks != NULL) return dlist_count(source->tasks); return -1; } int scamper_source_gettype(const scamper_source_t *source) { return source->type; } void *scamper_source_getdata(const scamper_source_t *source) { return source->data; } static const command_func_t *command_func_get(const char *command) { const command_func_t *func = NULL; size_t i; for(i=0; icommand, func->len) == 0 && isspace((int)command[func->len]) && command[func->len] != '\0') { return func; } } return NULL; } /* * command_func_allocdata: * * make a copy of the options, since the next function may modify the * contents of it */ static void *command_func_allocdata(const command_func_t *f, const char *cmd) { char *opts = NULL; void *data; if((opts = strdup(cmd + f->len)) == NULL) { printerror(__func__, "could not strdup cmd opts"); return NULL; } data = f->allocdata(opts); free(opts); return data; } int scamper_source_halttask(scamper_source_t *source, uint32_t id) { scamper_sourcetask_t *st, fm; command_t *cmd; dlist_node_t *no; sources_assert(); fm.id = id; if(source->idtree == NULL) return -1; if((st = splaytree_find(source->idtree, &fm)) == NULL) return -1; scamper_task_halt(st->task); for(no=dlist_head_node(source->commands); no != NULL; no=dlist_node_next(no)) { cmd = dlist_node_item(no); if(cmd->type == COMMAND_TASK && cmd->un.sourcetask == st) { cmd = dlist_node_pop(source->commands, no); command_free(cmd); break; } } sources_assert(); return 0; } /* * scamper_source_command2 * * the given command is created as a task immediately and assigned an id * which allows the command to be halted. used by the control socket code. */ int scamper_source_command2(scamper_source_t *s, const char *command, uint32_t *id) { const command_func_t *f = NULL; scamper_sourcetask_t *st = NULL; scamper_task_t *task = NULL; command_t *cmd = NULL; void *data = NULL; sources_assert(); if(s->idtree == NULL && (s->idtree = splaytree_alloc((splaytree_cmp_t)idtree_cmp)) == NULL) { printerror(__func__, "could not alloc idtree"); goto err; } if((f = command_func_get(command)) == NULL) { scamper_debug(__func__, "could not determine command type"); goto err; } if((data = command_func_allocdata(f, command)) == NULL) goto err; if((task = f->alloctask(data, s->list, s->cycle)) == NULL) goto err; data = NULL; /* * keep a record in the source that this task is now active * pass the cyclemon structure to the task */ if((st = sourcetask_alloc(s, task)) == NULL) goto err; scamper_task_setsourcetask(task, st); scamper_task_setcyclemon(task, s->cyclemon); task = NULL; /* assign an id. assume for now this will be enough to ensure uniqueness */ st->id = *id = s->id; if(++s->id == 0) s->id = 1; if((st->idnode = splaytree_insert(s->idtree, st)) == NULL) { printerror(__func__, "could not add to idtree"); goto err; } if((cmd = command_alloc(COMMAND_TASK)) == NULL) goto err; cmd->un.sourcetask = st; if(dlist_tail_push(s->commands, cmd) == NULL) { printerror(__func__, "could not add to commands list"); goto err; } source_active_attach(s); sources_assert(); return 0; err: /* XXX free scamper_sourcetask_t ?? */ if(data != NULL) f->freedata(data); if(cmd != NULL) command_free(cmd); sources_assert(); return -1; } /* * scamper_source_command * */ int scamper_source_command(scamper_source_t *source, const char *command) { const command_func_t *func = NULL; command_t *cmd = NULL; char *opts = NULL; void *data = NULL; sources_assert(); if((func = command_func_get(command)) == NULL) goto err; if((data = command_func_allocdata(func, command)) == NULL) goto err; if((cmd = command_alloc(COMMAND_PROBE)) == NULL) goto err; cmd->un.pr.funcs = func; cmd->un.pr.data = data; cmd->un.pr.cyclemon = scamper_cyclemon_use(source->cyclemon); if(dlist_tail_push(source->commands, cmd) == NULL) goto err; source_active_attach(source); sources_assert(); return 0; err: if(opts != NULL) free(opts); if(data != NULL) func->freedata(data); if(cmd != NULL) free(cmd); sources_assert(); return -1; } /* * scamper_source_cycle * * externally visible function to mark a new cycle point; the new cycle * id is one greater than the currently active cycle. */ int scamper_source_cycle(scamper_source_t *source) { return source_cycle(source, source->cycle->id + 1); } scamper_source_t *scamper_sourcetask_getsource(scamper_sourcetask_t *st) { return st->source; } /* * scamper_sourcetask_free * * when a task completes, this function is called. it allows the source * to keep track of which tasks came from it. */ void scamper_sourcetask_free(scamper_sourcetask_t *st) { scamper_source_t *source = st->source; sources_assert(); if(st->node != NULL) dlist_node_pop(source->tasks, st->node); if(st->idnode != NULL) splaytree_remove_node(source->idtree, st->idnode); scamper_source_free(st->source); free(st); if(scamper_source_isfinished(source) != 0) { if(source->cyclemon != NULL) { assert(scamper_cyclemon_refcnt(source->cyclemon) == 1); scamper_cyclemon_unuse(source->cyclemon); source->cyclemon = NULL; } source_detach(source); } sources_assert(); return; } /* * scamper_source_use * */ scamper_source_t *scamper_source_use(scamper_source_t *source) { sources_assert(); source->refcnt++; return source; } /* * scamper_source_abandon * */ void scamper_source_abandon(scamper_source_t *source) { sources_assert(); source_flush_tasks(source); source_flush_commands(source); source_detach(source); sources_assert(); return; } /* * scamper_source_free * * the caller is giving up their reference to the source. make a note * of that. when the reference count reaches zero and the source is * finished, free it. */ void scamper_source_free(scamper_source_t *source) { sources_assert(); /* * if there are still references held to the source, or the source is not * finished yet, then we don't have to go further. */ if(source_refcnt_dec(source) != 0) return; source_free(source); sources_assert(); return; } /* * scamper_source_alloc * * create a new source based on the parameters supplied. the source is * not put into rotation -- the caller has to call scamper_sources_add * for that to occur. */ scamper_source_t *scamper_source_alloc(const scamper_source_params_t *ssp) { scamper_source_t *source = NULL; /* make sure the caller passes some details of the source to be created */ if(ssp == NULL || ssp->name == NULL) { scamper_debug(__func__, "missing necessary parameters"); goto err; } if((source = malloc_zero(sizeof(scamper_source_t))) == NULL) { printerror(__func__, "could not malloc source"); goto err; } source->refcnt = 1; /* data parameter and associated callbacks */ source->data = ssp->data; source->take = ssp->take; source->freedata = ssp->freedata; source->isfinished = ssp->isfinished; source->tostr = ssp->tostr; if((source->list = scamper_list_alloc(ssp->list_id, ssp->name, ssp->descr, scamper_monitorname_get())) == NULL) { printerror(__func__, "could not alloc source->list"); goto err; } if((source->commands = dlist_alloc()) == NULL) { printerror(__func__, "could not alloc source->commands"); goto err; } if((source->onhold = dlist_alloc()) == NULL) { printerror(__func__, "could not alloc source->onhold"); goto err; } if((source->tasks = dlist_alloc()) == NULL) { printerror(__func__, "could not alloc source->tasks"); goto err; } source->sof = scamper_outfile_use(ssp->sof); if(source_cycle(source, ssp->cycle_id) != 0) { goto err; } source->type = ssp->type; source->priority = ssp->priority; source->id = 1; return source; err: if(source != NULL) { if(source->list != NULL) scamper_list_free(source->list); if(source->cycle != NULL) scamper_cycle_free(source->cycle); if(source->commands != NULL) dlist_free(source->commands); if(source->onhold != NULL) dlist_free(source->onhold); if(source->tasks != NULL) dlist_free(source->tasks); free(source); } return NULL; } /* * scamper_sources_observe * * something wants to monitor the status of the sources managed by scamper. * make a note of that. */ scamper_source_observer_t *scamper_sources_observe(scamper_source_eventf_t cb, void *param) { scamper_source_observer_t *observer = NULL; if((observers == NULL && (observers = dlist_alloc()) == NULL) || (observer = malloc_zero(sizeof(scamper_source_observer_t))) == NULL || (observer->node = dlist_tail_push(observers, observer)) == NULL) { goto err; } observer->func = cb; observer->param = param; return observer; err: if(observer != NULL) scamper_sources_unobserve(observer); return NULL; } /* * scamper_sources_unobserve * */ void scamper_sources_unobserve(scamper_source_observer_t *observer) { dlist_node_pop(observers, observer->node); free(observer); if(dlist_count(observers) == 0) { dlist_free(observers); observers = NULL; } return; } /* * scamper_sources_get * * given a name, return the matching source -- if one exists. */ scamper_source_t *scamper_sources_get(char *name) { scamper_source_t findme; scamper_list_t list; list.name = name; findme.list = &list; return (scamper_source_t *)splaytree_find(source_tree, &findme); } /* * scamper_sources_del * * given a source, remove it entirely. to do so, existing tasks must be * halted, the source must be flushed of on-hold tasks and commands, * and it must be removed from the data structures that link the source * to the main scamper loop. */ int scamper_sources_del(scamper_source_t *source) { sources_assert(); source_flush_tasks(source); source_flush_commands(source); source_detach(source); /* if there are external references to the source, then don't free it */ if(source->refcnt > 1) { return -1; } scamper_source_event_post(source, SCAMPER_SOURCE_EVENT_DELETE, NULL); source_free(source); sources_assert(); return 0; } /* * scamper_sources_isempty * * return to the caller if it is likely that the sources have more tasks * to return */ int scamper_sources_isempty() { sources_assert(); /* * if there are either active or blocked address list sources, the list * can't be empty */ if((active != NULL && clist_count(active) > 0) || (blocked != NULL && dlist_count(blocked) > 0) || (finished != NULL && dlist_count(finished) > 0)) { return 0; } return 1; } /* * scamper_sources_isready * * return to the caller if a source is ready to return a new task. */ int scamper_sources_isready(void) { sources_assert(); if(source_cur != NULL || dlist_count(finished) > 0) { return 1; } return 0; } /* * scamper_sources_empty * * flush all sources of commands; disconnect all sources. */ void scamper_sources_empty() { scamper_source_t *source; sources_assert(); /* * for each source, go through and empty the lists, close the files, and * leave the list of sources available to read from empty. */ while((source = dlist_tail_item(blocked)) != NULL) { source_flush_commands(source); source_detach(source); } while((source = clist_tail_item(active)) != NULL) { source_flush_commands(source); source_detach(source); } while((source = dlist_head_item(finished)) != NULL) { source_detach(source); } sources_assert(); return; } /* * scamper_sources_foreach * * externally accessible function for iterating over the collection of sources * held by scamper. */ void scamper_sources_foreach(void *p, int (*func)(void *, scamper_source_t *)) { splaytree_inorder(source_tree, (splaytree_inorder_t)func, p); return; } /* * scamper_sources_gettask * * pick off the next task ready to be probed. */ int scamper_sources_gettask(scamper_task_t **task) { scamper_source_t *source; command_t *command; sources_assert(); while((source = dlist_head_item(finished)) != NULL) source_detach(source); /* * if the priority of the source was changed in between calls to this * function, then make sure the source's priority hasn't been lowered to * below how many tasks it has had allocated in this cycle */ if(source_cur != NULL && source_cnt >= source_cur->priority) source_next(); while((source = source_cur) != NULL) { assert(source->priority > 0); while((command = dlist_head_pop(source->commands)) != NULL) { if(source->take != NULL) source->take(source->data); switch(command->type) { case COMMAND_PROBE: if(command_probe_handle(source, command, task) != 0) goto err; if(*task == NULL) continue; source_cnt++; goto done; case COMMAND_TASK: if(command_task_handle(source, command, task) != 0) goto err; if(*task == NULL) continue; source_cnt++; goto done; case COMMAND_CYCLE: command_cycle_handle(source, command); break; default: goto err; } } /* the previous source could not supply a command */ assert(dlist_count(source->commands) == 0); /* * if the source is not yet finished, put it on the blocked list; * otherwise, the source is detached. */ if(scamper_source_isfinished(source) == 0) source_blocked_attach(source); else source_detach(source); } *task = NULL; done: sources_assert(); return 0; err: sources_assert(); return -1; } /* * scamper_sources_add * * add a new source into rotation; put it into the active list for now. */ int scamper_sources_add(scamper_source_t *source) { char buf[512]; assert(source != NULL); sources_assert(); if(scamper_source_tostr(source, buf, sizeof(buf)) != NULL) scamper_debug(__func__, "%s", buf); /* a reference count is used when the source is in the tree */ if((source->tree_node = splaytree_insert(source_tree, source)) == NULL) goto err; scamper_source_use(source); /* put the source in the active queue */ if(source_active_attach(source) != 0) goto err; scamper_source_event_post(source, SCAMPER_SOURCE_EVENT_ADD, NULL); sources_assert(); return 0; err: sources_assert(); return -1; } /* * scamper_sources_init * * */ int scamper_sources_init(void) { if((active = clist_alloc()) == NULL) return -1; if((blocked = dlist_alloc()) == NULL) return -1; if((finished = dlist_alloc()) == NULL) return -1; if((source_tree = splaytree_alloc((splaytree_cmp_t)source_cmp)) == NULL) return -1; return 0; } /* * scamper_sources_cleanup * * */ void scamper_sources_cleanup(void) { int f, b, a; f = finished != NULL ? dlist_count(finished) : 0; b = blocked != NULL ? dlist_count(blocked) : 0; a = active != NULL ? clist_count(active) : 0; if(f != 0 || b != 0 || a != 0) scamper_debug(__func__, "finished %d, blocked %d, active %d", f, b, a); if(source_tree != NULL) { splaytree_free(source_tree, NULL); source_tree = NULL; } if(blocked != NULL) { dlist_free(blocked); blocked = NULL; } if(active != NULL) { clist_free(active); active = NULL; } if(finished != NULL) { dlist_free(finished); finished = NULL; } return; } scamper-cvs-20171204/scamper/scamper_sources.h000644 001751 000000 00000015173 11651654601 021127 0ustar00mjlwheel000000 000000 /* * scamper_source * * $Id: scamper_sources.h,v 1.14 2011/10/26 00:51:13 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_SOURCE_H #define __SCAMPER_SOURCE_H typedef struct scamper_source scamper_source_t; #define SCAMPER_SOURCE_TYPE_FILE 1 #define SCAMPER_SOURCE_TYPE_CMDLINE 2 #define SCAMPER_SOURCE_TYPE_CONTROL 3 #define SCAMPER_SOURCE_TYPE_TSPS 4 #define SCAMPER_SOURCE_TYPE_MIN 1 #define SCAMPER_SOURCE_TYPE_MAX 4 /* a mapping between a task and the source that delivered it */ typedef struct scamper_sourcetask scamper_sourcetask_t; typedef struct scamper_source_params { /* * name: the name of the list being probed. * descr: a description of the addresses that are stored in this source * list_id: the list id number assigned by a human. * cycle_id: the initial cycle id to use. * type: type of the source (file, cmdline, control socket, ...) * priority: the mix priority of this source compared to other sources. * sof: the output file to direct results to. */ char *name; char *descr; uint32_t list_id; uint32_t cycle_id; int type; uint32_t priority; scamper_outfile_t *sof; /* * these parameters are set by the scamper_source_*_alloc function */ void *data; int (*take)(void *data); void (*freedata)(void *data); int (*isfinished)(void *data); char * (*tostr)(void *data, char *str, size_t len); } scamper_source_params_t; /* functions for allocating, referencing, and dereferencing scamper sources */ scamper_source_t *scamper_source_alloc(const scamper_source_params_t *ssp); scamper_source_t *scamper_source_use(scamper_source_t *source); void scamper_source_free(scamper_source_t *source); void scamper_source_abandon(scamper_source_t *source); /* take a finished source and put it in a special place */ void scamper_source_finished(scamper_source_t *source); /* functions for getting various source properties */ const char *scamper_source_getname(const scamper_source_t *source); const char *scamper_source_getdescr(const scamper_source_t *source); const char *scamper_source_getoutfile(const scamper_source_t *source); uint32_t scamper_source_getlistid(const scamper_source_t *source); uint32_t scamper_source_getcycleid(const scamper_source_t *source); int scamper_source_gettype(const scamper_source_t *source); uint32_t scamper_source_getpriority(const scamper_source_t *source); void scamper_source_setpriority(scamper_source_t *source, uint32_t priority); /* functions for getting string representations */ const char *scamper_source_type_tostr(const scamper_source_t *source); char *scamper_source_tostr(const scamper_source_t *source, char *b, size_t l); /* functions for dealing with source-type specific data */ void *scamper_source_getdata(const scamper_source_t *source); void scamper_source_setdata(scamper_source_t *source, void *data); /* functions for getting the number of commands/cycles currently buffered */ int scamper_source_getcommandcount(const scamper_source_t *source); int scamper_source_getcyclecount(const scamper_source_t *source); int scamper_source_gettaskcount(const scamper_source_t *source); /* determine if the source has finished yet */ int scamper_source_isfinished(scamper_source_t *source); /* functions for adding stuff to the source's command queue */ int scamper_source_command(scamper_source_t *source, const char *command); int scamper_source_command2(scamper_source_t *source, const char *command, uint32_t *id); int scamper_source_cycle(scamper_source_t *source); int scamper_source_task(scamper_source_t *source, struct scamper_task *task); int scamper_source_halttask(scamper_source_t *source, uint32_t id); /* function for advising source that an active task has completed */ void scamper_sourcetask_free(scamper_sourcetask_t *st); scamper_source_t *scamper_sourcetask_getsource(scamper_sourcetask_t *st); /* functions for managing a collection of sources */ int scamper_sources_add(scamper_source_t *source); int scamper_sources_gettask(struct scamper_task **task); int scamper_sources_del(scamper_source_t *source); scamper_source_t *scamper_sources_get(char *name); int scamper_sources_isready(void); int scamper_sources_isempty(void); void scamper_sources_foreach(void *p, int (*func)(void *, scamper_source_t *)); void scamper_sources_empty(void); int scamper_sources_init(void); void scamper_sources_cleanup(void); /* * interface to observe source events. * * */ typedef struct scamper_source_event { scamper_source_t *source; time_t sec; int event; #define SCAMPER_SOURCE_EVENT_ADD 0x01 #define SCAMPER_SOURCE_EVENT_UPDATE 0x02 #define SCAMPER_SOURCE_EVENT_CYCLE 0x03 #define SCAMPER_SOURCE_EVENT_DELETE 0x04 #define SCAMPER_SOURCE_EVENT_FINISH 0x05 union { struct sse_update { uint8_t flags; /* 0x01 == autoreload, 0x02 == cycles, 0x03 = priority */ int autoreload; int cycles; int priority; } sseu_update; #define sse_update_flags sse_un.sseu_update.flags #define sse_update_autoreload sse_un.sseu_update.autoreload #define sse_update_cycles sse_un.sseu_update.cycles #define sse_update_priority sse_un.sseu_update.priority struct sse_cycle { int cycle_id; } sseu_cycle; #define sse_cycle_cycle_id sse_un.sseu_cycle.cycle_id } sse_un; } scamper_source_event_t; typedef struct scamper_source_observer scamper_source_observer_t; typedef void (*scamper_source_eventf_t)(const scamper_source_event_t *sse, void *param); scamper_source_observer_t *scamper_sources_observe(scamper_source_eventf_t cb, void *param); void scamper_sources_unobserve(scamper_source_observer_t *observer); void scamper_source_event_post(scamper_source_t *source, int type, scamper_source_event_t *ev); #endif /* __SCAMPER_SOURCE_H */ scamper-cvs-20171204/scamper/scamper_task.c000644 001751 000000 00000052755 13210743023 020376 0ustar00mjlwheel000000 000000 /* * scamper_task.c * * $Id: scamper_task.c,v 1.64 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2015 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_task.c,v 1.64 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_icmp_resp.h" #include "scamper_fds.h" #include "scamper_task.h" #include "scamper_queue.h" #include "scamper_debug.h" #include "scamper_list.h" #include "scamper_cyclemon.h" #include "scamper_outfiles.h" #include "scamper_sources.h" #include "scamper_file.h" #include "scamper_rtsock.h" #include "scamper_dl.h" #include "mjl_list.h" #include "mjl_patricia.h" #include "utils.h" struct scamper_task { /* the data pointer points to the collected data */ void *data; /* any state kept during the data collection is kept here */ void *state; /* state / details kept internally to the task */ dlist_t *onhold; /* various callbacks that scamper uses to handle this task */ scamper_task_funcs_t *funcs; /* pointer to a queue structure that manages this task in the queues */ scamper_queue_t *queue; /* pointer to where the task came from */ scamper_sourcetask_t *sourcetask; /* pointer to cycle monitor structure, if used */ struct scamper_cyclemon *cyclemon; /* signature of probes sent by this task */ slist_t *siglist; /* list of ancillary data */ dlist_t *ancillary; /* file descriptors held by the task */ scamper_fd_t **fds; int fdc; }; struct scamper_task_anc { void *data; void (*freedata)(void *); dlist_node_t *node; }; typedef struct s2t { scamper_task_sig_t *sig; scamper_task_t *task; void *node; } s2t_t; typedef struct task_onhold { void (*unhold)(void *param); void *param; } task_onhold_t; static patricia_t *tx_ip4 = NULL; static patricia_t *tx_ip6 = NULL; static patricia_t *tx_nd4 = NULL; static patricia_t *tx_nd6 = NULL; static dlist_t *sniff = NULL; static int tx_ip_cmp(const s2t_t *a, const s2t_t *b) { assert(a->sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_IP); assert(b->sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_IP); return scamper_addr_cmp(a->sig->sig_tx_ip_dst, b->sig->sig_tx_ip_dst); } static int tx_ip_bit(const s2t_t *s2t, int bit) { assert(s2t->sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_IP); return scamper_addr_bit(s2t->sig->sig_tx_ip_dst, bit); } static int tx_ip_fbd(const s2t_t *a, const s2t_t *b) { assert(a->sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_IP); assert(b->sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_IP); return scamper_addr_fbd(a->sig->sig_tx_ip_dst, b->sig->sig_tx_ip_dst); } static int tx_nd_cmp(const s2t_t *a, const s2t_t *b) { assert(a->sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_ND); assert(b->sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_ND); return scamper_addr_cmp(a->sig->sig_tx_nd_ip, b->sig->sig_tx_nd_ip); } static int tx_nd_bit(const s2t_t *s2t, int bit) { assert(s2t->sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_ND); return scamper_addr_bit(s2t->sig->sig_tx_nd_ip, bit); } static int tx_nd_fbd(const s2t_t *a, const s2t_t *b) { assert(a->sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_ND); assert(b->sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_ND); return scamper_addr_fbd(a->sig->sig_tx_nd_ip, b->sig->sig_tx_nd_ip); } static void tx_ip_check(scamper_dl_rec_t *dl) { scamper_task_sig_t sig; scamper_addr_t addr, addr2buf, *addr2 = NULL; patricia_t *pt; s2t_t fm, *s2t; if(SCAMPER_DL_IS_IPV4(dl)) { addr.type = SCAMPER_ADDR_TYPE_IPV4; pt = tx_ip4; } else if(SCAMPER_DL_IS_IPV6(dl)) { addr.type = SCAMPER_ADDR_TYPE_IPV6; pt = tx_ip6; } else return; if(dl->dl_ip_off != 0) { addr.addr = dl->dl_ip_src; } else if(SCAMPER_DL_IS_TCP(dl)) { if((dl->dl_tcp_flags & TH_SYN) && (dl->dl_tcp_flags & TH_ACK) == 0) addr.addr = dl->dl_ip_dst; else addr.addr = dl->dl_ip_src; } else if(SCAMPER_DL_IS_ICMP(dl)) { if(SCAMPER_DL_IS_ICMP_ECHO_REQUEST(dl)) addr.addr = dl->dl_ip_dst; else if(SCAMPER_DL_IS_ICMP_ECHO_REPLY(dl)) addr.addr = dl->dl_ip_src; else if(SCAMPER_DL_IS_ICMP_TTL_EXP(dl)) addr.addr = dl->dl_icmp_ip_dst; else if(SCAMPER_DL_IS_ICMP_UNREACH(dl)) addr.addr = dl->dl_icmp_ip_dst; else if(SCAMPER_DL_IS_ICMP_PACKET_TOO_BIG(dl)) addr.addr = dl->dl_icmp_ip_dst; else return; } else if(SCAMPER_DL_IS_UDP(dl)) { addr.addr = dl->dl_ip_dst; addr2buf.type = addr.type; addr2buf.addr = dl->dl_ip_src; addr2 = &addr2buf; } else { addr.addr = dl->dl_ip_dst; } fm.sig = &sig; sig.sig_type = SCAMPER_TASK_SIG_TYPE_TX_IP; sig.sig_tx_ip_dst = &addr; if((s2t = patricia_find(pt, &fm)) != NULL && s2t->task->funcs->handle_dl != NULL) { s2t->task->funcs->handle_dl(s2t->task, dl); } else if(addr2 != NULL) { sig.sig_tx_ip_dst = addr2; if((s2t = patricia_find(pt, &fm)) != NULL && s2t->task->funcs->handle_dl != NULL) { s2t->task->funcs->handle_dl(s2t->task, dl); } } return; } static void tx_nd_check(scamper_dl_rec_t *dl) { scamper_task_sig_t sig; scamper_addr_t ip; struct in_addr ip4; struct in6_addr ip6; patricia_t *pt; s2t_t fm, *s2t; if(SCAMPER_DL_IS_ARP_OP_REPLY(dl) && SCAMPER_DL_IS_ARP_PRO_IPV4(dl)) { if(patricia_count(tx_nd4) <= 0) return; ip.type = SCAMPER_ADDR_TYPE_IPV4; memcpy(&ip4, dl->dl_arp_spa, sizeof(ip4)); ip.addr = &ip4; pt = tx_nd4; } else if(SCAMPER_DL_IS_ICMP6_ND_NADV(dl)) { if(patricia_count(tx_nd6) <= 0) return; ip.type = SCAMPER_ADDR_TYPE_IPV6; memcpy(&ip6, dl->dl_icmp6_nd_target, sizeof(ip6)); ip.addr = &ip6; pt = tx_nd6; } else return; sig.sig_type = SCAMPER_TASK_SIG_TYPE_TX_ND; sig.sig_tx_nd_ip = &ip; fm.sig = &sig; if((s2t = patricia_find(pt, &fm)) == NULL) return; if(s2t->task->funcs->handle_dl != NULL) s2t->task->funcs->handle_dl(s2t->task, dl); return; } static void sniff_check(scamper_dl_rec_t *dl) { scamper_task_sig_t *sig; s2t_t *s2t; dlist_node_t *n; scamper_addr_t src; uint16_t id; if(dlist_count(sniff) <= 0) return; if(SCAMPER_DL_IS_ICMP_ECHO_REPLY(dl)) id = dl->dl_icmp_id; else if(SCAMPER_DL_IS_ICMP_Q_ICMP_ECHO(dl)) id = dl->dl_icmp_icmp_id; else return; if(SCAMPER_DL_IS_IPV4(dl)) src.type = SCAMPER_ADDR_TYPE_IPV4; else if(SCAMPER_DL_IS_IPV6(dl)) src.type = SCAMPER_ADDR_TYPE_IPV6; else return; src.addr = dl->dl_ip_dst; for(n = dlist_head_node(sniff); n != NULL; n = dlist_node_next(n)) { s2t = dlist_node_item(n); sig = s2t->sig; if(sig->sig_sniff_icmp_id != id) continue; if(scamper_addr_cmp(sig->sig_sniff_src, &src) != 0) continue; if(s2t->task->funcs->handle_dl != NULL) s2t->task->funcs->handle_dl(s2t->task, dl); } return; } static void s2t_free(s2t_t *s2t) { scamper_task_sig_t *sig = s2t->sig; if(s2t == NULL) return; if(s2t->node != NULL) { if(sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_IP) { if(sig->sig_tx_ip_dst->type == SCAMPER_ADDR_TYPE_IPV4) patricia_remove_node(tx_ip4, s2t->node); else patricia_remove_node(tx_ip6, s2t->node); } else if(sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_ND) { if(sig->sig_tx_nd_ip->type == SCAMPER_ADDR_TYPE_IPV4) patricia_remove_node(tx_nd4, s2t->node); else patricia_remove_node(tx_nd6, s2t->node); } else if(sig->sig_type == SCAMPER_TASK_SIG_TYPE_SNIFF) dlist_node_pop(sniff, s2t->node); } free(s2t); return; } char *scamper_task_sig_tostr(scamper_task_sig_t *sig, char *buf, size_t len) { char tmp[64]; size_t off = 0; if(sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_IP) string_concat(buf, len, &off, "ip %s", scamper_addr_tostr(sig->sig_tx_ip_dst, tmp, sizeof(tmp))); else if(sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_ND) string_concat(buf, len, &off, "nd %s", scamper_addr_tostr(sig->sig_tx_nd_ip, tmp, sizeof(tmp))); else if(sig->sig_type == SCAMPER_TASK_SIG_TYPE_SNIFF) string_concat(buf, len, &off, "sniff %s icmp-id %04x", scamper_addr_tostr(sig->sig_sniff_src, tmp, sizeof(tmp)), sig->sig_sniff_icmp_id); else return NULL; return buf; } scamper_task_sig_t *scamper_task_sig_alloc(uint8_t type) { scamper_task_sig_t *sig; if((sig = malloc_zero(sizeof(scamper_task_sig_t))) != NULL) sig->sig_type = type; return sig; } void scamper_task_sig_free(scamper_task_sig_t *sig) { if(sig == NULL) return; switch(sig->sig_type) { case SCAMPER_TASK_SIG_TYPE_TX_IP: if(sig->sig_tx_ip_dst != NULL) scamper_addr_free(sig->sig_tx_ip_dst); if(sig->sig_tx_ip_src != NULL) scamper_addr_free(sig->sig_tx_ip_src); break; case SCAMPER_TASK_SIG_TYPE_TX_ND: if(sig->sig_tx_nd_ip != NULL) scamper_addr_free(sig->sig_tx_nd_ip); break; case SCAMPER_TASK_SIG_TYPE_SNIFF: if(sig->sig_sniff_src != NULL) scamper_addr_free(sig->sig_sniff_src); break; } free(sig); return; } scamper_task_anc_t *scamper_task_anc_add(scamper_task_t *task, void *data, void (*freedata)(void *)) { scamper_task_anc_t *anc = NULL; if(task->ancillary == NULL && (task->ancillary = dlist_alloc()) == NULL) return NULL; if((anc = malloc_zero(sizeof(scamper_task_anc_t))) == NULL) return NULL; anc->data = data; anc->freedata = freedata; if((anc->node = dlist_tail_push(task->ancillary, anc)) == NULL) { free(anc); return NULL; } return anc; } void scamper_task_anc_del(scamper_task_t *task, scamper_task_anc_t *anc) { if(anc == NULL) return; dlist_node_pop(task->ancillary, anc->node); free(anc); return; } int scamper_task_sig_add(scamper_task_t *task, scamper_task_sig_t *sig) { s2t_t *s2t; if((s2t = malloc_zero(sizeof(s2t_t))) == NULL) return -1; s2t->sig = sig; s2t->task = task; if(slist_tail_push(task->siglist, s2t) == NULL) return -1; return 0; } scamper_task_t *scamper_task_find(scamper_task_sig_t *sig) { s2t_t fm, *s2t; fm.sig = sig; if(sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_IP) { if(sig->sig_tx_ip_dst->type == SCAMPER_ADDR_TYPE_IPV4) s2t = patricia_find(tx_ip4, &fm); else s2t = patricia_find(tx_ip6, &fm); } else if(sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_ND) { if(sig->sig_tx_nd_ip->type == SCAMPER_ADDR_TYPE_IPV4) s2t = patricia_find(tx_nd4, &fm); else s2t = patricia_find(tx_nd6, &fm); } else return NULL; if(s2t != NULL) return s2t->task; return NULL; } void scamper_task_sig_deinstall(scamper_task_t *task) { s2t_t *s2t; scamper_task_sig_t *sig; slist_node_t *n; for(n=slist_head_node(task->siglist); n != NULL; n = slist_node_next(n)) { s2t = slist_node_item(n); sig = s2t->sig; s2t_free(s2t); scamper_task_sig_free(sig); } return; } int scamper_task_sig_install(scamper_task_t *task) { scamper_task_sig_t *sig; scamper_task_t *tf; s2t_t *s2t; slist_node_t *n; if(slist_count(task->siglist) < 1) return -1; for(n=slist_head_node(task->siglist); n != NULL; n = slist_node_next(n)) { s2t = slist_node_item(n); sig = s2t->sig; /* check if another task has this signature already */ if((tf = scamper_task_find(sig)) != NULL) { if(tf != task) goto err; continue; } if(sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_IP) { if(sig->sig_tx_ip_dst->type == SCAMPER_ADDR_TYPE_IPV4) s2t->node = patricia_insert(tx_ip4, s2t); else s2t->node = patricia_insert(tx_ip6, s2t); } else if(sig->sig_type == SCAMPER_TASK_SIG_TYPE_TX_ND) { if(sig->sig_tx_nd_ip->type == SCAMPER_ADDR_TYPE_IPV4) s2t->node = patricia_insert(tx_nd4, s2t); else s2t->node = patricia_insert(tx_nd6, s2t); } else if(sig->sig_type == SCAMPER_TASK_SIG_TYPE_SNIFF) s2t->node = dlist_tail_push(sniff, s2t); if(s2t->node == NULL) { scamper_debug(__func__, "could not install sig"); goto err; } } return 0; err: scamper_task_sig_deinstall(task); return -1; } /* * scamper_task_sig_block * * go through the signatures and see if any conflict with other tasks. * if there is a conflict, return the task, otherwise return NULL. * scamper_task_sig_install assumes that this function has been called. */ scamper_task_t *scamper_task_sig_block(scamper_task_t *task) { scamper_task_sig_t *sig; scamper_task_t *tf; slist_node_t *n; s2t_t *s2t; for(n=slist_head_node(task->siglist); n != NULL; n = slist_node_next(n)) { s2t = slist_node_item(n); sig = s2t->sig; if((tf = scamper_task_find(sig)) != NULL && tf != task) return tf; } return NULL; } void *scamper_task_onhold(scamper_task_t *task, void *param, void (*unhold)(void *param)) { task_onhold_t *toh = NULL; dlist_node_t *cookie; if(task->onhold == NULL && (task->onhold = dlist_alloc()) == NULL) goto err; if((toh = malloc_zero(sizeof(task_onhold_t))) == NULL) goto err; if((cookie = dlist_tail_push(task->onhold, toh)) == NULL) goto err; toh->param = param; toh->unhold = unhold; return cookie; err: if(toh != NULL) free(toh); return NULL; } int scamper_task_dehold(scamper_task_t *task, void *cookie) { task_onhold_t *toh; assert(task->onhold != NULL); if((toh = dlist_node_pop(task->onhold, cookie)) == NULL) return -1; free(toh); return 0; } /* * scamper_task_alloc * * allocate and initialise a task object. */ scamper_task_t *scamper_task_alloc(void *data, scamper_task_funcs_t *funcs) { scamper_task_t *task; assert(data != NULL); assert(funcs != NULL); if((task = malloc_zero(sizeof(scamper_task_t))) == NULL) { printerror(__func__, "could not malloc task"); goto err; } if((task->queue = scamper_queue_alloc(task)) == NULL) goto err; if((task->siglist = slist_alloc()) == NULL) goto err; task->funcs = funcs; task->data = data; return task; err: scamper_task_free(task); return NULL; } /* * scamper_task_free * * free a task structure. * this involves freeing the task using the free pointer provided, * freeing the queue data structure, unholding any tasks blocked, and * finally freeing the task structure itself. */ void scamper_task_free(scamper_task_t *task) { scamper_task_anc_t *anc; task_onhold_t *toh; int i; if(task->funcs != NULL) task->funcs->task_free(task); if(task->queue != NULL) { scamper_queue_free(task->queue); task->queue = NULL; } if(task->onhold != NULL) { while((toh = dlist_head_pop(task->onhold)) != NULL) { toh->unhold(toh->param); free(toh); } dlist_free(task->onhold); } if(task->cyclemon != NULL) { scamper_cyclemon_unuse(task->cyclemon); task->cyclemon = NULL; } if(task->sourcetask != NULL) { scamper_sourcetask_free(task->sourcetask); task->sourcetask = NULL; } if(task->siglist != NULL) { scamper_task_sig_deinstall(task); slist_free(task->siglist); } if(task->ancillary != NULL) { while((anc = dlist_head_pop(task->ancillary)) != NULL) { anc->node = NULL; anc->freedata(anc->data); free(anc); } dlist_free(task->ancillary); } if(task->fds != NULL) { for(i=0; ifdc; i++) scamper_fd_free(task->fds[i]); free(task->fds); } free(task); return; } void *scamper_task_getdata(const scamper_task_t *task) { return task->data; } void *scamper_task_getstate(const scamper_task_t *task) { return task->state; } void scamper_task_setdatanull(scamper_task_t *task) { task->data = NULL; return; } void scamper_task_setstate(scamper_task_t *task, void *state) { task->state = state; return; } scamper_source_t *scamper_task_getsource(scamper_task_t *task) { if(task->sourcetask == NULL) return NULL; return scamper_sourcetask_getsource(task->sourcetask); } void scamper_task_setsourcetask(scamper_task_t *task, scamper_sourcetask_t *st) { assert(task->sourcetask == NULL); task->sourcetask = st; return; } void scamper_task_setcyclemon(scamper_task_t *task, scamper_cyclemon_t *cm) { task->cyclemon = scamper_cyclemon_use(cm); return; } void scamper_task_write(scamper_task_t *task, scamper_file_t *file) { task->funcs->write(file, task); return; } void scamper_task_probe(scamper_task_t *task) { task->funcs->probe(task); return; } void scamper_task_halt(scamper_task_t *task) { task->funcs->halt(task); return; } void scamper_task_handleicmp(scamper_task_t *task, scamper_icmp_resp_t *resp) { if(task->funcs->handle_icmp != NULL) task->funcs->handle_icmp(task, resp); return; } void scamper_task_handledl(scamper_dl_rec_t *dl) { tx_ip_check(dl); tx_nd_check(dl); sniff_check(dl); return; } void scamper_task_handletimeout(scamper_task_t *task) { if(task->funcs->handle_timeout != NULL) task->funcs->handle_timeout(task); return; } int scamper_task_queue_probe(scamper_task_t *task) { return scamper_queue_probe(task->queue); } int scamper_task_queue_probe_head(scamper_task_t *task) { return scamper_queue_probe_head(task->queue); } int scamper_task_queue_wait(scamper_task_t *task, int ms) { return scamper_queue_wait(task->queue, ms); } int scamper_task_queue_wait_tv(scamper_task_t *task, struct timeval *tv) { return scamper_queue_wait_tv(task->queue, tv); } int scamper_task_queue_done(scamper_task_t *task, int ms) { return scamper_queue_done(task->queue, ms); } int scamper_task_queue_isprobe(scamper_task_t *task) { return scamper_queue_isprobe(task->queue); } int scamper_task_queue_isdone(scamper_task_t *task) { return scamper_queue_isdone(task->queue); } static int task_fd_cmp(const scamper_fd_t *a, const scamper_fd_t *b) { if(a < b) return -1; if(a > b) return 1; return 0; } /* * task_fd * * make sure the task has a hold on this fd. */ static scamper_fd_t *task_fd(scamper_task_t *t, scamper_fd_t *fd) { if(fd == NULL) return NULL; if(array_find((void **)t->fds, t->fdc, fd, (array_cmp_t)task_fd_cmp) == NULL) { if(array_insert((void ***)&t->fds, &t->fdc, fd, (array_cmp_t)task_fd_cmp) != 0) { scamper_fd_free(fd); return NULL; } } else { /* already have a hold of the fd */ scamper_fd_free(fd); } return fd; } scamper_fd_t *scamper_task_fd_icmp4(scamper_task_t *task, void *addr) { scamper_fd_t *fd = scamper_fd_icmp4(addr); return task_fd(task, fd); } scamper_fd_t *scamper_task_fd_icmp6(scamper_task_t *task, void *addr) { scamper_fd_t *fd = scamper_fd_icmp6(addr); return task_fd(task, fd); } scamper_fd_t *scamper_task_fd_udp4(scamper_task_t *task, void *a, uint16_t sp) { scamper_fd_t *fd = scamper_fd_udp4(a, sp); return task_fd(task, fd); } scamper_fd_t *scamper_task_fd_udp6(scamper_task_t *task, void *a, uint16_t sp) { scamper_fd_t *fd = scamper_fd_udp6(a, sp); return task_fd(task, fd); } scamper_fd_t *scamper_task_fd_tcp4(scamper_task_t *task, void *a, uint16_t sp) { scamper_fd_t *fd = scamper_fd_tcp4(a, sp); return task_fd(task, fd); } scamper_fd_t *scamper_task_fd_tcp6(scamper_task_t *task, void *a, uint16_t sp) { scamper_fd_t *fd = scamper_fd_tcp6(a, sp); return task_fd(task, fd); } scamper_fd_t *scamper_task_fd_dl(scamper_task_t *task, int ifindex) { scamper_fd_t *fd = scamper_fd_dl(ifindex); return task_fd(task, fd); } scamper_fd_t *scamper_task_fd_ip4(scamper_task_t *task) { scamper_fd_t *fd = scamper_fd_ip4(); return task_fd(task, fd); } #ifndef _WIN32 scamper_fd_t *scamper_task_fd_rtsock(scamper_task_t *task) { scamper_fd_t *fd = scamper_fd_rtsock(); return task_fd(task, fd); } #endif int scamper_task_init(void) { if((tx_ip4 = patricia_alloc((patricia_bit_t)tx_ip_bit, (patricia_cmp_t)tx_ip_cmp, (patricia_fbd_t)tx_ip_fbd)) == NULL) return -1; if((tx_ip6 = patricia_alloc((patricia_bit_t)tx_ip_bit, (patricia_cmp_t)tx_ip_cmp, (patricia_fbd_t)tx_ip_fbd)) == NULL) return -1; if((tx_nd4 = patricia_alloc((patricia_bit_t)tx_nd_bit, (patricia_cmp_t)tx_nd_cmp, (patricia_fbd_t)tx_nd_fbd)) == NULL) return -1; if((tx_nd6 = patricia_alloc((patricia_bit_t)tx_nd_bit, (patricia_cmp_t)tx_nd_cmp, (patricia_fbd_t)tx_nd_fbd)) == NULL) return -1; if((sniff = dlist_alloc()) == NULL) return -1; return 0; } void scamper_task_cleanup(void) { if(tx_ip4 != NULL) { patricia_free(tx_ip4); tx_ip4 = NULL; } if(tx_ip6 != NULL) { patricia_free(tx_ip6); tx_ip6 = NULL; } if(tx_nd4 != NULL) { patricia_free(tx_nd4); tx_nd4 = NULL; } if(tx_nd6 != NULL) { patricia_free(tx_nd6); tx_nd6 = NULL; } if(sniff != NULL) { dlist_free(sniff); sniff = NULL; } return; } scamper-cvs-20171204/scamper/scamper_task.h000644 001751 000000 00000014540 12126412526 020377 0ustar00mjlwheel000000 000000 /* * scamper_task.h * * $Id: scamper_task.h,v 1.40 2013/04/01 23:16:38 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2013 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_TASK_H #define __SCAMPER_TASK_H struct scamper_addr; struct scamper_queue; struct scamper_task; struct scamper_dl_rec; struct scamper_icmp_resp; struct scamper_cyclemon; struct scamper_file; struct scamper_sourcetask; #define SCAMPER_TASK_SIG_TYPE_TX_IP 1 #define SCAMPER_TASK_SIG_TYPE_TX_ND 2 #define SCAMPER_TASK_SIG_TYPE_SNIFF 3 typedef struct scamper_task scamper_task_t; typedef struct scamper_task_anc scamper_task_anc_t; typedef struct scamper_task_sig { uint8_t sig_type; union { struct tx_ip { struct scamper_addr *dst; struct scamper_addr *src; } ip; struct tx_nd { struct scamper_addr *ip; } nd; struct sniff { struct scamper_addr *src; uint16_t icmpid; } sniff; } un; } scamper_task_sig_t; #define sig_tx_ip_dst un.ip.dst #define sig_tx_ip_src un.ip.src #define sig_tx_nd_ip un.nd.ip #define sig_sniff_src un.sniff.src #define sig_sniff_icmp_id un.sniff.icmpid typedef struct scamper_task_funcs { /* probe the destination */ void (*probe)(struct scamper_task *task); /* handle some ICMP packet */ void (*handle_icmp)(struct scamper_task *task, struct scamper_icmp_resp *icmp); /* handle some information from the datalink */ void (*handle_dl)(struct scamper_task *task, struct scamper_dl_rec *dl_rec); /* handle the task timing out on the wait queue */ void (*handle_timeout)(struct scamper_task *task); void (*halt)(struct scamper_task *task); /* write the task's data object out */ void (*write)(struct scamper_file *file, struct scamper_task *task); /* free the task's data and state */ void (*task_free)(struct scamper_task *task); } scamper_task_funcs_t; scamper_task_t *scamper_task_alloc(void *data, scamper_task_funcs_t *funcs); void scamper_task_free(scamper_task_t *task); /* get various items of the task */ void *scamper_task_getdata(const scamper_task_t *task); void *scamper_task_getstate(const scamper_task_t *task); struct scamper_source *scamper_task_getsource(scamper_task_t *task); /* set various items on the task */ void scamper_task_setdatanull(scamper_task_t *task); void scamper_task_setstate(scamper_task_t *task, void *state); void scamper_task_setsourcetask(scamper_task_t *task, struct scamper_sourcetask *st); void scamper_task_setcyclemon(scamper_task_t *t, struct scamper_cyclemon *cm); /* access the various functions registered with the task */ void scamper_task_write(scamper_task_t *task, struct scamper_file *file); void scamper_task_probe(scamper_task_t *task); void scamper_task_handleicmp(scamper_task_t *task,struct scamper_icmp_resp *r); void scamper_task_handletimeout(scamper_task_t *task); void scamper_task_halt(scamper_task_t *task); /* pass the datalink record to all appropriate tasks */ void scamper_task_handledl(struct scamper_dl_rec *dl); /* access the queue structre the task holds */ int scamper_task_queue_probe(scamper_task_t *task); int scamper_task_queue_probe_head(scamper_task_t *task); int scamper_task_queue_wait(scamper_task_t *task, int ms); int scamper_task_queue_wait_tv(scamper_task_t *task, struct timeval *tv); int scamper_task_queue_done(scamper_task_t *task, int ms); int scamper_task_queue_isprobe(scamper_task_t *task); int scamper_task_queue_isdone(scamper_task_t *task); /* access the file descriptors the task holds */ #ifdef __SCAMPER_FD_H scamper_fd_t *scamper_task_fd_icmp4(scamper_task_t *task, void *addr); scamper_fd_t *scamper_task_fd_icmp6(scamper_task_t *task, void *addr); scamper_fd_t *scamper_task_fd_udp4(scamper_task_t *task, void *a, uint16_t sp); scamper_fd_t *scamper_task_fd_udp6(scamper_task_t *task, void *a, uint16_t sp); scamper_fd_t *scamper_task_fd_tcp4(scamper_task_t *task, void *a, uint16_t sp); scamper_fd_t *scamper_task_fd_tcp6(scamper_task_t *task, void *a, uint16_t sp); scamper_fd_t *scamper_task_fd_dl(scamper_task_t *task, int ifindex); scamper_fd_t *scamper_task_fd_ip4(scamper_task_t *task); #endif #if defined(__SCAMPER_FD_H) && !defined(_WIN32) scamper_fd_t *scamper_task_fd_rtsock(scamper_task_t *task); #endif /* define and use the task's probe signatures */ scamper_task_sig_t *scamper_task_sig_alloc(uint8_t type); void scamper_task_sig_free(scamper_task_sig_t *sig); int scamper_task_sig_add(scamper_task_t *task, scamper_task_sig_t *sig); scamper_task_t *scamper_task_sig_block(scamper_task_t *task); int scamper_task_sig_install(scamper_task_t *task); void scamper_task_sig_deinstall(scamper_task_t *task); scamper_task_t *scamper_task_find(scamper_task_sig_t *sig); char *scamper_task_sig_tostr(scamper_task_sig_t *sig, char *buf, size_t len); /* manage ancillary data attached to the task */ scamper_task_anc_t *scamper_task_anc_add(scamper_task_t *task, void *data, void (*freedata)(void *)); void scamper_task_anc_del(scamper_task_t *task, scamper_task_anc_t *anc); /* * scamper_task_onhold * * given a task that another is blocked on, register the fact. * when the task is free'd, the unhold function will be called. * * returns a cookie, so the dehold function can cancel the task * from being on hold at a later point. */ void *scamper_task_onhold(scamper_task_t *task, void *param, void (*unhold)(void *param)); /* * scamper_task_dehold * * given a task and a cookie returned from putting another task on hold, * de-hold the task with this cookie. */ int scamper_task_dehold(scamper_task_t *task, void *cookie); int scamper_task_init(void); void scamper_task_cleanup(void); #endif /* __SCAMPER_TASK_H */ scamper-cvs-20171204/scamper/scamper_tcp4.c000644 001751 000000 00000023163 13210743023 020275 0ustar00mjlwheel000000 000000 /* * scamper_tcp4.c * * $Id: scamper_tcp4.c,v 1.58 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012,2015 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_tcp4.c,v 1.58 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_dl.h" #include "scamper_probe.h" #include "scamper_ip4.h" #include "scamper_tcp4.h" #include "scamper_debug.h" #include "utils.h" /* * these variables are used to store a packet buffer that is allocated * in the scamper_udp4_probe function large enough for the largest probe * the routine sends */ static uint8_t *pktbuf = NULL; static size_t pktbuf_len = 0; static size_t tcp_mss(uint8_t *buf, uint16_t mss) { buf[0] = 2; buf[1] = 4; bytes_htons(buf+2, mss); return 4; } static size_t tcp_wscale(uint8_t *buf, uint8_t wscale) { buf[0] = 3; buf[1] = 3; buf[2] = wscale; scamper_debug(__func__, "%u", wscale); return 3; } static size_t tcp_sackp(uint8_t *buf) { buf[0] = 4; buf[1] = 2; return 2; } static size_t tcp_sack(uint8_t *buf, const scamper_probe_t *pr) { size_t off = 2; uint8_t i; assert(pr->pr_tcp_sackb > 0); assert(pr->pr_tcp_sackb <= 4); buf[0] = 5; for(i=0; ipr_tcp_sackb * 2; i++) { bytes_htonl(buf+off, pr->pr_tcp_sack[i]); off += 4; } buf[1] = off; return off; } static size_t tcp_nop(uint8_t *buf) { buf[0] = 1; return 1; } static size_t tcp_fo(uint8_t *buf, const scamper_probe_t *probe) { buf[0] = 34; buf[1] = 2; if(probe->pr_tcp_fo_cookielen > 0) { buf[1] += probe->pr_tcp_fo_cookielen; memcpy(buf+2, probe->pr_tcp_fo_cookie, probe->pr_tcp_fo_cookielen); } return buf[1]; } static size_t tcp_fo_exp(uint8_t *buf, const scamper_probe_t *probe) { buf[0] = 254; buf[1] = 4; buf[2] = 0xf9; buf[3] = 0x89; if(probe->pr_tcp_fo_cookielen > 0) { buf[1] += probe->pr_tcp_fo_cookielen; memcpy(buf+4, probe->pr_tcp_fo_cookie, probe->pr_tcp_fo_cookielen); } return buf[1]; } static size_t tcp_ts(uint8_t *buf, const scamper_probe_t *probe) { buf[0] = 8; buf[1] = 10; bytes_htonl(buf+2, probe->pr_tcp_tsval); bytes_htonl(buf+6, probe->pr_tcp_tsecr); return 10; } static void tcp_cksum(scamper_probe_t *probe, struct tcphdr *tcp, size_t len) { uint16_t *w; int sum = 0; /* * the TCP checksum includes a checksum calculated over a psuedo header * that includes the src and dst IP addresses, the protocol type, and * the TCP length. */ w = probe->pr_ip_src->addr; sum += *w++; sum += *w++; w = probe->pr_ip_dst->addr; sum += *w++; sum += *w++; sum += htons(len); sum += htons(IPPROTO_TCP); /* compute the checksum over the body of the TCP message */ w = (uint16_t *)tcp; while(len > 1) { sum += *w++; len -= 2; } if(len != 0) sum += ((uint8_t *)w)[0]; /* fold the checksum */ sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); if((tcp->th_sum = ~sum) == 0) tcp->th_sum = 0xffff; return; } static void tcp4_build(scamper_probe_t *probe, uint8_t *buf) { struct tcphdr *tcp = (struct tcphdr *)buf; size_t tcphlen = 20; tcp->th_sport = htons(probe->pr_tcp_sport); tcp->th_dport = htons(probe->pr_tcp_dport); tcp->th_seq = htonl(probe->pr_tcp_seq); tcp->th_ack = htonl(probe->pr_tcp_ack); tcp->th_flags = probe->pr_tcp_flags; tcp->th_win = htons(probe->pr_tcp_win); tcp->th_sum = 0; tcp->th_urp = 0; if(probe->pr_tcp_flags & TH_SYN) { if(probe->pr_tcp_mss != 0) tcphlen += tcp_mss(buf+tcphlen, probe->pr_tcp_mss); if(probe->pr_tcp_wscale != 0) tcphlen += tcp_wscale(buf+tcphlen, probe->pr_tcp_wscale); if((probe->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_SACK) != 0) tcphlen += tcp_sackp(buf+tcphlen); if((probe->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_FO) != 0) tcphlen += tcp_fo(buf+tcphlen, probe); if((probe->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_FO_EXP) != 0) tcphlen += tcp_fo_exp(buf+tcphlen, probe); } if((probe->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_TS) != 0) { tcphlen += tcp_ts(buf+tcphlen, probe); while((tcphlen % 4) != 0) tcphlen += tcp_nop(buf+tcphlen); } if(probe->pr_tcp_sackb != 0) tcphlen += tcp_sack(buf+tcphlen, probe); while((tcphlen % 4) != 0) tcphlen += tcp_nop(buf+tcphlen); #ifndef _WIN32 tcp->th_off = tcphlen >> 2; tcp->th_x2 = 0; #else tcp->th_offx2 = ((tcphlen >> 2) << 4); #endif /* if there is data to include in the payload, copy it in now */ if(probe->pr_len > 0) memcpy(buf + tcphlen, probe->pr_data, probe->pr_len); /* compute the checksum over the tcp portion of the probe */ tcp_cksum(probe, tcp, tcphlen + probe->pr_len); return; } size_t scamper_tcp4_hlen(scamper_probe_t *pr) { size_t len = 20; if(pr->pr_tcp_flags & TH_SYN) { if(pr->pr_tcp_mss != 0) len += 4; if(pr->pr_tcp_wscale != 0) len += 3; if((pr->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_SACK) != 0) len += 2; if((pr->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_FO) != 0) len += (2 + pr->pr_tcp_fo_cookielen); if((pr->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_FO_EXP) != 0) len += (4 + pr->pr_tcp_fo_cookielen); } if((pr->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_TS) != 0) { len += 10; if(pr->pr_tcp_sackb != 0) while((len % 4) != 0) len++; } if(pr->pr_tcp_sackb != 0) len += ((8 * pr->pr_tcp_sackb) + 2); while((len % 4) != 0) len++; assert(len <= 60); return len; } int scamper_tcp4_build(scamper_probe_t *probe, uint8_t *buf, size_t *len) { size_t ip4hlen, req; int rc = 0; ip4hlen = *len; scamper_ip4_build(probe, buf, &ip4hlen); req = ip4hlen + scamper_tcp4_hlen(probe) + probe->pr_len; if(req <= *len) tcp4_build(probe, buf + ip4hlen); else rc = -1; *len = req; return rc; } int scamper_tcp4_probe(scamper_probe_t *pr) { struct sockaddr_in sin4; int i; char addr[128]; size_t ip4hlen, tcphlen, len, tmp; #if !defined(IP_HDR_HTONS) struct ip *ip; #endif assert(pr != NULL); assert(pr->pr_ip_proto == IPPROTO_TCP); assert(pr->pr_ip_dst != NULL); assert(pr->pr_ip_src != NULL); assert(pr->pr_len > 0 || pr->pr_data == NULL); /* compute length, for sake of readability */ scamper_ip4_hlen(pr, &ip4hlen); tcphlen = scamper_tcp4_hlen(pr); len = ip4hlen + tcphlen + pr->pr_len; if(pktbuf_len < len) { if(realloc_wrap((void **)&pktbuf, len) != 0) { printerror(__func__, "could not realloc"); return -1; } pktbuf_len = len; } tmp = len; scamper_ip4_build(pr, pktbuf, &tmp); #if !defined(IP_HDR_HTONS) ip = (struct ip *)pktbuf; ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); #endif tcp4_build(pr, pktbuf + ip4hlen); sockaddr_compose((struct sockaddr *)&sin4, AF_INET, pr->pr_ip_dst->addr, 0); /* get the transmit time immediately before we send the packet */ gettimeofday_wrap(&pr->pr_tx); i = sendto(pr->pr_fd, pktbuf, len, 0, (struct sockaddr *)&sin4, sizeof(struct sockaddr_in)); if(i < 0) { /* error condition, could not send the packet at all */ pr->pr_errno = errno; printerror(__func__, "could not send to %s (%d ttl, %d dport, %d len)", scamper_addr_tostr(pr->pr_ip_dst, addr, sizeof(addr)), pr->pr_ip_ttl, pr->pr_tcp_dport, len); return -1; } else if((size_t)i != len) { /* error condition, sent a portion of the probe */ printerror_msg(__func__, "sent %d bytes of %d byte packet to %s", i, (int)len, scamper_addr_tostr(pr->pr_ip_dst, addr, sizeof(addr))); return -1; } return 0; } void scamper_tcp4_cleanup() { if(pktbuf != NULL) { free(pktbuf); pktbuf = NULL; } return; } void scamper_tcp4_close(int fd) { #ifndef _WIN32 close(fd); #else closesocket(fd); #endif return; } int scamper_tcp4_open(const void *addr, int sport) { struct sockaddr_in sin4; char tmp[32]; int opt, fd = -1; if((fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) { printerror(__func__, "could not open socket"); goto err; } opt = 1; if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(opt)) != 0) { printerror(__func__, "could not set SO_REUSEADDR"); goto err; } opt = 65535 + 128; if(setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&opt, sizeof(opt)) != 0) { printerror(__func__, "could not set SO_SNDBUF"); return -1; } sockaddr_compose((struct sockaddr *)&sin4, AF_INET, addr, sport); if(bind(fd, (struct sockaddr *)&sin4, sizeof(sin4)) == -1) { if(addr == NULL || addr_tostr(AF_INET, addr, tmp, sizeof(tmp)) == NULL) printerror(__func__, "could not bind port %d", sport); else printerror(__func__, "could not bind %s:%d", tmp, sport); goto err; } return fd; err: if(fd != -1) scamper_tcp4_close(fd); return -1; } scamper-cvs-20171204/scamper/scamper_tcp4.h000644 001751 000000 00000002372 11737356726 020327 0ustar00mjlwheel000000 000000 /* * scamper_tcp4.h * * $Id: scamper_tcp4.h,v 1.15 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_TCP4_H #define __SCAMPER_TCP4_H int scamper_tcp4_open(const void *addr, int sport); void scamper_tcp4_close(int fd); void scamper_tcp4_cleanup(void); #ifdef __SCAMPER_PROBE_H size_t scamper_tcp4_hlen(scamper_probe_t *probe); int scamper_tcp4_build(scamper_probe_t *probe, uint8_t *buf, size_t *len); int scamper_tcp4_probe(scamper_probe_t *probe); #endif #endif /* __SCAMPER_TCP4_H */ scamper-cvs-20171204/scamper/scamper_tcp6.c000644 001751 000000 00000020045 13210743023 020273 0ustar00mjlwheel000000 000000 /* * scamper_tcp6.c * * $Id: scamper_tcp6.c,v 1.34 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012,2015 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_tcp6.c,v 1.34 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_dl.h" #include "scamper_probe.h" #include "scamper_ip6.h" #include "scamper_tcp6.h" #include "scamper_debug.h" #include "utils.h" static size_t tcp_mss(uint8_t *buf, uint16_t mss) { buf[0] = 2; buf[1] = 4; bytes_htons(buf+2, mss); return 4; } static size_t tcp_wscale(uint8_t *buf, uint8_t wscale) { buf[0] = 3; buf[1] = 3; buf[2] = wscale; return 3; } static size_t tcp_sackp(uint8_t *buf) { buf[0] = 4; buf[1] = 2; return 2; } static size_t tcp_sack(uint8_t *buf, const scamper_probe_t *pr) { size_t off = 2; uint8_t i; assert(pr->pr_tcp_sackb > 0); assert(pr->pr_tcp_sackb <= 4); buf[0] = 5; for(i=0; ipr_tcp_sackb * 2; i++) { bytes_htonl(buf+off, pr->pr_tcp_sack[i]); off += 4; } buf[1] = off; return off; } static size_t tcp_nop(uint8_t *buf) { buf[0] = 1; return 1; } static size_t tcp_fo(uint8_t *buf, const scamper_probe_t *probe) { buf[0] = 34; buf[1] = 2; if(probe->pr_tcp_fo_cookielen > 0) { buf[1] += probe->pr_tcp_fo_cookielen; memcpy(buf+2, probe->pr_tcp_fo_cookie, probe->pr_tcp_fo_cookielen); } return buf[1]; } static size_t tcp_fo_exp(uint8_t *buf, const scamper_probe_t *probe) { buf[0] = 254; buf[1] = 4; buf[2] = 0xf9; buf[3] = 0x89; if(probe->pr_tcp_fo_cookielen > 0) { buf[1] += probe->pr_tcp_fo_cookielen; memcpy(buf+4, probe->pr_tcp_fo_cookie, probe->pr_tcp_fo_cookielen); } return buf[1]; } static size_t tcp_ts(uint8_t *buf, const scamper_probe_t *probe) { buf[0] = 8; buf[1] = 10; bytes_htonl(buf+2, probe->pr_tcp_tsval); bytes_htonl(buf+6, probe->pr_tcp_tsecr); return 10; } static void tcp_cksum(struct ip6_hdr *ip6, struct tcphdr *tcp, size_t len) { struct in6_addr a; uint16_t *w; int sum = 0; /* * the TCP checksum includes a checksum calculated over a psuedo header * that includes the src and dst IP addresses, the protocol type, and * the TCP length. */ memcpy(&a, &ip6->ip6_src, sizeof(struct in6_addr)); w = (uint16_t *)&a; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; memcpy(&a, &ip6->ip6_dst, sizeof(struct in6_addr)); w = (uint16_t *)&a; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += htons(len); sum += htons(IPPROTO_TCP); /* compute the checksum over the body of the TCP message */ w = (uint16_t *)tcp; while(len > 1) { sum += *w++; len -= 2; } if(len != 0) { sum += ((uint8_t *)w)[0]; } /* fold the checksum */ sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); if((tcp->th_sum = ~sum) == 0) { tcp->th_sum = 0xffff; } return; } size_t scamper_tcp6_hlen(scamper_probe_t *pr) { size_t tcphlen = 20; if(pr->pr_tcp_flags & TH_SYN) { if(pr->pr_tcp_mss != 0) tcphlen += 4; if(pr->pr_tcp_wscale != 0) tcphlen += 3; if((pr->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_SACK) != 0) tcphlen += 2; if((pr->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_FO) != 0) tcphlen += (2 + pr->pr_tcp_fo_cookielen); if((pr->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_FO_EXP) != 0) tcphlen += (4 + pr->pr_tcp_fo_cookielen); } if((pr->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_TS) != 0) { tcphlen += 10; if(pr->pr_tcp_sackb != 0) while((tcphlen % 4) != 0) tcphlen++; } if(pr->pr_tcp_sackb != 0) tcphlen += ((8 * pr->pr_tcp_sackb) + 2); while((tcphlen % 4) != 0) tcphlen++; assert(tcphlen <= 60); return tcphlen; } int scamper_tcp6_build(scamper_probe_t *probe, uint8_t *buf, size_t *len) { struct ip6_hdr *ip6; struct tcphdr *tcp; size_t ip6hlen, tcphlen, req; /* build the IPv6 header */ ip6hlen = *len; scamper_ip6_build(probe, buf, &ip6hlen); /* for now, we don't handle any TCP options */ tcphlen = scamper_tcp6_hlen(probe); /* calculate the total number of bytes required for this packet */ req = ip6hlen + tcphlen + probe->pr_len; if(req <= *len) { ip6 = (struct ip6_hdr *)buf; ip6->ip6_plen = htons(ip6hlen - 40 + tcphlen + probe->pr_len); /* build the tcp header */ tcp = (struct tcphdr *)(buf + ip6hlen); tcp->th_sport = htons(probe->pr_tcp_sport); tcp->th_dport = htons(probe->pr_tcp_dport); tcp->th_seq = htonl(probe->pr_tcp_seq); tcp->th_ack = htonl(probe->pr_tcp_ack); tcp->th_flags = probe->pr_tcp_flags; tcp->th_win = htons(probe->pr_tcp_win); tcp->th_sum = 0; tcp->th_urp = 0; tcphlen = 20; if(probe->pr_tcp_flags & TH_SYN) { if(probe->pr_tcp_mss != 0) tcphlen += tcp_mss(buf+ip6hlen+tcphlen, probe->pr_tcp_mss); if(probe->pr_tcp_wscale != 0) tcphlen += tcp_wscale(buf+ip6hlen+tcphlen, probe->pr_tcp_wscale); if((probe->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_SACK) != 0) tcphlen += tcp_sackp(buf+ip6hlen+tcphlen); if((probe->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_FO) != 0) tcphlen += tcp_fo(buf+tcphlen, probe); if((probe->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_FO_EXP) != 0) tcphlen += tcp_fo_exp(buf+tcphlen, probe); } if((probe->pr_tcp_opts & SCAMPER_PROBE_TCPOPT_TS) != 0) { tcphlen += tcp_ts(buf+ip6hlen+tcphlen, probe); while((tcphlen % 4) != 0) tcphlen += tcp_nop(buf+ip6hlen+tcphlen); } if(probe->pr_tcp_sackb != 0) tcphlen += tcp_sack(buf+ip6hlen+tcphlen, probe); while((tcphlen % 4) != 0) tcphlen += tcp_nop(buf+ip6hlen+tcphlen); #ifndef _WIN32 tcp->th_off = tcphlen >> 2; tcp->th_x2 = 0; #else tcp->th_offx2 = ((tcphlen >> 2) << 4); #endif /* if there is data to include in the payload, copy it in now */ if(probe->pr_len > 0) { memcpy(buf + ip6hlen + tcphlen, probe->pr_data, probe->pr_len); } /* compute the checksum over the tcp portion of the probe */ tcp_cksum(ip6, tcp, tcphlen + probe->pr_len); *len = req; return 0; } *len = req; return -1; } void scamper_tcp6_close(int fd) { #ifndef _WIN32 close(fd); #else closesocket(fd); #endif return; } int scamper_tcp6_open(const void *addr, int sport) { struct sockaddr_in6 sin6; char tmp[128]; int fd = -1; #ifdef IPV6_V6ONLY int opt; #endif if((fd = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP)) == -1) { printerror(__func__, "could not open socket"); goto err; } #ifdef IPV6_V6ONLY opt = 1; if(setsockopt(fd,IPPROTO_IPV6,IPV6_V6ONLY, (char *)&opt,sizeof(opt)) == -1) { printerror(__func__, "could not set IPV6_V6ONLY"); goto err; } #endif sockaddr_compose((struct sockaddr *)&sin6, AF_INET6, addr, sport); if(bind(fd, (struct sockaddr *)&sin6, sizeof(sin6)) == -1) { if(addr == NULL || addr_tostr(AF_INET6, addr, tmp, sizeof(tmp)) == NULL) printerror(__func__, "could not bind port %d", sport); else printerror(__func__, "could not bind %s:%d", tmp, sport); goto err; } return fd; err: if(fd != -1) scamper_tcp6_close(fd); return -1; } scamper-cvs-20171204/scamper/scamper_tcp6.h000644 001751 000000 00000002244 11737356726 020327 0ustar00mjlwheel000000 000000 /* * scamper_tcp6.h * * $Id: scamper_tcp6.h,v 1.12 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2006 Matthew Luckie * Copyright (C) 2006-2009 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_TCP6_H #define __SCAMPER_TCP6_H int scamper_tcp6_open(const void *addr, int sport); void scamper_tcp6_close(int fd); #ifdef __SCAMPER_PROBE_H size_t scamper_tcp6_hlen(scamper_probe_t *probe); int scamper_tcp6_build(scamper_probe_t *probe, uint8_t *buf, size_t *len); #endif #endif /* __SCAMPER_TCP6_H */ scamper-cvs-20171204/scamper/scamper_udp4.c000644 001751 000000 00000016243 13210743023 020300 0ustar00mjlwheel000000 000000 /* * scamper_udp4.c * * $Id: scamper_udp4.c,v 1.74 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_udp4.c,v 1.74 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_dl.h" #include "scamper_probe.h" #include "scamper_ip4.h" #include "scamper_udp4.h" #include "scamper_privsep.h" #include "scamper_debug.h" #include "utils.h" /* * these variables are used to store a packet buffer that is allocated * in the scamper_udp4_probe function large enough for the largest probe * the routine sends */ static uint8_t *pktbuf = NULL; static size_t pktbuf_len = 0; uint16_t scamper_udp4_cksum(scamper_probe_t *probe) { uint16_t tmp, *w; int i, sum = 0; /* compute the checksum over the psuedo header */ w = (uint16_t *)probe->pr_ip_src->addr; sum += *w++; sum += *w++; w = (uint16_t *)probe->pr_ip_dst->addr; sum += *w++; sum += *w++; sum += htons(IPPROTO_UDP); sum += htons(probe->pr_len + 8); /* main UDP header */ sum += htons(probe->pr_udp_sport); sum += htons(probe->pr_udp_dport); sum += htons(probe->pr_len + 8); /* compute the checksum over the payload of the UDP message */ w = (uint16_t *)probe->pr_data; for(i = probe->pr_len; i > 1; i -= 2) { sum += *w++; } if(i != 0) { sum += ((uint8_t *)w)[0]; } /* fold the checksum */ sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); if((tmp = ~sum) == 0) { tmp = 0xffff; } return tmp; } static void udp4_build(scamper_probe_t *probe, uint8_t *buf) { struct udphdr *udp = (struct udphdr *)buf; udp->uh_sport = htons(probe->pr_udp_sport); udp->uh_dport = htons(probe->pr_udp_dport); udp->uh_ulen = htons(8 + probe->pr_len); udp->uh_sum = scamper_udp4_cksum(probe); /* if there is data to include in the payload, copy it in now */ if(probe->pr_len > 0) { memcpy(buf + 8, probe->pr_data, probe->pr_len); } return; } int scamper_udp4_build(scamper_probe_t *probe, uint8_t *buf, size_t *len) { size_t ip4hlen, req; int rc = 0; ip4hlen = *len; scamper_ip4_build(probe, buf, &ip4hlen); req = ip4hlen + 8 + probe->pr_len; if(req <= *len) udp4_build(probe, buf + ip4hlen); else rc = -1; *len = req; return rc; } int scamper_udp4_probe(scamper_probe_t *probe) { struct sockaddr_in sin4; int i; char addr[128]; size_t ip4hlen, len, tmp; uint8_t *buf; #if !defined(IP_HDR_HTONS) struct ip *ip; #endif assert(probe != NULL); assert(probe->pr_ip_proto == IPPROTO_UDP); assert(probe->pr_ip_dst != NULL); assert(probe->pr_ip_src != NULL); assert(probe->pr_len > 0 || probe->pr_data == NULL); scamper_ip4_hlen(probe, &ip4hlen); /* compute length, for sake of readability */ len = ip4hlen + sizeof(struct udphdr) + probe->pr_len; if(pktbuf_len < len) { if((buf = realloc(pktbuf, len)) == NULL) { printerror(__func__, "could not realloc"); return -1; } pktbuf = buf; pktbuf_len = len; } tmp = len; scamper_ip4_build(probe, pktbuf, &tmp); #if !defined(IP_HDR_HTONS) ip = (struct ip *)pktbuf; ip->ip_len = ntohs(ip->ip_len); ip->ip_off = ntohs(ip->ip_off); #endif udp4_build(probe, pktbuf + ip4hlen); sockaddr_compose((struct sockaddr *)&sin4, AF_INET, probe->pr_ip_dst->addr, probe->pr_udp_dport); /* get the transmit time immediately before we send the packet */ gettimeofday_wrap(&probe->pr_tx); i = sendto(probe->pr_fd, pktbuf, len, 0, (struct sockaddr *)&sin4, sizeof(struct sockaddr_in)); if(i < 0) { /* error condition, could not send the packet at all */ probe->pr_errno = errno; printerror(__func__, "could not send to %s (%d ttl, %d dport, %d len)", scamper_addr_tostr(probe->pr_ip_dst, addr, sizeof(addr)), probe->pr_ip_ttl, probe->pr_udp_dport, len); return -1; } else if((size_t)i != len) { /* error condition, sent a portion of the probe */ printerror_msg(__func__, "sent %d bytes of %d byte packet to %s", i, (int)len, scamper_addr_tostr(probe->pr_ip_dst, addr, sizeof(addr))); return -1; } return 0; } void scamper_udp4_cleanup() { if(pktbuf != NULL) { free(pktbuf); pktbuf = NULL; } return; } void scamper_udp4_close(int fd) { #ifndef _WIN32 close(fd); #else closesocket(fd); #endif return; } int scamper_udp4_opendgram(const void *addr, int sport) { struct sockaddr_in sin4; char tmp[32]; int fd, opt; if((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { printerror(__func__, "could not open socket"); goto err; } opt = 1; if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(opt)) != 0) { printerror(__func__, "could not set SO_REUSEADDR"); goto err; } sockaddr_compose((struct sockaddr *)&sin4, AF_INET, addr, sport); if(bind(fd, (struct sockaddr *)&sin4, sizeof(sin4)) == -1) { printerror(__func__, "could not bind %s", sockaddr_tostr((struct sockaddr *)&sin4, tmp, sizeof(tmp))); goto err; } return fd; err: if(fd != -1) scamper_udp4_close(fd); return -1; } int scamper_udp4_openraw_fd(const void *addr) { struct sockaddr_in sin4; int hdr, fd; char tmp[32]; if((fd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP)) == -1) { printerror(__func__, "could not open socket"); goto err; } hdr = 1; if(setsockopt(fd, IPPROTO_IP, IP_HDRINCL, (void *)&hdr, sizeof(hdr)) == -1) { printerror(__func__, "could not IP_HDRINCL"); goto err; } sockaddr_compose((struct sockaddr *)&sin4, AF_INET, addr, 0); if(bind(fd, (struct sockaddr *)&sin4, sizeof(sin4)) == -1) { printerror(__func__, "could not bind %s", sockaddr_tostr((struct sockaddr *)&sin4, tmp, sizeof(tmp))); goto err; } return fd; err: if(fd != -1) scamper_udp4_close(fd); return -1; } int scamper_udp4_openraw(const void *addr) { int fd, opt; #if defined(WITHOUT_PRIVSEP) fd = scamper_udp4_openraw_fd(addr); #else fd = scamper_privsep_open_rawudp(addr); #endif if(fd == -1) return -1; opt = 65535 + 128; if(setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&opt, sizeof(opt)) == -1) { printerror(__func__, "could not set SO_SNDBUF"); goto err; } return fd; err: if(fd != -1) scamper_udp4_close(fd); return -1; } scamper-cvs-20171204/scamper/scamper_udp4.h000644 001751 000000 00000002536 12516265335 020322 0ustar00mjlwheel000000 000000 /* * scamper_udp4.h * * $Id: scamper_udp4.h,v 1.23 2015/04/23 21:57:49 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_UDP4_H #define __SCAMPER_UDP4_H int scamper_udp4_openraw(const void *addr); int scamper_udp4_openraw_fd(const void *addr); int scamper_udp4_opendgram(const void *addr, int sport); void scamper_udp4_close(int fd); void scamper_udp4_cleanup(void); #ifdef __SCAMPER_PROBE_H int scamper_udp4_probe(scamper_probe_t *probe); int scamper_udp4_build(scamper_probe_t *probe, uint8_t *buf, size_t *len); uint16_t scamper_udp4_cksum(scamper_probe_t *probe); #endif #endif /* __SCAMPER_UDP4_H */ scamper-cvs-20171204/scamper/scamper_udp6.c000644 001751 000000 00000015100 13210743023 020271 0ustar00mjlwheel000000 000000 /* * scamper_udp6.c * * $Id: scamper_udp6.c,v 1.55 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_udp6.c,v 1.55 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_dl.h" #include "scamper_probe.h" #include "scamper_ip6.h" #include "scamper_udp6.h" #include "scamper_debug.h" #include "utils.h" uint16_t scamper_udp6_cksum(scamper_probe_t *probe) { uint16_t *w, tmp; int i, sum = 0; /* compute the checksum over the psuedo header */ w = (uint16_t *)probe->pr_ip_src->addr; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; w = (uint16_t *)probe->pr_ip_dst->addr; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += htons(probe->pr_len + 8); sum += htons(IPPROTO_UDP); /* main UDP header */ sum += htons(probe->pr_udp_sport); sum += htons(probe->pr_udp_dport); sum += htons(probe->pr_len + 8); /* compute the checksum over the payload of the UDP message */ w = (uint16_t *)probe->pr_data; for(i = probe->pr_len; i > 1; i -= 2) { sum += *w++; } if(i != 0) { sum += ((uint8_t *)w)[0]; } /* fold the checksum */ sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); if((tmp = ~sum) == 0) { tmp = 0xffff; } return tmp; } int scamper_udp6_build(scamper_probe_t *probe, uint8_t *buf, size_t *len) { struct ip6_hdr *ip6; struct udphdr *udp; size_t ip6hlen, req; /* build the IPv6 header */ ip6hlen = *len; scamper_ip6_build(probe, buf, &ip6hlen); /* calculate the total number of bytes required for this packet */ req = ip6hlen + 8 + probe->pr_len; if(req <= *len) { /* calculate and record the plen value */ ip6 = (struct ip6_hdr *)buf; ip6->ip6_plen = htons(ip6hlen - 40 + 8 + probe->pr_len); udp = (struct udphdr *)(buf + ip6hlen); udp->uh_sport = htons(probe->pr_udp_sport); udp->uh_dport = htons(probe->pr_udp_dport); udp->uh_ulen = htons(sizeof(struct udphdr) + probe->pr_len); udp->uh_sum = scamper_udp6_cksum(probe); /* if there is data to include in the payload, copy it in now */ if(probe->pr_len != 0) { memcpy(buf + ip6hlen + 8, probe->pr_data, probe->pr_len); } *len = req; return 0; } *len = req; return -1; } /* * scamper_udp6_probe: * * given the address, hop limit, destination UDP port number, and size, send * a UDP probe packet encapsulated in an IPv6 header. * * the size parameter is useful when doing path MTU discovery, and represents * how large the packet should be including IPv6 and UDP headers * * this function returns 0 on success, -1 otherwise */ int scamper_udp6_probe(scamper_probe_t *probe) { struct sockaddr_in6 sin6; int i; char addr[128]; assert(probe != NULL); assert(probe->pr_ip_proto == IPPROTO_UDP); assert(probe->pr_ip_dst != NULL); assert(probe->pr_ip_src != NULL); assert(probe->pr_len != 0 || probe->pr_data == NULL); i = probe->pr_ip_ttl; if(setsockopt(probe->pr_fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, (char *)&i, sizeof(i)) == -1) { printerror(__func__, "could not set hlim to %d", i); return -1; } sockaddr_compose((struct sockaddr *)&sin6, AF_INET6, probe->pr_ip_dst->addr, probe->pr_udp_dport); /* get the transmit time immediately before we send the packet */ gettimeofday_wrap(&probe->pr_tx); i = sendto(probe->pr_fd, probe->pr_data, probe->pr_len, 0, (struct sockaddr *)&sin6, sizeof(struct sockaddr_in6)); /* if we sent the probe successfully, there is nothing more to do here */ if(i == probe->pr_len) { return 0; } /* get a copy of the errno variable as it is immediately after the sendto */ probe->pr_errno = errno; /* error condition, could not send the packet at all */ if(i == -1) { printerror(__func__, "could not send to %s (%d hlim, %d dport, %d len)", scamper_addr_tostr(probe->pr_ip_dst, addr, sizeof(addr)), probe->pr_ip_ttl, probe->pr_udp_dport, probe->pr_len); } /* error condition, sent a portion of the probe */ else { printerror_msg(__func__, "sent %d bytes of %d byte packet to %s", i, (int)probe->pr_len, scamper_addr_tostr(probe->pr_ip_dst, addr, sizeof(addr))); } return -1; } void scamper_udp6_close(int fd) { #ifndef _WIN32 close(fd); #else closesocket(fd); #endif return; } int scamper_udp6_open(const void *addr, int sport) { struct sockaddr_in6 sin6; char buf[128]; int opt, fd = -1; if((fd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP)) == -1) { printerror(__func__, "could not open socket"); goto err; } #ifdef IPV6_V6ONLY opt = 1; if(setsockopt(fd,IPPROTO_IPV6,IPV6_V6ONLY, (char *)&opt,sizeof(opt)) == -1) { printerror(__func__, "could not set IPV6_V6ONLY"); goto err; } #endif sockaddr_compose((struct sockaddr *)&sin6, AF_INET6, addr, sport); if(bind(fd, (struct sockaddr *)&sin6, sizeof(sin6)) == -1) { if(addr == NULL || addr_tostr(AF_INET6, addr, buf, sizeof(buf)) == NULL) printerror(__func__, "could not bind port %d", sport); else printerror(__func__, "could not bind %s:%d", buf, sport); goto err; } opt = 65535 + 128; if(setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&opt, sizeof(opt)) == -1) { printerror(__func__, "could not set SO_SNDBUF"); return -1; } #if defined(IPV6_DONTFRAG) opt = 1; if(setsockopt(fd, IPPROTO_IPV6, IPV6_DONTFRAG, (char *)&opt, sizeof(opt)) == -1) { printerror(__func__, "could not set IPV6_DONTFRAG"); goto err; } #endif return fd; err: if(fd != -1) scamper_udp6_close(fd); return -1; } scamper-cvs-20171204/scamper/scamper_udp6.h000644 001751 000000 00000002334 11737356726 020331 0ustar00mjlwheel000000 000000 /* * scamper_udp6.h * * $Id: scamper_udp6.h,v 1.20 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2009 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_UDP6_H #define __SCAMPER_UDP6_H int scamper_udp6_open(const void *addr, int sport); void scamper_udp6_close(int fd); #ifdef __SCAMPER_PROBE_H int scamper_udp6_probe(scamper_probe_t *probe); int scamper_udp6_build(scamper_probe_t *probe, uint8_t *buf, size_t *len); uint16_t scamper_udp6_cksum(scamper_probe_t *probe); #endif #endif /* __SCAMPER_UDP6_H */ scamper-cvs-20171204/scamper/scamper_writebuf.c000644 001751 000000 00000020536 12734302025 021256 0ustar00mjlwheel000000 000000 /* * scamper_writebuf.c: use in combination with select to send without blocking * * $Id: scamper_writebuf.c,v 1.46 2016/06/27 19:52:53 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Copyright (C) 2014 The Regents of the University of California * Copyright (C) 2014-2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_writebuf.c,v 1.46 2016/06/27 19:52:53 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_writebuf.h" #include "mjl_list.h" #include "utils.h" static int iov_max = -1; static size_t pagesize = 8192; /* * scamper_writebuf * * this is a simple struct to maintain a list of iovec structures that are * to be sent when the underlying fd allows. * */ struct scamper_writebuf { slist_t *iovs; void *param; int error; int usewrite; struct iovec *tail; }; static struct iovec *iov_alloc(void) { struct iovec *iov; if((iov = malloc(sizeof(struct iovec))) == NULL) return NULL; if((iov->iov_base = malloc(pagesize)) == NULL) { free(iov); return NULL; } iov->iov_len = 0; return iov; } static void writebuf_iovfree(scamper_writebuf_t *wb, size_t size) { slist_node_t *node; struct iovec *iov; uint8_t *bytes; while(size > 0) { node = slist_head_node(wb->iovs); iov = slist_node_item(node); /* if the whole iovec was used then it can be free'd */ if(iov->iov_len <= (size_t)size) { size -= iov->iov_len; slist_head_pop(wb->iovs); if(iov != wb->tail) { free(iov->iov_base); free(iov); } else { iov->iov_len = 0; } continue; } /* if this iovec was only partially sent, then shift the vec */ bytes = (uint8_t *)iov->iov_base; memmove(iov->iov_base, bytes + size, iov->iov_len - size); iov->iov_len -= size; break; } return; } #ifndef _WIN32 static int writebuf_tx(scamper_writebuf_t *wb, int fd) { struct msghdr msg; struct iovec *iov; slist_node_t *node; ssize_t size; int i, iovs; if((iovs = slist_count(wb->iovs)) <= 0) return 0; if(wb->usewrite != 0) { while((iov = slist_head_item(wb->iovs)) != NULL) { if((size = write(fd, iov->iov_base, iov->iov_len)) == -1) { if(errno == EAGAIN || errno == EINTR) return 0; return -1; } writebuf_iovfree(wb, size); } return 0; } if(iovs > iov_max) iovs = iov_max; /* * if there is only one iovec, or we can't allocate an array large enough * for the backlog, then just send the first without allocating the * array. otherwise, fill the array with the iovecs to send. */ if(iovs == 1 || (iov = malloc(iovs * sizeof(struct iovec))) == NULL) { iov = slist_head_item(wb->iovs); iovs = 1; } else { node = slist_head_node(wb->iovs); for(i=0; i 1) free(iov); if(size == -1) { if(errno == EAGAIN || errno == EINTR) return 0; return -1; } /* free up the iovecs that have been sent */ writebuf_iovfree(wb, size); return 0; } #endif #ifdef _WIN32 static int writebuf_tx(scamper_writebuf_t *wb, int fd) { struct iovec *iov; int size; if(slist_count(wb->iovs) == 0) return 0; iov = slist_head_item(wb->iovs); if((size = send(fd, iov->iov_base, iov->iov_len, 0)) == -1) return -1; if((size_t)size == iov->iov_len) { slist_head_pop(wb->iovs); if(iov != wb->tail) { free(iov->iov_base); free(iov); } else { iov->iov_len = 0; } } else { iov->iov_len -= size; memmove(iov->iov_base, (uint8_t *)iov->iov_base + size, iov->iov_len); } return 0; } #endif /* * scamper_writebuf_write * * this function is called when the fd is ready to write to. */ int scamper_writebuf_write(int fd, scamper_writebuf_t *wb) { if(writebuf_tx(wb, fd) != 0) { wb->error = errno; return -1; } return 0; } /* * scamper_writebuf_gtzero * * if there are iovs to send, then we have more than zero bytes. */ int scamper_writebuf_gtzero(const scamper_writebuf_t *wb) { if(slist_count(wb->iovs) > 0) return 1; return 0; } size_t scamper_writebuf_len(const scamper_writebuf_t *wb) { slist_node_t *node = slist_head_node(wb->iovs); struct iovec *iov; size_t len = 0; while(node != NULL) { iov = slist_node_item(node); len += iov->iov_len; node = slist_node_next(node); } return len; } size_t scamper_writebuf_len2(const scamper_writebuf_t *wb,char *str,size_t len) { slist_node_t *node; struct iovec *iov; size_t k = 0, off = 0; int c = 0; for(node=slist_head_node(wb->iovs); node != NULL; node=slist_node_next(node)) { iov = slist_node_item(node); k += iov->iov_len; c++; } string_concat(str, len, &off, "%d,%d%s", k, c, (k != 0) ? ":" : ""); for(node=slist_head_node(wb->iovs); node != NULL; node=slist_node_next(node)) { iov = slist_node_item(node); string_concat(str, len, &off, " %d", iov->iov_len); } return k; } /* * scamper_writebuf_send * * register an iovec to send when it can be sent without blocking the * rest of scamper. */ int scamper_writebuf_send(scamper_writebuf_t *wb, const void *data, size_t len) { size_t s, x; /* make sure there is data to send */ if(len < 1) return 0; /* * an error occured last time sendmsg(2) was called which makes this * writebuf invalid */ if(wb->error != 0) return -1; while(len > 0) { /* if the tail iovec is not on the list, put it there now */ if(wb->tail->iov_len == 0 && slist_tail_push(wb->iovs, wb->tail) == NULL) return -1; /* figure out how many bytes to copy through to the iovec */ s = pagesize - wb->tail->iov_len; if(len <= s) x = len; else x = s; /* * copy the bytes in, and create a new iovec if the tail iovec * is now full */ memcpy((uint8_t *)wb->tail->iov_base + wb->tail->iov_len, data, x); wb->tail->iov_len += x; len -= x; data += x; if(wb->tail->iov_len == pagesize && (wb->tail = iov_alloc()) == NULL) return -1; } return 0; } void scamper_writebuf_usewrite(scamper_writebuf_t *wb) { wb->usewrite = 1; return; } /* * scamper_writebuf_free * */ void scamper_writebuf_free(scamper_writebuf_t *wb) { struct iovec *iov; if(wb == NULL) return; if(wb->iovs != NULL) { while((iov = slist_head_pop(wb->iovs)) != NULL) { if(wb->tail != iov) { free(iov->iov_base); free(iov); } } slist_free(wb->iovs); } if(wb->tail != NULL) { free(wb->tail->iov_base); free(wb->tail); } free(wb); return; } /* * scamper_writebuf_alloc * */ scamper_writebuf_t *scamper_writebuf_alloc(void) { scamper_writebuf_t *wb = NULL; if(iov_max == -1) { #ifdef IOV_MAX iov_max = IOV_MAX; #elif defined(_SC_IOV_MAX) iov_max = sysconf(_SC_IOV_MAX); #else iov_max = 1; #endif #ifdef HAVE_GETPAGESIZE pagesize = getpagesize(); #endif } if((wb = malloc_zero(sizeof(scamper_writebuf_t))) == NULL || (wb->iovs = slist_alloc()) == NULL || (wb->tail = iov_alloc()) == NULL) goto err; return wb; err: scamper_writebuf_free(wb); return NULL; } scamper-cvs-20171204/scamper/scamper_writebuf.h000644 001751 000000 00000003361 12657652040 021271 0ustar00mjlwheel000000 000000 /* * scamper_writebuf.h: use in combination with select to send without blocking * * $Id: scamper_writebuf.h,v 1.16 2016/02/13 16:04:48 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Copyright (C) 2014-2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_WRITEBUF_H #define __SCAMPER_WRITEBUF_H typedef struct scamper_writebuf scamper_writebuf_t; scamper_writebuf_t *scamper_writebuf_alloc(void); void scamper_writebuf_free(scamper_writebuf_t *wb); /* queue data on the writebuf */ int scamper_writebuf_send(scamper_writebuf_t *wb,const void *data,size_t len); /* write the data currently buffered to the socket */ int scamper_writebuf_write(int fd, scamper_writebuf_t *wb); /* return the count of bytes buffered */ size_t scamper_writebuf_len(const scamper_writebuf_t *wb); size_t scamper_writebuf_len2(const scamper_writebuf_t *, char *, size_t); int scamper_writebuf_gtzero(const scamper_writebuf_t *wb); /* tell writebuf to use write() rather than socket send() */ void scamper_writebuf_usewrite(scamper_writebuf_t *wb); #endif scamper-cvs-20171204/scamper/dealias/000755 001751 000000 00000000000 13211200553 017137 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/scamper/neighbourdisc/000755 001751 000000 00000000000 13211200553 020362 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/scamper/ping/000755 001751 000000 00000000000 13211200553 016472 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/scamper/sniff/000755 001751 000000 00000000000 13211200553 016642 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/scamper/sting/000755 001751 000000 00000000000 13211200553 016661 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/scamper/tbit/000755 001751 000000 00000000000 13211200553 016477 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/scamper/trace/000755 001751 000000 00000000000 13211200553 016633 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/scamper/tracelb/000755 001751 000000 00000000000 13211200553 017151 5ustar00mjlwheel000000 000000 scamper-cvs-20171204/scamper/Makefile.in000644 001751 000000 00000703541 13211200061 017606 0ustar00mjlwheel000000 000000 # Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 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@ # $Id: Makefile.am,v 1.27 2017/07/09 09:05:14 mjl Exp $ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = scamper$(EXEEXT) subdir = scamper ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_openssl.m4 \ $(top_srcdir)/m4/ax_gcc_builtin.m4 \ $(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libscamperfile_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am_libscamperfile_la_OBJECTS = ../mjl_splaytree.lo ../mjl_patricia.lo \ ../utils.lo scamper_file.lo scamper_file_arts.lo \ scamper_file_warts.lo scamper_file_text.lo \ scamper_file_json.lo scamper_addr.lo scamper_list.lo \ scamper_icmpext.lo trace/scamper_trace.lo \ trace/scamper_trace_warts.lo trace/scamper_trace_text.lo \ trace/scamper_trace_json.lo ping/scamper_ping.lo \ ping/scamper_ping_warts.lo ping/scamper_ping_text.lo \ ping/scamper_ping_json.lo tracelb/scamper_tracelb.lo \ tracelb/scamper_tracelb_warts.lo \ tracelb/scamper_tracelb_text.lo dealias/scamper_dealias.lo \ dealias/scamper_dealias_warts.lo \ dealias/scamper_dealias_text.lo \ dealias/scamper_dealias_json.lo sting/scamper_sting.lo \ sting/scamper_sting_warts.lo sting/scamper_sting_text.lo \ neighbourdisc/scamper_neighbourdisc.lo \ neighbourdisc/scamper_neighbourdisc_warts.lo \ tbit/scamper_tbit.lo tbit/scamper_tbit_warts.lo \ tbit/scamper_tbit_text.lo tbit/scamper_tbit_json.lo \ sniff/scamper_sniff.lo sniff/scamper_sniff_warts.lo libscamperfile_la_OBJECTS = $(am_libscamperfile_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libscamperfile_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libscamperfile_la_LDFLAGS) $(LDFLAGS) \ -o $@ PROGRAMS = $(bin_PROGRAMS) am_scamper_OBJECTS = ../scamper-mjl_list.$(OBJEXT) \ ../scamper-mjl_heap.$(OBJEXT) \ ../scamper-mjl_splaytree.$(OBJEXT) \ ../scamper-mjl_patricia.$(OBJEXT) ../scamper-utils.$(OBJEXT) \ scamper-scamper.$(OBJEXT) scamper-scamper_osinfo.$(OBJEXT) \ scamper-scamper_addr.$(OBJEXT) scamper-scamper_list.$(OBJEXT) \ scamper-scamper_debug.$(OBJEXT) scamper-scamper_udp4.$(OBJEXT) \ scamper-scamper_udp6.$(OBJEXT) scamper-scamper_icmp4.$(OBJEXT) \ scamper-scamper_icmp6.$(OBJEXT) \ scamper-scamper_icmp_resp.$(OBJEXT) \ scamper-scamper_icmpext.$(OBJEXT) \ scamper-scamper_tcp4.$(OBJEXT) scamper-scamper_tcp6.$(OBJEXT) \ scamper-scamper_ip6.$(OBJEXT) scamper-scamper_ip4.$(OBJEXT) \ scamper-scamper_if.$(OBJEXT) scamper-scamper_rtsock.$(OBJEXT) \ scamper-scamper_dl.$(OBJEXT) \ scamper-scamper_addr2mac.$(OBJEXT) \ scamper-scamper_fds.$(OBJEXT) \ scamper-scamper_linepoll.$(OBJEXT) \ scamper-scamper_writebuf.$(OBJEXT) \ scamper-scamper_dlhdr.$(OBJEXT) \ scamper-scamper_privsep.$(OBJEXT) \ scamper-scamper_getsrc.$(OBJEXT) \ scamper-scamper_control.$(OBJEXT) \ scamper-scamper_firewall.$(OBJEXT) \ scamper-scamper_outfiles.$(OBJEXT) \ scamper-scamper_probe.$(OBJEXT) scamper-scamper_task.$(OBJEXT) \ scamper-scamper_queue.$(OBJEXT) \ scamper-scamper_cyclemon.$(OBJEXT) \ scamper-scamper_options.$(OBJEXT) \ scamper-scamper_file.$(OBJEXT) \ scamper-scamper_file_arts.$(OBJEXT) \ scamper-scamper_file_warts.$(OBJEXT) \ scamper-scamper_file_text.$(OBJEXT) \ scamper-scamper_file_json.$(OBJEXT) \ scamper-scamper_sources.$(OBJEXT) \ scamper-scamper_source_cmdline.$(OBJEXT) \ scamper-scamper_source_control.$(OBJEXT) \ scamper-scamper_source_file.$(OBJEXT) \ scamper-scamper_source_tsps.$(OBJEXT) \ trace/scamper-scamper_trace.$(OBJEXT) \ trace/scamper-scamper_trace_warts.$(OBJEXT) \ trace/scamper-scamper_trace_text.$(OBJEXT) \ trace/scamper-scamper_trace_json.$(OBJEXT) \ trace/scamper-scamper_trace_do.$(OBJEXT) \ ping/scamper-scamper_ping.$(OBJEXT) \ ping/scamper-scamper_ping_warts.$(OBJEXT) \ ping/scamper-scamper_ping_text.$(OBJEXT) \ ping/scamper-scamper_ping_json.$(OBJEXT) \ ping/scamper-scamper_ping_do.$(OBJEXT) \ tracelb/scamper-scamper_tracelb.$(OBJEXT) \ tracelb/scamper-scamper_tracelb_warts.$(OBJEXT) \ tracelb/scamper-scamper_tracelb_text.$(OBJEXT) \ tracelb/scamper-scamper_tracelb_do.$(OBJEXT) \ dealias/scamper-scamper_dealias.$(OBJEXT) \ dealias/scamper-scamper_dealias_warts.$(OBJEXT) \ dealias/scamper-scamper_dealias_text.$(OBJEXT) \ dealias/scamper-scamper_dealias_json.$(OBJEXT) \ dealias/scamper-scamper_dealias_do.$(OBJEXT) \ sting/scamper-scamper_sting.$(OBJEXT) \ sting/scamper-scamper_sting_warts.$(OBJEXT) \ sting/scamper-scamper_sting_text.$(OBJEXT) \ sting/scamper-scamper_sting_do.$(OBJEXT) \ neighbourdisc/scamper-scamper_neighbourdisc.$(OBJEXT) \ neighbourdisc/scamper-scamper_neighbourdisc_warts.$(OBJEXT) \ neighbourdisc/scamper-scamper_neighbourdisc_do.$(OBJEXT) \ tbit/scamper-scamper_tbit.$(OBJEXT) \ tbit/scamper-scamper_tbit_warts.$(OBJEXT) \ tbit/scamper-scamper_tbit_text.$(OBJEXT) \ tbit/scamper-scamper_tbit_json.$(OBJEXT) \ tbit/scamper-scamper_tbit_do.$(OBJEXT) \ sniff/scamper-scamper_sniff.$(OBJEXT) \ sniff/scamper-scamper_sniff_warts.$(OBJEXT) \ sniff/scamper-scamper_sniff_do.$(OBJEXT) scamper_OBJECTS = $(am_scamper_OBJECTS) scamper_DEPENDENCIES = scamper_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(scamper_CFLAGS) \ $(CFLAGS) $(scamper_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libscamperfile_la_SOURCES) $(scamper_SOURCES) DIST_SOURCES = $(libscamperfile_la_SOURCES) $(scamper_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 man3dir = $(mandir)/man3 man5dir = $(mandir)/man5 NROFF = nroff MANS = $(man_MANS) HEADERS = $(include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ 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@ privsep_dir = @privsep_dir@ privsep_dir_group = @privsep_dir_group@ privsep_dir_user = @privsep_dir_user@ privsep_user = @privsep_user@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/scamper lib_LTLIBRARIES = libscamperfile.la libscamperfile_la_LDFLAGS = -version-info 0:0:0 libscamperfile_la_SOURCES = \ ../mjl_splaytree.c \ ../mjl_patricia.c \ ../utils.c \ scamper_file.c \ scamper_file_arts.c \ scamper_file_warts.c \ scamper_file_text.c \ scamper_file_json.c \ scamper_addr.c \ scamper_list.c \ scamper_icmpext.c \ trace/scamper_trace.c \ trace/scamper_trace_warts.c \ trace/scamper_trace_text.c \ trace/scamper_trace_json.c \ ping/scamper_ping.c \ ping/scamper_ping_warts.c \ ping/scamper_ping_text.c \ ping/scamper_ping_json.c \ tracelb/scamper_tracelb.c \ tracelb/scamper_tracelb_warts.c \ tracelb/scamper_tracelb_text.c \ dealias/scamper_dealias.c \ dealias/scamper_dealias_warts.c \ dealias/scamper_dealias_text.c \ dealias/scamper_dealias_json.c \ sting/scamper_sting.c \ sting/scamper_sting_warts.c \ sting/scamper_sting_text.c \ neighbourdisc/scamper_neighbourdisc.c \ neighbourdisc/scamper_neighbourdisc_warts.c \ tbit/scamper_tbit.c \ tbit/scamper_tbit_warts.c \ tbit/scamper_tbit_text.c \ tbit/scamper_tbit_json.c \ sniff/scamper_sniff.c \ sniff/scamper_sniff_warts.c scamper_SOURCES = \ ../mjl_list.c \ ../mjl_heap.c \ ../mjl_splaytree.c \ ../mjl_patricia.c \ ../utils.c \ scamper.c \ scamper_osinfo.c \ scamper_addr.c \ scamper_list.c \ scamper_debug.c \ scamper_udp4.c \ scamper_udp6.c \ scamper_icmp4.c \ scamper_icmp6.c \ scamper_icmp_resp.c \ scamper_icmpext.c \ scamper_tcp4.c \ scamper_tcp6.c \ scamper_ip6.c \ scamper_ip4.c \ scamper_if.c \ scamper_rtsock.c \ scamper_dl.c \ scamper_addr2mac.c \ scamper_fds.c \ scamper_linepoll.c \ scamper_writebuf.c \ scamper_dlhdr.c \ scamper_privsep.c \ scamper_getsrc.c \ scamper_control.c \ scamper_firewall.c \ scamper_outfiles.c \ scamper_probe.c \ scamper_task.c \ scamper_queue.c \ scamper_cyclemon.c \ scamper_options.c \ scamper_file.c \ scamper_file_arts.c \ scamper_file_warts.c \ scamper_file_text.c \ scamper_file_json.c \ scamper_sources.c \ scamper_source_cmdline.c \ scamper_source_control.c \ scamper_source_file.c \ scamper_source_tsps.c \ trace/scamper_trace.c \ trace/scamper_trace_warts.c \ trace/scamper_trace_text.c \ trace/scamper_trace_json.c \ trace/scamper_trace_do.c \ ping/scamper_ping.c \ ping/scamper_ping_warts.c \ ping/scamper_ping_text.c \ ping/scamper_ping_json.c \ ping/scamper_ping_do.c \ tracelb/scamper_tracelb.c \ tracelb/scamper_tracelb_warts.c \ tracelb/scamper_tracelb_text.c \ tracelb/scamper_tracelb_do.c \ dealias/scamper_dealias.c \ dealias/scamper_dealias_warts.c \ dealias/scamper_dealias_text.c \ dealias/scamper_dealias_json.c \ dealias/scamper_dealias_do.c \ sting/scamper_sting.c \ sting/scamper_sting_warts.c \ sting/scamper_sting_text.c \ sting/scamper_sting_do.c \ neighbourdisc/scamper_neighbourdisc.c \ neighbourdisc/scamper_neighbourdisc_warts.c \ neighbourdisc/scamper_neighbourdisc_do.c \ tbit/scamper_tbit.c \ tbit/scamper_tbit_warts.c \ tbit/scamper_tbit_text.c \ tbit/scamper_tbit_json.c \ tbit/scamper_tbit_do.c \ sniff/scamper_sniff.c \ sniff/scamper_sniff_warts.c \ sniff/scamper_sniff_do.c scamper_CFLAGS = $(AM_CFLAGS) scamper_LDADD = @OPENSSL_LIBS@ scamper_LDFLAGS = @OPENSSL_LDFLAGS@ include_HEADERS = \ scamper_file.h \ scamper_addr.h \ scamper_list.h \ scamper_icmpext.h \ trace/scamper_trace.h \ ping/scamper_ping.h \ tracelb/scamper_tracelb.h \ dealias/scamper_dealias.h \ sting/scamper_sting.h \ neighbourdisc/scamper_neighbourdisc.h \ tbit/scamper_tbit.h \ sniff/scamper_sniff.h man_MANS = \ scamper.1 \ libscamperfile.3 \ warts.5 CLEANFILES = *~ *.core \ trace/*~ ping/*~ tracelb/*~ dealias/*~ sting/*~ \ neighbourdisc/*~ tbit/*~ sniff/*~ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scamper/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign scamper/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } ../$(am__dirstamp): @$(MKDIR_P) .. @: > ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../$(DEPDIR) @: > ../$(DEPDIR)/$(am__dirstamp) ../mjl_splaytree.lo: ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp) ../mjl_patricia.lo: ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp) ../utils.lo: ../$(am__dirstamp) ../$(DEPDIR)/$(am__dirstamp) trace/$(am__dirstamp): @$(MKDIR_P) trace @: > trace/$(am__dirstamp) trace/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) trace/$(DEPDIR) @: > trace/$(DEPDIR)/$(am__dirstamp) trace/scamper_trace.lo: trace/$(am__dirstamp) \ trace/$(DEPDIR)/$(am__dirstamp) trace/scamper_trace_warts.lo: trace/$(am__dirstamp) \ trace/$(DEPDIR)/$(am__dirstamp) trace/scamper_trace_text.lo: trace/$(am__dirstamp) \ trace/$(DEPDIR)/$(am__dirstamp) trace/scamper_trace_json.lo: trace/$(am__dirstamp) \ trace/$(DEPDIR)/$(am__dirstamp) ping/$(am__dirstamp): @$(MKDIR_P) ping @: > ping/$(am__dirstamp) ping/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ping/$(DEPDIR) @: > ping/$(DEPDIR)/$(am__dirstamp) ping/scamper_ping.lo: ping/$(am__dirstamp) \ ping/$(DEPDIR)/$(am__dirstamp) ping/scamper_ping_warts.lo: ping/$(am__dirstamp) \ ping/$(DEPDIR)/$(am__dirstamp) ping/scamper_ping_text.lo: ping/$(am__dirstamp) \ ping/$(DEPDIR)/$(am__dirstamp) ping/scamper_ping_json.lo: ping/$(am__dirstamp) \ ping/$(DEPDIR)/$(am__dirstamp) tracelb/$(am__dirstamp): @$(MKDIR_P) tracelb @: > tracelb/$(am__dirstamp) tracelb/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) tracelb/$(DEPDIR) @: > tracelb/$(DEPDIR)/$(am__dirstamp) tracelb/scamper_tracelb.lo: tracelb/$(am__dirstamp) \ tracelb/$(DEPDIR)/$(am__dirstamp) tracelb/scamper_tracelb_warts.lo: tracelb/$(am__dirstamp) \ tracelb/$(DEPDIR)/$(am__dirstamp) tracelb/scamper_tracelb_text.lo: tracelb/$(am__dirstamp) \ tracelb/$(DEPDIR)/$(am__dirstamp) dealias/$(am__dirstamp): @$(MKDIR_P) dealias @: > dealias/$(am__dirstamp) dealias/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) dealias/$(DEPDIR) @: > dealias/$(DEPDIR)/$(am__dirstamp) dealias/scamper_dealias.lo: dealias/$(am__dirstamp) \ dealias/$(DEPDIR)/$(am__dirstamp) dealias/scamper_dealias_warts.lo: dealias/$(am__dirstamp) \ dealias/$(DEPDIR)/$(am__dirstamp) dealias/scamper_dealias_text.lo: dealias/$(am__dirstamp) \ dealias/$(DEPDIR)/$(am__dirstamp) dealias/scamper_dealias_json.lo: dealias/$(am__dirstamp) \ dealias/$(DEPDIR)/$(am__dirstamp) sting/$(am__dirstamp): @$(MKDIR_P) sting @: > sting/$(am__dirstamp) sting/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) sting/$(DEPDIR) @: > sting/$(DEPDIR)/$(am__dirstamp) sting/scamper_sting.lo: sting/$(am__dirstamp) \ sting/$(DEPDIR)/$(am__dirstamp) sting/scamper_sting_warts.lo: sting/$(am__dirstamp) \ sting/$(DEPDIR)/$(am__dirstamp) sting/scamper_sting_text.lo: sting/$(am__dirstamp) \ sting/$(DEPDIR)/$(am__dirstamp) neighbourdisc/$(am__dirstamp): @$(MKDIR_P) neighbourdisc @: > neighbourdisc/$(am__dirstamp) neighbourdisc/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) neighbourdisc/$(DEPDIR) @: > neighbourdisc/$(DEPDIR)/$(am__dirstamp) neighbourdisc/scamper_neighbourdisc.lo: neighbourdisc/$(am__dirstamp) \ neighbourdisc/$(DEPDIR)/$(am__dirstamp) neighbourdisc/scamper_neighbourdisc_warts.lo: \ neighbourdisc/$(am__dirstamp) \ neighbourdisc/$(DEPDIR)/$(am__dirstamp) tbit/$(am__dirstamp): @$(MKDIR_P) tbit @: > tbit/$(am__dirstamp) tbit/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) tbit/$(DEPDIR) @: > tbit/$(DEPDIR)/$(am__dirstamp) tbit/scamper_tbit.lo: tbit/$(am__dirstamp) \ tbit/$(DEPDIR)/$(am__dirstamp) tbit/scamper_tbit_warts.lo: tbit/$(am__dirstamp) \ tbit/$(DEPDIR)/$(am__dirstamp) tbit/scamper_tbit_text.lo: tbit/$(am__dirstamp) \ tbit/$(DEPDIR)/$(am__dirstamp) tbit/scamper_tbit_json.lo: tbit/$(am__dirstamp) \ tbit/$(DEPDIR)/$(am__dirstamp) sniff/$(am__dirstamp): @$(MKDIR_P) sniff @: > sniff/$(am__dirstamp) sniff/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) sniff/$(DEPDIR) @: > sniff/$(DEPDIR)/$(am__dirstamp) sniff/scamper_sniff.lo: sniff/$(am__dirstamp) \ sniff/$(DEPDIR)/$(am__dirstamp) sniff/scamper_sniff_warts.lo: sniff/$(am__dirstamp) \ sniff/$(DEPDIR)/$(am__dirstamp) libscamperfile.la: $(libscamperfile_la_OBJECTS) $(libscamperfile_la_DEPENDENCIES) $(EXTRA_libscamperfile_la_DEPENDENCIES) $(AM_V_CCLD)$(libscamperfile_la_LINK) -rpath $(libdir) $(libscamperfile_la_OBJECTS) $(libscamperfile_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ../scamper-mjl_list.$(OBJEXT): ../$(am__dirstamp) \ ../$(DEPDIR)/$(am__dirstamp) ../scamper-mjl_heap.$(OBJEXT): ../$(am__dirstamp) \ ../$(DEPDIR)/$(am__dirstamp) ../scamper-mjl_splaytree.$(OBJEXT): ../$(am__dirstamp) \ ../$(DEPDIR)/$(am__dirstamp) ../scamper-mjl_patricia.$(OBJEXT): ../$(am__dirstamp) \ ../$(DEPDIR)/$(am__dirstamp) ../scamper-utils.$(OBJEXT): ../$(am__dirstamp) \ ../$(DEPDIR)/$(am__dirstamp) trace/scamper-scamper_trace.$(OBJEXT): trace/$(am__dirstamp) \ trace/$(DEPDIR)/$(am__dirstamp) trace/scamper-scamper_trace_warts.$(OBJEXT): trace/$(am__dirstamp) \ trace/$(DEPDIR)/$(am__dirstamp) trace/scamper-scamper_trace_text.$(OBJEXT): trace/$(am__dirstamp) \ trace/$(DEPDIR)/$(am__dirstamp) trace/scamper-scamper_trace_json.$(OBJEXT): trace/$(am__dirstamp) \ trace/$(DEPDIR)/$(am__dirstamp) trace/scamper-scamper_trace_do.$(OBJEXT): trace/$(am__dirstamp) \ trace/$(DEPDIR)/$(am__dirstamp) ping/scamper-scamper_ping.$(OBJEXT): ping/$(am__dirstamp) \ ping/$(DEPDIR)/$(am__dirstamp) ping/scamper-scamper_ping_warts.$(OBJEXT): ping/$(am__dirstamp) \ ping/$(DEPDIR)/$(am__dirstamp) ping/scamper-scamper_ping_text.$(OBJEXT): ping/$(am__dirstamp) \ ping/$(DEPDIR)/$(am__dirstamp) ping/scamper-scamper_ping_json.$(OBJEXT): ping/$(am__dirstamp) \ ping/$(DEPDIR)/$(am__dirstamp) ping/scamper-scamper_ping_do.$(OBJEXT): ping/$(am__dirstamp) \ ping/$(DEPDIR)/$(am__dirstamp) tracelb/scamper-scamper_tracelb.$(OBJEXT): tracelb/$(am__dirstamp) \ tracelb/$(DEPDIR)/$(am__dirstamp) tracelb/scamper-scamper_tracelb_warts.$(OBJEXT): \ tracelb/$(am__dirstamp) tracelb/$(DEPDIR)/$(am__dirstamp) tracelb/scamper-scamper_tracelb_text.$(OBJEXT): \ tracelb/$(am__dirstamp) tracelb/$(DEPDIR)/$(am__dirstamp) tracelb/scamper-scamper_tracelb_do.$(OBJEXT): tracelb/$(am__dirstamp) \ tracelb/$(DEPDIR)/$(am__dirstamp) dealias/scamper-scamper_dealias.$(OBJEXT): dealias/$(am__dirstamp) \ dealias/$(DEPDIR)/$(am__dirstamp) dealias/scamper-scamper_dealias_warts.$(OBJEXT): \ dealias/$(am__dirstamp) dealias/$(DEPDIR)/$(am__dirstamp) dealias/scamper-scamper_dealias_text.$(OBJEXT): \ dealias/$(am__dirstamp) dealias/$(DEPDIR)/$(am__dirstamp) dealias/scamper-scamper_dealias_json.$(OBJEXT): \ dealias/$(am__dirstamp) dealias/$(DEPDIR)/$(am__dirstamp) dealias/scamper-scamper_dealias_do.$(OBJEXT): dealias/$(am__dirstamp) \ dealias/$(DEPDIR)/$(am__dirstamp) sting/scamper-scamper_sting.$(OBJEXT): sting/$(am__dirstamp) \ sting/$(DEPDIR)/$(am__dirstamp) sting/scamper-scamper_sting_warts.$(OBJEXT): sting/$(am__dirstamp) \ sting/$(DEPDIR)/$(am__dirstamp) sting/scamper-scamper_sting_text.$(OBJEXT): sting/$(am__dirstamp) \ sting/$(DEPDIR)/$(am__dirstamp) sting/scamper-scamper_sting_do.$(OBJEXT): sting/$(am__dirstamp) \ sting/$(DEPDIR)/$(am__dirstamp) neighbourdisc/scamper-scamper_neighbourdisc.$(OBJEXT): \ neighbourdisc/$(am__dirstamp) \ neighbourdisc/$(DEPDIR)/$(am__dirstamp) neighbourdisc/scamper-scamper_neighbourdisc_warts.$(OBJEXT): \ neighbourdisc/$(am__dirstamp) \ neighbourdisc/$(DEPDIR)/$(am__dirstamp) neighbourdisc/scamper-scamper_neighbourdisc_do.$(OBJEXT): \ neighbourdisc/$(am__dirstamp) \ neighbourdisc/$(DEPDIR)/$(am__dirstamp) tbit/scamper-scamper_tbit.$(OBJEXT): tbit/$(am__dirstamp) \ tbit/$(DEPDIR)/$(am__dirstamp) tbit/scamper-scamper_tbit_warts.$(OBJEXT): tbit/$(am__dirstamp) \ tbit/$(DEPDIR)/$(am__dirstamp) tbit/scamper-scamper_tbit_text.$(OBJEXT): tbit/$(am__dirstamp) \ tbit/$(DEPDIR)/$(am__dirstamp) tbit/scamper-scamper_tbit_json.$(OBJEXT): tbit/$(am__dirstamp) \ tbit/$(DEPDIR)/$(am__dirstamp) tbit/scamper-scamper_tbit_do.$(OBJEXT): tbit/$(am__dirstamp) \ tbit/$(DEPDIR)/$(am__dirstamp) sniff/scamper-scamper_sniff.$(OBJEXT): sniff/$(am__dirstamp) \ sniff/$(DEPDIR)/$(am__dirstamp) sniff/scamper-scamper_sniff_warts.$(OBJEXT): sniff/$(am__dirstamp) \ sniff/$(DEPDIR)/$(am__dirstamp) sniff/scamper-scamper_sniff_do.$(OBJEXT): sniff/$(am__dirstamp) \ sniff/$(DEPDIR)/$(am__dirstamp) scamper$(EXEEXT): $(scamper_OBJECTS) $(scamper_DEPENDENCIES) $(EXTRA_scamper_DEPENDENCIES) @rm -f scamper$(EXEEXT) $(AM_V_CCLD)$(scamper_LINK) $(scamper_OBJECTS) $(scamper_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../*.$(OBJEXT) -rm -f ../*.lo -rm -f dealias/*.$(OBJEXT) -rm -f dealias/*.lo -rm -f neighbourdisc/*.$(OBJEXT) -rm -f neighbourdisc/*.lo -rm -f ping/*.$(OBJEXT) -rm -f ping/*.lo -rm -f sniff/*.$(OBJEXT) -rm -f sniff/*.lo -rm -f sting/*.$(OBJEXT) -rm -f sting/*.lo -rm -f tbit/*.$(OBJEXT) -rm -f tbit/*.lo -rm -f trace/*.$(OBJEXT) -rm -f trace/*.lo -rm -f tracelb/*.$(OBJEXT) -rm -f tracelb/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/mjl_patricia.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/mjl_splaytree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/scamper-mjl_heap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/scamper-mjl_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/scamper-mjl_patricia.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/scamper-mjl_splaytree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/scamper-utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../$(DEPDIR)/utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_addr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_addr2mac.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_control.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_cyclemon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_dl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_dlhdr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_fds.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_file_arts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_file_json.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_file_text.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_file_warts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_firewall.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_getsrc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_icmp4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_icmp6.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_icmp_resp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_icmpext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_if.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_ip4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_ip6.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_linepoll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_osinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_outfiles.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_privsep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_probe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_queue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_rtsock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_source_cmdline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_source_control.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_source_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_source_tsps.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_sources.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_task.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_tcp4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_tcp6.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_udp4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_udp6.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper-scamper_writebuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper_addr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper_file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper_file_arts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper_file_json.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper_file_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper_file_warts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper_icmpext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scamper_list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dealias/$(DEPDIR)/scamper-scamper_dealias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dealias/$(DEPDIR)/scamper-scamper_dealias_do.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dealias/$(DEPDIR)/scamper-scamper_dealias_json.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dealias/$(DEPDIR)/scamper-scamper_dealias_text.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dealias/$(DEPDIR)/scamper-scamper_dealias_warts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dealias/$(DEPDIR)/scamper_dealias.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dealias/$(DEPDIR)/scamper_dealias_json.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dealias/$(DEPDIR)/scamper_dealias_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dealias/$(DEPDIR)/scamper_dealias_warts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_do.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_warts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@neighbourdisc/$(DEPDIR)/scamper_neighbourdisc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@neighbourdisc/$(DEPDIR)/scamper_neighbourdisc_warts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ping/$(DEPDIR)/scamper-scamper_ping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ping/$(DEPDIR)/scamper-scamper_ping_do.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ping/$(DEPDIR)/scamper-scamper_ping_json.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ping/$(DEPDIR)/scamper-scamper_ping_text.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ping/$(DEPDIR)/scamper-scamper_ping_warts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ping/$(DEPDIR)/scamper_ping.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ping/$(DEPDIR)/scamper_ping_json.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ping/$(DEPDIR)/scamper_ping_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ping/$(DEPDIR)/scamper_ping_warts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sniff/$(DEPDIR)/scamper-scamper_sniff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sniff/$(DEPDIR)/scamper-scamper_sniff_do.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sniff/$(DEPDIR)/scamper-scamper_sniff_warts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sniff/$(DEPDIR)/scamper_sniff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sniff/$(DEPDIR)/scamper_sniff_warts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sting/$(DEPDIR)/scamper-scamper_sting.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sting/$(DEPDIR)/scamper-scamper_sting_do.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sting/$(DEPDIR)/scamper-scamper_sting_text.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sting/$(DEPDIR)/scamper-scamper_sting_warts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sting/$(DEPDIR)/scamper_sting.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sting/$(DEPDIR)/scamper_sting_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sting/$(DEPDIR)/scamper_sting_warts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tbit/$(DEPDIR)/scamper-scamper_tbit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tbit/$(DEPDIR)/scamper-scamper_tbit_do.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tbit/$(DEPDIR)/scamper-scamper_tbit_json.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tbit/$(DEPDIR)/scamper-scamper_tbit_text.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tbit/$(DEPDIR)/scamper-scamper_tbit_warts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tbit/$(DEPDIR)/scamper_tbit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tbit/$(DEPDIR)/scamper_tbit_json.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tbit/$(DEPDIR)/scamper_tbit_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tbit/$(DEPDIR)/scamper_tbit_warts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@trace/$(DEPDIR)/scamper-scamper_trace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@trace/$(DEPDIR)/scamper-scamper_trace_do.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@trace/$(DEPDIR)/scamper-scamper_trace_json.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@trace/$(DEPDIR)/scamper-scamper_trace_text.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@trace/$(DEPDIR)/scamper-scamper_trace_warts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@trace/$(DEPDIR)/scamper_trace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@trace/$(DEPDIR)/scamper_trace_json.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@trace/$(DEPDIR)/scamper_trace_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@trace/$(DEPDIR)/scamper_trace_warts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tracelb/$(DEPDIR)/scamper-scamper_tracelb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tracelb/$(DEPDIR)/scamper-scamper_tracelb_do.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tracelb/$(DEPDIR)/scamper-scamper_tracelb_text.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tracelb/$(DEPDIR)/scamper-scamper_tracelb_warts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tracelb/$(DEPDIR)/scamper_tracelb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tracelb/$(DEPDIR)/scamper_tracelb_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tracelb/$(DEPDIR)/scamper_tracelb_warts.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< ../scamper-mjl_list.o: ../mjl_list.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ../scamper-mjl_list.o -MD -MP -MF ../$(DEPDIR)/scamper-mjl_list.Tpo -c -o ../scamper-mjl_list.o `test -f '../mjl_list.c' || echo '$(srcdir)/'`../mjl_list.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../$(DEPDIR)/scamper-mjl_list.Tpo ../$(DEPDIR)/scamper-mjl_list.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../mjl_list.c' object='../scamper-mjl_list.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ../scamper-mjl_list.o `test -f '../mjl_list.c' || echo '$(srcdir)/'`../mjl_list.c ../scamper-mjl_list.obj: ../mjl_list.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ../scamper-mjl_list.obj -MD -MP -MF ../$(DEPDIR)/scamper-mjl_list.Tpo -c -o ../scamper-mjl_list.obj `if test -f '../mjl_list.c'; then $(CYGPATH_W) '../mjl_list.c'; else $(CYGPATH_W) '$(srcdir)/../mjl_list.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../$(DEPDIR)/scamper-mjl_list.Tpo ../$(DEPDIR)/scamper-mjl_list.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../mjl_list.c' object='../scamper-mjl_list.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ../scamper-mjl_list.obj `if test -f '../mjl_list.c'; then $(CYGPATH_W) '../mjl_list.c'; else $(CYGPATH_W) '$(srcdir)/../mjl_list.c'; fi` ../scamper-mjl_heap.o: ../mjl_heap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ../scamper-mjl_heap.o -MD -MP -MF ../$(DEPDIR)/scamper-mjl_heap.Tpo -c -o ../scamper-mjl_heap.o `test -f '../mjl_heap.c' || echo '$(srcdir)/'`../mjl_heap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../$(DEPDIR)/scamper-mjl_heap.Tpo ../$(DEPDIR)/scamper-mjl_heap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../mjl_heap.c' object='../scamper-mjl_heap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ../scamper-mjl_heap.o `test -f '../mjl_heap.c' || echo '$(srcdir)/'`../mjl_heap.c ../scamper-mjl_heap.obj: ../mjl_heap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ../scamper-mjl_heap.obj -MD -MP -MF ../$(DEPDIR)/scamper-mjl_heap.Tpo -c -o ../scamper-mjl_heap.obj `if test -f '../mjl_heap.c'; then $(CYGPATH_W) '../mjl_heap.c'; else $(CYGPATH_W) '$(srcdir)/../mjl_heap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../$(DEPDIR)/scamper-mjl_heap.Tpo ../$(DEPDIR)/scamper-mjl_heap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../mjl_heap.c' object='../scamper-mjl_heap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ../scamper-mjl_heap.obj `if test -f '../mjl_heap.c'; then $(CYGPATH_W) '../mjl_heap.c'; else $(CYGPATH_W) '$(srcdir)/../mjl_heap.c'; fi` ../scamper-mjl_splaytree.o: ../mjl_splaytree.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ../scamper-mjl_splaytree.o -MD -MP -MF ../$(DEPDIR)/scamper-mjl_splaytree.Tpo -c -o ../scamper-mjl_splaytree.o `test -f '../mjl_splaytree.c' || echo '$(srcdir)/'`../mjl_splaytree.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../$(DEPDIR)/scamper-mjl_splaytree.Tpo ../$(DEPDIR)/scamper-mjl_splaytree.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../mjl_splaytree.c' object='../scamper-mjl_splaytree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ../scamper-mjl_splaytree.o `test -f '../mjl_splaytree.c' || echo '$(srcdir)/'`../mjl_splaytree.c ../scamper-mjl_splaytree.obj: ../mjl_splaytree.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ../scamper-mjl_splaytree.obj -MD -MP -MF ../$(DEPDIR)/scamper-mjl_splaytree.Tpo -c -o ../scamper-mjl_splaytree.obj `if test -f '../mjl_splaytree.c'; then $(CYGPATH_W) '../mjl_splaytree.c'; else $(CYGPATH_W) '$(srcdir)/../mjl_splaytree.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../$(DEPDIR)/scamper-mjl_splaytree.Tpo ../$(DEPDIR)/scamper-mjl_splaytree.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../mjl_splaytree.c' object='../scamper-mjl_splaytree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ../scamper-mjl_splaytree.obj `if test -f '../mjl_splaytree.c'; then $(CYGPATH_W) '../mjl_splaytree.c'; else $(CYGPATH_W) '$(srcdir)/../mjl_splaytree.c'; fi` ../scamper-mjl_patricia.o: ../mjl_patricia.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ../scamper-mjl_patricia.o -MD -MP -MF ../$(DEPDIR)/scamper-mjl_patricia.Tpo -c -o ../scamper-mjl_patricia.o `test -f '../mjl_patricia.c' || echo '$(srcdir)/'`../mjl_patricia.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../$(DEPDIR)/scamper-mjl_patricia.Tpo ../$(DEPDIR)/scamper-mjl_patricia.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../mjl_patricia.c' object='../scamper-mjl_patricia.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ../scamper-mjl_patricia.o `test -f '../mjl_patricia.c' || echo '$(srcdir)/'`../mjl_patricia.c ../scamper-mjl_patricia.obj: ../mjl_patricia.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ../scamper-mjl_patricia.obj -MD -MP -MF ../$(DEPDIR)/scamper-mjl_patricia.Tpo -c -o ../scamper-mjl_patricia.obj `if test -f '../mjl_patricia.c'; then $(CYGPATH_W) '../mjl_patricia.c'; else $(CYGPATH_W) '$(srcdir)/../mjl_patricia.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../$(DEPDIR)/scamper-mjl_patricia.Tpo ../$(DEPDIR)/scamper-mjl_patricia.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../mjl_patricia.c' object='../scamper-mjl_patricia.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ../scamper-mjl_patricia.obj `if test -f '../mjl_patricia.c'; then $(CYGPATH_W) '../mjl_patricia.c'; else $(CYGPATH_W) '$(srcdir)/../mjl_patricia.c'; fi` ../scamper-utils.o: ../utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ../scamper-utils.o -MD -MP -MF ../$(DEPDIR)/scamper-utils.Tpo -c -o ../scamper-utils.o `test -f '../utils.c' || echo '$(srcdir)/'`../utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../$(DEPDIR)/scamper-utils.Tpo ../$(DEPDIR)/scamper-utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../utils.c' object='../scamper-utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ../scamper-utils.o `test -f '../utils.c' || echo '$(srcdir)/'`../utils.c ../scamper-utils.obj: ../utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ../scamper-utils.obj -MD -MP -MF ../$(DEPDIR)/scamper-utils.Tpo -c -o ../scamper-utils.obj `if test -f '../utils.c'; then $(CYGPATH_W) '../utils.c'; else $(CYGPATH_W) '$(srcdir)/../utils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../$(DEPDIR)/scamper-utils.Tpo ../$(DEPDIR)/scamper-utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../utils.c' object='../scamper-utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ../scamper-utils.obj `if test -f '../utils.c'; then $(CYGPATH_W) '../utils.c'; else $(CYGPATH_W) '$(srcdir)/../utils.c'; fi` scamper-scamper.o: scamper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper.o -MD -MP -MF $(DEPDIR)/scamper-scamper.Tpo -c -o scamper-scamper.o `test -f 'scamper.c' || echo '$(srcdir)/'`scamper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper.Tpo $(DEPDIR)/scamper-scamper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper.c' object='scamper-scamper.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper.o `test -f 'scamper.c' || echo '$(srcdir)/'`scamper.c scamper-scamper.obj: scamper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper.obj -MD -MP -MF $(DEPDIR)/scamper-scamper.Tpo -c -o scamper-scamper.obj `if test -f 'scamper.c'; then $(CYGPATH_W) 'scamper.c'; else $(CYGPATH_W) '$(srcdir)/scamper.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper.Tpo $(DEPDIR)/scamper-scamper.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper.c' object='scamper-scamper.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper.obj `if test -f 'scamper.c'; then $(CYGPATH_W) 'scamper.c'; else $(CYGPATH_W) '$(srcdir)/scamper.c'; fi` scamper-scamper_osinfo.o: scamper_osinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_osinfo.o -MD -MP -MF $(DEPDIR)/scamper-scamper_osinfo.Tpo -c -o scamper-scamper_osinfo.o `test -f 'scamper_osinfo.c' || echo '$(srcdir)/'`scamper_osinfo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_osinfo.Tpo $(DEPDIR)/scamper-scamper_osinfo.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_osinfo.c' object='scamper-scamper_osinfo.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_osinfo.o `test -f 'scamper_osinfo.c' || echo '$(srcdir)/'`scamper_osinfo.c scamper-scamper_osinfo.obj: scamper_osinfo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_osinfo.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_osinfo.Tpo -c -o scamper-scamper_osinfo.obj `if test -f 'scamper_osinfo.c'; then $(CYGPATH_W) 'scamper_osinfo.c'; else $(CYGPATH_W) '$(srcdir)/scamper_osinfo.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_osinfo.Tpo $(DEPDIR)/scamper-scamper_osinfo.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_osinfo.c' object='scamper-scamper_osinfo.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_osinfo.obj `if test -f 'scamper_osinfo.c'; then $(CYGPATH_W) 'scamper_osinfo.c'; else $(CYGPATH_W) '$(srcdir)/scamper_osinfo.c'; fi` scamper-scamper_addr.o: scamper_addr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_addr.o -MD -MP -MF $(DEPDIR)/scamper-scamper_addr.Tpo -c -o scamper-scamper_addr.o `test -f 'scamper_addr.c' || echo '$(srcdir)/'`scamper_addr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_addr.Tpo $(DEPDIR)/scamper-scamper_addr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_addr.c' object='scamper-scamper_addr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_addr.o `test -f 'scamper_addr.c' || echo '$(srcdir)/'`scamper_addr.c scamper-scamper_addr.obj: scamper_addr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_addr.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_addr.Tpo -c -o scamper-scamper_addr.obj `if test -f 'scamper_addr.c'; then $(CYGPATH_W) 'scamper_addr.c'; else $(CYGPATH_W) '$(srcdir)/scamper_addr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_addr.Tpo $(DEPDIR)/scamper-scamper_addr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_addr.c' object='scamper-scamper_addr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_addr.obj `if test -f 'scamper_addr.c'; then $(CYGPATH_W) 'scamper_addr.c'; else $(CYGPATH_W) '$(srcdir)/scamper_addr.c'; fi` scamper-scamper_list.o: scamper_list.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_list.o -MD -MP -MF $(DEPDIR)/scamper-scamper_list.Tpo -c -o scamper-scamper_list.o `test -f 'scamper_list.c' || echo '$(srcdir)/'`scamper_list.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_list.Tpo $(DEPDIR)/scamper-scamper_list.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_list.c' object='scamper-scamper_list.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_list.o `test -f 'scamper_list.c' || echo '$(srcdir)/'`scamper_list.c scamper-scamper_list.obj: scamper_list.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_list.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_list.Tpo -c -o scamper-scamper_list.obj `if test -f 'scamper_list.c'; then $(CYGPATH_W) 'scamper_list.c'; else $(CYGPATH_W) '$(srcdir)/scamper_list.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_list.Tpo $(DEPDIR)/scamper-scamper_list.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_list.c' object='scamper-scamper_list.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_list.obj `if test -f 'scamper_list.c'; then $(CYGPATH_W) 'scamper_list.c'; else $(CYGPATH_W) '$(srcdir)/scamper_list.c'; fi` scamper-scamper_debug.o: scamper_debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_debug.o -MD -MP -MF $(DEPDIR)/scamper-scamper_debug.Tpo -c -o scamper-scamper_debug.o `test -f 'scamper_debug.c' || echo '$(srcdir)/'`scamper_debug.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_debug.Tpo $(DEPDIR)/scamper-scamper_debug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_debug.c' object='scamper-scamper_debug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_debug.o `test -f 'scamper_debug.c' || echo '$(srcdir)/'`scamper_debug.c scamper-scamper_debug.obj: scamper_debug.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_debug.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_debug.Tpo -c -o scamper-scamper_debug.obj `if test -f 'scamper_debug.c'; then $(CYGPATH_W) 'scamper_debug.c'; else $(CYGPATH_W) '$(srcdir)/scamper_debug.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_debug.Tpo $(DEPDIR)/scamper-scamper_debug.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_debug.c' object='scamper-scamper_debug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_debug.obj `if test -f 'scamper_debug.c'; then $(CYGPATH_W) 'scamper_debug.c'; else $(CYGPATH_W) '$(srcdir)/scamper_debug.c'; fi` scamper-scamper_udp4.o: scamper_udp4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_udp4.o -MD -MP -MF $(DEPDIR)/scamper-scamper_udp4.Tpo -c -o scamper-scamper_udp4.o `test -f 'scamper_udp4.c' || echo '$(srcdir)/'`scamper_udp4.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_udp4.Tpo $(DEPDIR)/scamper-scamper_udp4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_udp4.c' object='scamper-scamper_udp4.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_udp4.o `test -f 'scamper_udp4.c' || echo '$(srcdir)/'`scamper_udp4.c scamper-scamper_udp4.obj: scamper_udp4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_udp4.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_udp4.Tpo -c -o scamper-scamper_udp4.obj `if test -f 'scamper_udp4.c'; then $(CYGPATH_W) 'scamper_udp4.c'; else $(CYGPATH_W) '$(srcdir)/scamper_udp4.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_udp4.Tpo $(DEPDIR)/scamper-scamper_udp4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_udp4.c' object='scamper-scamper_udp4.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_udp4.obj `if test -f 'scamper_udp4.c'; then $(CYGPATH_W) 'scamper_udp4.c'; else $(CYGPATH_W) '$(srcdir)/scamper_udp4.c'; fi` scamper-scamper_udp6.o: scamper_udp6.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_udp6.o -MD -MP -MF $(DEPDIR)/scamper-scamper_udp6.Tpo -c -o scamper-scamper_udp6.o `test -f 'scamper_udp6.c' || echo '$(srcdir)/'`scamper_udp6.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_udp6.Tpo $(DEPDIR)/scamper-scamper_udp6.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_udp6.c' object='scamper-scamper_udp6.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_udp6.o `test -f 'scamper_udp6.c' || echo '$(srcdir)/'`scamper_udp6.c scamper-scamper_udp6.obj: scamper_udp6.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_udp6.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_udp6.Tpo -c -o scamper-scamper_udp6.obj `if test -f 'scamper_udp6.c'; then $(CYGPATH_W) 'scamper_udp6.c'; else $(CYGPATH_W) '$(srcdir)/scamper_udp6.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_udp6.Tpo $(DEPDIR)/scamper-scamper_udp6.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_udp6.c' object='scamper-scamper_udp6.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_udp6.obj `if test -f 'scamper_udp6.c'; then $(CYGPATH_W) 'scamper_udp6.c'; else $(CYGPATH_W) '$(srcdir)/scamper_udp6.c'; fi` scamper-scamper_icmp4.o: scamper_icmp4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_icmp4.o -MD -MP -MF $(DEPDIR)/scamper-scamper_icmp4.Tpo -c -o scamper-scamper_icmp4.o `test -f 'scamper_icmp4.c' || echo '$(srcdir)/'`scamper_icmp4.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_icmp4.Tpo $(DEPDIR)/scamper-scamper_icmp4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_icmp4.c' object='scamper-scamper_icmp4.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_icmp4.o `test -f 'scamper_icmp4.c' || echo '$(srcdir)/'`scamper_icmp4.c scamper-scamper_icmp4.obj: scamper_icmp4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_icmp4.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_icmp4.Tpo -c -o scamper-scamper_icmp4.obj `if test -f 'scamper_icmp4.c'; then $(CYGPATH_W) 'scamper_icmp4.c'; else $(CYGPATH_W) '$(srcdir)/scamper_icmp4.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_icmp4.Tpo $(DEPDIR)/scamper-scamper_icmp4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_icmp4.c' object='scamper-scamper_icmp4.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_icmp4.obj `if test -f 'scamper_icmp4.c'; then $(CYGPATH_W) 'scamper_icmp4.c'; else $(CYGPATH_W) '$(srcdir)/scamper_icmp4.c'; fi` scamper-scamper_icmp6.o: scamper_icmp6.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_icmp6.o -MD -MP -MF $(DEPDIR)/scamper-scamper_icmp6.Tpo -c -o scamper-scamper_icmp6.o `test -f 'scamper_icmp6.c' || echo '$(srcdir)/'`scamper_icmp6.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_icmp6.Tpo $(DEPDIR)/scamper-scamper_icmp6.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_icmp6.c' object='scamper-scamper_icmp6.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_icmp6.o `test -f 'scamper_icmp6.c' || echo '$(srcdir)/'`scamper_icmp6.c scamper-scamper_icmp6.obj: scamper_icmp6.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_icmp6.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_icmp6.Tpo -c -o scamper-scamper_icmp6.obj `if test -f 'scamper_icmp6.c'; then $(CYGPATH_W) 'scamper_icmp6.c'; else $(CYGPATH_W) '$(srcdir)/scamper_icmp6.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_icmp6.Tpo $(DEPDIR)/scamper-scamper_icmp6.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_icmp6.c' object='scamper-scamper_icmp6.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_icmp6.obj `if test -f 'scamper_icmp6.c'; then $(CYGPATH_W) 'scamper_icmp6.c'; else $(CYGPATH_W) '$(srcdir)/scamper_icmp6.c'; fi` scamper-scamper_icmp_resp.o: scamper_icmp_resp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_icmp_resp.o -MD -MP -MF $(DEPDIR)/scamper-scamper_icmp_resp.Tpo -c -o scamper-scamper_icmp_resp.o `test -f 'scamper_icmp_resp.c' || echo '$(srcdir)/'`scamper_icmp_resp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_icmp_resp.Tpo $(DEPDIR)/scamper-scamper_icmp_resp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_icmp_resp.c' object='scamper-scamper_icmp_resp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_icmp_resp.o `test -f 'scamper_icmp_resp.c' || echo '$(srcdir)/'`scamper_icmp_resp.c scamper-scamper_icmp_resp.obj: scamper_icmp_resp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_icmp_resp.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_icmp_resp.Tpo -c -o scamper-scamper_icmp_resp.obj `if test -f 'scamper_icmp_resp.c'; then $(CYGPATH_W) 'scamper_icmp_resp.c'; else $(CYGPATH_W) '$(srcdir)/scamper_icmp_resp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_icmp_resp.Tpo $(DEPDIR)/scamper-scamper_icmp_resp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_icmp_resp.c' object='scamper-scamper_icmp_resp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_icmp_resp.obj `if test -f 'scamper_icmp_resp.c'; then $(CYGPATH_W) 'scamper_icmp_resp.c'; else $(CYGPATH_W) '$(srcdir)/scamper_icmp_resp.c'; fi` scamper-scamper_icmpext.o: scamper_icmpext.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_icmpext.o -MD -MP -MF $(DEPDIR)/scamper-scamper_icmpext.Tpo -c -o scamper-scamper_icmpext.o `test -f 'scamper_icmpext.c' || echo '$(srcdir)/'`scamper_icmpext.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_icmpext.Tpo $(DEPDIR)/scamper-scamper_icmpext.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_icmpext.c' object='scamper-scamper_icmpext.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_icmpext.o `test -f 'scamper_icmpext.c' || echo '$(srcdir)/'`scamper_icmpext.c scamper-scamper_icmpext.obj: scamper_icmpext.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_icmpext.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_icmpext.Tpo -c -o scamper-scamper_icmpext.obj `if test -f 'scamper_icmpext.c'; then $(CYGPATH_W) 'scamper_icmpext.c'; else $(CYGPATH_W) '$(srcdir)/scamper_icmpext.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_icmpext.Tpo $(DEPDIR)/scamper-scamper_icmpext.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_icmpext.c' object='scamper-scamper_icmpext.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_icmpext.obj `if test -f 'scamper_icmpext.c'; then $(CYGPATH_W) 'scamper_icmpext.c'; else $(CYGPATH_W) '$(srcdir)/scamper_icmpext.c'; fi` scamper-scamper_tcp4.o: scamper_tcp4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_tcp4.o -MD -MP -MF $(DEPDIR)/scamper-scamper_tcp4.Tpo -c -o scamper-scamper_tcp4.o `test -f 'scamper_tcp4.c' || echo '$(srcdir)/'`scamper_tcp4.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_tcp4.Tpo $(DEPDIR)/scamper-scamper_tcp4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_tcp4.c' object='scamper-scamper_tcp4.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_tcp4.o `test -f 'scamper_tcp4.c' || echo '$(srcdir)/'`scamper_tcp4.c scamper-scamper_tcp4.obj: scamper_tcp4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_tcp4.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_tcp4.Tpo -c -o scamper-scamper_tcp4.obj `if test -f 'scamper_tcp4.c'; then $(CYGPATH_W) 'scamper_tcp4.c'; else $(CYGPATH_W) '$(srcdir)/scamper_tcp4.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_tcp4.Tpo $(DEPDIR)/scamper-scamper_tcp4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_tcp4.c' object='scamper-scamper_tcp4.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_tcp4.obj `if test -f 'scamper_tcp4.c'; then $(CYGPATH_W) 'scamper_tcp4.c'; else $(CYGPATH_W) '$(srcdir)/scamper_tcp4.c'; fi` scamper-scamper_tcp6.o: scamper_tcp6.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_tcp6.o -MD -MP -MF $(DEPDIR)/scamper-scamper_tcp6.Tpo -c -o scamper-scamper_tcp6.o `test -f 'scamper_tcp6.c' || echo '$(srcdir)/'`scamper_tcp6.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_tcp6.Tpo $(DEPDIR)/scamper-scamper_tcp6.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_tcp6.c' object='scamper-scamper_tcp6.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_tcp6.o `test -f 'scamper_tcp6.c' || echo '$(srcdir)/'`scamper_tcp6.c scamper-scamper_tcp6.obj: scamper_tcp6.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_tcp6.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_tcp6.Tpo -c -o scamper-scamper_tcp6.obj `if test -f 'scamper_tcp6.c'; then $(CYGPATH_W) 'scamper_tcp6.c'; else $(CYGPATH_W) '$(srcdir)/scamper_tcp6.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_tcp6.Tpo $(DEPDIR)/scamper-scamper_tcp6.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_tcp6.c' object='scamper-scamper_tcp6.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_tcp6.obj `if test -f 'scamper_tcp6.c'; then $(CYGPATH_W) 'scamper_tcp6.c'; else $(CYGPATH_W) '$(srcdir)/scamper_tcp6.c'; fi` scamper-scamper_ip6.o: scamper_ip6.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_ip6.o -MD -MP -MF $(DEPDIR)/scamper-scamper_ip6.Tpo -c -o scamper-scamper_ip6.o `test -f 'scamper_ip6.c' || echo '$(srcdir)/'`scamper_ip6.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_ip6.Tpo $(DEPDIR)/scamper-scamper_ip6.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_ip6.c' object='scamper-scamper_ip6.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_ip6.o `test -f 'scamper_ip6.c' || echo '$(srcdir)/'`scamper_ip6.c scamper-scamper_ip6.obj: scamper_ip6.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_ip6.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_ip6.Tpo -c -o scamper-scamper_ip6.obj `if test -f 'scamper_ip6.c'; then $(CYGPATH_W) 'scamper_ip6.c'; else $(CYGPATH_W) '$(srcdir)/scamper_ip6.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_ip6.Tpo $(DEPDIR)/scamper-scamper_ip6.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_ip6.c' object='scamper-scamper_ip6.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_ip6.obj `if test -f 'scamper_ip6.c'; then $(CYGPATH_W) 'scamper_ip6.c'; else $(CYGPATH_W) '$(srcdir)/scamper_ip6.c'; fi` scamper-scamper_ip4.o: scamper_ip4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_ip4.o -MD -MP -MF $(DEPDIR)/scamper-scamper_ip4.Tpo -c -o scamper-scamper_ip4.o `test -f 'scamper_ip4.c' || echo '$(srcdir)/'`scamper_ip4.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_ip4.Tpo $(DEPDIR)/scamper-scamper_ip4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_ip4.c' object='scamper-scamper_ip4.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_ip4.o `test -f 'scamper_ip4.c' || echo '$(srcdir)/'`scamper_ip4.c scamper-scamper_ip4.obj: scamper_ip4.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_ip4.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_ip4.Tpo -c -o scamper-scamper_ip4.obj `if test -f 'scamper_ip4.c'; then $(CYGPATH_W) 'scamper_ip4.c'; else $(CYGPATH_W) '$(srcdir)/scamper_ip4.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_ip4.Tpo $(DEPDIR)/scamper-scamper_ip4.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_ip4.c' object='scamper-scamper_ip4.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_ip4.obj `if test -f 'scamper_ip4.c'; then $(CYGPATH_W) 'scamper_ip4.c'; else $(CYGPATH_W) '$(srcdir)/scamper_ip4.c'; fi` scamper-scamper_if.o: scamper_if.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_if.o -MD -MP -MF $(DEPDIR)/scamper-scamper_if.Tpo -c -o scamper-scamper_if.o `test -f 'scamper_if.c' || echo '$(srcdir)/'`scamper_if.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_if.Tpo $(DEPDIR)/scamper-scamper_if.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_if.c' object='scamper-scamper_if.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_if.o `test -f 'scamper_if.c' || echo '$(srcdir)/'`scamper_if.c scamper-scamper_if.obj: scamper_if.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_if.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_if.Tpo -c -o scamper-scamper_if.obj `if test -f 'scamper_if.c'; then $(CYGPATH_W) 'scamper_if.c'; else $(CYGPATH_W) '$(srcdir)/scamper_if.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_if.Tpo $(DEPDIR)/scamper-scamper_if.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_if.c' object='scamper-scamper_if.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_if.obj `if test -f 'scamper_if.c'; then $(CYGPATH_W) 'scamper_if.c'; else $(CYGPATH_W) '$(srcdir)/scamper_if.c'; fi` scamper-scamper_rtsock.o: scamper_rtsock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_rtsock.o -MD -MP -MF $(DEPDIR)/scamper-scamper_rtsock.Tpo -c -o scamper-scamper_rtsock.o `test -f 'scamper_rtsock.c' || echo '$(srcdir)/'`scamper_rtsock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_rtsock.Tpo $(DEPDIR)/scamper-scamper_rtsock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_rtsock.c' object='scamper-scamper_rtsock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_rtsock.o `test -f 'scamper_rtsock.c' || echo '$(srcdir)/'`scamper_rtsock.c scamper-scamper_rtsock.obj: scamper_rtsock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_rtsock.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_rtsock.Tpo -c -o scamper-scamper_rtsock.obj `if test -f 'scamper_rtsock.c'; then $(CYGPATH_W) 'scamper_rtsock.c'; else $(CYGPATH_W) '$(srcdir)/scamper_rtsock.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_rtsock.Tpo $(DEPDIR)/scamper-scamper_rtsock.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_rtsock.c' object='scamper-scamper_rtsock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_rtsock.obj `if test -f 'scamper_rtsock.c'; then $(CYGPATH_W) 'scamper_rtsock.c'; else $(CYGPATH_W) '$(srcdir)/scamper_rtsock.c'; fi` scamper-scamper_dl.o: scamper_dl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_dl.o -MD -MP -MF $(DEPDIR)/scamper-scamper_dl.Tpo -c -o scamper-scamper_dl.o `test -f 'scamper_dl.c' || echo '$(srcdir)/'`scamper_dl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_dl.Tpo $(DEPDIR)/scamper-scamper_dl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_dl.c' object='scamper-scamper_dl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_dl.o `test -f 'scamper_dl.c' || echo '$(srcdir)/'`scamper_dl.c scamper-scamper_dl.obj: scamper_dl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_dl.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_dl.Tpo -c -o scamper-scamper_dl.obj `if test -f 'scamper_dl.c'; then $(CYGPATH_W) 'scamper_dl.c'; else $(CYGPATH_W) '$(srcdir)/scamper_dl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_dl.Tpo $(DEPDIR)/scamper-scamper_dl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_dl.c' object='scamper-scamper_dl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_dl.obj `if test -f 'scamper_dl.c'; then $(CYGPATH_W) 'scamper_dl.c'; else $(CYGPATH_W) '$(srcdir)/scamper_dl.c'; fi` scamper-scamper_addr2mac.o: scamper_addr2mac.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_addr2mac.o -MD -MP -MF $(DEPDIR)/scamper-scamper_addr2mac.Tpo -c -o scamper-scamper_addr2mac.o `test -f 'scamper_addr2mac.c' || echo '$(srcdir)/'`scamper_addr2mac.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_addr2mac.Tpo $(DEPDIR)/scamper-scamper_addr2mac.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_addr2mac.c' object='scamper-scamper_addr2mac.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_addr2mac.o `test -f 'scamper_addr2mac.c' || echo '$(srcdir)/'`scamper_addr2mac.c scamper-scamper_addr2mac.obj: scamper_addr2mac.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_addr2mac.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_addr2mac.Tpo -c -o scamper-scamper_addr2mac.obj `if test -f 'scamper_addr2mac.c'; then $(CYGPATH_W) 'scamper_addr2mac.c'; else $(CYGPATH_W) '$(srcdir)/scamper_addr2mac.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_addr2mac.Tpo $(DEPDIR)/scamper-scamper_addr2mac.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_addr2mac.c' object='scamper-scamper_addr2mac.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_addr2mac.obj `if test -f 'scamper_addr2mac.c'; then $(CYGPATH_W) 'scamper_addr2mac.c'; else $(CYGPATH_W) '$(srcdir)/scamper_addr2mac.c'; fi` scamper-scamper_fds.o: scamper_fds.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_fds.o -MD -MP -MF $(DEPDIR)/scamper-scamper_fds.Tpo -c -o scamper-scamper_fds.o `test -f 'scamper_fds.c' || echo '$(srcdir)/'`scamper_fds.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_fds.Tpo $(DEPDIR)/scamper-scamper_fds.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_fds.c' object='scamper-scamper_fds.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_fds.o `test -f 'scamper_fds.c' || echo '$(srcdir)/'`scamper_fds.c scamper-scamper_fds.obj: scamper_fds.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_fds.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_fds.Tpo -c -o scamper-scamper_fds.obj `if test -f 'scamper_fds.c'; then $(CYGPATH_W) 'scamper_fds.c'; else $(CYGPATH_W) '$(srcdir)/scamper_fds.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_fds.Tpo $(DEPDIR)/scamper-scamper_fds.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_fds.c' object='scamper-scamper_fds.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_fds.obj `if test -f 'scamper_fds.c'; then $(CYGPATH_W) 'scamper_fds.c'; else $(CYGPATH_W) '$(srcdir)/scamper_fds.c'; fi` scamper-scamper_linepoll.o: scamper_linepoll.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_linepoll.o -MD -MP -MF $(DEPDIR)/scamper-scamper_linepoll.Tpo -c -o scamper-scamper_linepoll.o `test -f 'scamper_linepoll.c' || echo '$(srcdir)/'`scamper_linepoll.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_linepoll.Tpo $(DEPDIR)/scamper-scamper_linepoll.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_linepoll.c' object='scamper-scamper_linepoll.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_linepoll.o `test -f 'scamper_linepoll.c' || echo '$(srcdir)/'`scamper_linepoll.c scamper-scamper_linepoll.obj: scamper_linepoll.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_linepoll.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_linepoll.Tpo -c -o scamper-scamper_linepoll.obj `if test -f 'scamper_linepoll.c'; then $(CYGPATH_W) 'scamper_linepoll.c'; else $(CYGPATH_W) '$(srcdir)/scamper_linepoll.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_linepoll.Tpo $(DEPDIR)/scamper-scamper_linepoll.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_linepoll.c' object='scamper-scamper_linepoll.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_linepoll.obj `if test -f 'scamper_linepoll.c'; then $(CYGPATH_W) 'scamper_linepoll.c'; else $(CYGPATH_W) '$(srcdir)/scamper_linepoll.c'; fi` scamper-scamper_writebuf.o: scamper_writebuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_writebuf.o -MD -MP -MF $(DEPDIR)/scamper-scamper_writebuf.Tpo -c -o scamper-scamper_writebuf.o `test -f 'scamper_writebuf.c' || echo '$(srcdir)/'`scamper_writebuf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_writebuf.Tpo $(DEPDIR)/scamper-scamper_writebuf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_writebuf.c' object='scamper-scamper_writebuf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_writebuf.o `test -f 'scamper_writebuf.c' || echo '$(srcdir)/'`scamper_writebuf.c scamper-scamper_writebuf.obj: scamper_writebuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_writebuf.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_writebuf.Tpo -c -o scamper-scamper_writebuf.obj `if test -f 'scamper_writebuf.c'; then $(CYGPATH_W) 'scamper_writebuf.c'; else $(CYGPATH_W) '$(srcdir)/scamper_writebuf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_writebuf.Tpo $(DEPDIR)/scamper-scamper_writebuf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_writebuf.c' object='scamper-scamper_writebuf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_writebuf.obj `if test -f 'scamper_writebuf.c'; then $(CYGPATH_W) 'scamper_writebuf.c'; else $(CYGPATH_W) '$(srcdir)/scamper_writebuf.c'; fi` scamper-scamper_dlhdr.o: scamper_dlhdr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_dlhdr.o -MD -MP -MF $(DEPDIR)/scamper-scamper_dlhdr.Tpo -c -o scamper-scamper_dlhdr.o `test -f 'scamper_dlhdr.c' || echo '$(srcdir)/'`scamper_dlhdr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_dlhdr.Tpo $(DEPDIR)/scamper-scamper_dlhdr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_dlhdr.c' object='scamper-scamper_dlhdr.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_dlhdr.o `test -f 'scamper_dlhdr.c' || echo '$(srcdir)/'`scamper_dlhdr.c scamper-scamper_dlhdr.obj: scamper_dlhdr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_dlhdr.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_dlhdr.Tpo -c -o scamper-scamper_dlhdr.obj `if test -f 'scamper_dlhdr.c'; then $(CYGPATH_W) 'scamper_dlhdr.c'; else $(CYGPATH_W) '$(srcdir)/scamper_dlhdr.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_dlhdr.Tpo $(DEPDIR)/scamper-scamper_dlhdr.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_dlhdr.c' object='scamper-scamper_dlhdr.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_dlhdr.obj `if test -f 'scamper_dlhdr.c'; then $(CYGPATH_W) 'scamper_dlhdr.c'; else $(CYGPATH_W) '$(srcdir)/scamper_dlhdr.c'; fi` scamper-scamper_privsep.o: scamper_privsep.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_privsep.o -MD -MP -MF $(DEPDIR)/scamper-scamper_privsep.Tpo -c -o scamper-scamper_privsep.o `test -f 'scamper_privsep.c' || echo '$(srcdir)/'`scamper_privsep.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_privsep.Tpo $(DEPDIR)/scamper-scamper_privsep.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_privsep.c' object='scamper-scamper_privsep.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_privsep.o `test -f 'scamper_privsep.c' || echo '$(srcdir)/'`scamper_privsep.c scamper-scamper_privsep.obj: scamper_privsep.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_privsep.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_privsep.Tpo -c -o scamper-scamper_privsep.obj `if test -f 'scamper_privsep.c'; then $(CYGPATH_W) 'scamper_privsep.c'; else $(CYGPATH_W) '$(srcdir)/scamper_privsep.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_privsep.Tpo $(DEPDIR)/scamper-scamper_privsep.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_privsep.c' object='scamper-scamper_privsep.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_privsep.obj `if test -f 'scamper_privsep.c'; then $(CYGPATH_W) 'scamper_privsep.c'; else $(CYGPATH_W) '$(srcdir)/scamper_privsep.c'; fi` scamper-scamper_getsrc.o: scamper_getsrc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_getsrc.o -MD -MP -MF $(DEPDIR)/scamper-scamper_getsrc.Tpo -c -o scamper-scamper_getsrc.o `test -f 'scamper_getsrc.c' || echo '$(srcdir)/'`scamper_getsrc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_getsrc.Tpo $(DEPDIR)/scamper-scamper_getsrc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_getsrc.c' object='scamper-scamper_getsrc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_getsrc.o `test -f 'scamper_getsrc.c' || echo '$(srcdir)/'`scamper_getsrc.c scamper-scamper_getsrc.obj: scamper_getsrc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_getsrc.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_getsrc.Tpo -c -o scamper-scamper_getsrc.obj `if test -f 'scamper_getsrc.c'; then $(CYGPATH_W) 'scamper_getsrc.c'; else $(CYGPATH_W) '$(srcdir)/scamper_getsrc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_getsrc.Tpo $(DEPDIR)/scamper-scamper_getsrc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_getsrc.c' object='scamper-scamper_getsrc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_getsrc.obj `if test -f 'scamper_getsrc.c'; then $(CYGPATH_W) 'scamper_getsrc.c'; else $(CYGPATH_W) '$(srcdir)/scamper_getsrc.c'; fi` scamper-scamper_control.o: scamper_control.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_control.o -MD -MP -MF $(DEPDIR)/scamper-scamper_control.Tpo -c -o scamper-scamper_control.o `test -f 'scamper_control.c' || echo '$(srcdir)/'`scamper_control.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_control.Tpo $(DEPDIR)/scamper-scamper_control.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_control.c' object='scamper-scamper_control.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_control.o `test -f 'scamper_control.c' || echo '$(srcdir)/'`scamper_control.c scamper-scamper_control.obj: scamper_control.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_control.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_control.Tpo -c -o scamper-scamper_control.obj `if test -f 'scamper_control.c'; then $(CYGPATH_W) 'scamper_control.c'; else $(CYGPATH_W) '$(srcdir)/scamper_control.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_control.Tpo $(DEPDIR)/scamper-scamper_control.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_control.c' object='scamper-scamper_control.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_control.obj `if test -f 'scamper_control.c'; then $(CYGPATH_W) 'scamper_control.c'; else $(CYGPATH_W) '$(srcdir)/scamper_control.c'; fi` scamper-scamper_firewall.o: scamper_firewall.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_firewall.o -MD -MP -MF $(DEPDIR)/scamper-scamper_firewall.Tpo -c -o scamper-scamper_firewall.o `test -f 'scamper_firewall.c' || echo '$(srcdir)/'`scamper_firewall.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_firewall.Tpo $(DEPDIR)/scamper-scamper_firewall.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_firewall.c' object='scamper-scamper_firewall.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_firewall.o `test -f 'scamper_firewall.c' || echo '$(srcdir)/'`scamper_firewall.c scamper-scamper_firewall.obj: scamper_firewall.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_firewall.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_firewall.Tpo -c -o scamper-scamper_firewall.obj `if test -f 'scamper_firewall.c'; then $(CYGPATH_W) 'scamper_firewall.c'; else $(CYGPATH_W) '$(srcdir)/scamper_firewall.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_firewall.Tpo $(DEPDIR)/scamper-scamper_firewall.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_firewall.c' object='scamper-scamper_firewall.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_firewall.obj `if test -f 'scamper_firewall.c'; then $(CYGPATH_W) 'scamper_firewall.c'; else $(CYGPATH_W) '$(srcdir)/scamper_firewall.c'; fi` scamper-scamper_outfiles.o: scamper_outfiles.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_outfiles.o -MD -MP -MF $(DEPDIR)/scamper-scamper_outfiles.Tpo -c -o scamper-scamper_outfiles.o `test -f 'scamper_outfiles.c' || echo '$(srcdir)/'`scamper_outfiles.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_outfiles.Tpo $(DEPDIR)/scamper-scamper_outfiles.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_outfiles.c' object='scamper-scamper_outfiles.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_outfiles.o `test -f 'scamper_outfiles.c' || echo '$(srcdir)/'`scamper_outfiles.c scamper-scamper_outfiles.obj: scamper_outfiles.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_outfiles.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_outfiles.Tpo -c -o scamper-scamper_outfiles.obj `if test -f 'scamper_outfiles.c'; then $(CYGPATH_W) 'scamper_outfiles.c'; else $(CYGPATH_W) '$(srcdir)/scamper_outfiles.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_outfiles.Tpo $(DEPDIR)/scamper-scamper_outfiles.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_outfiles.c' object='scamper-scamper_outfiles.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_outfiles.obj `if test -f 'scamper_outfiles.c'; then $(CYGPATH_W) 'scamper_outfiles.c'; else $(CYGPATH_W) '$(srcdir)/scamper_outfiles.c'; fi` scamper-scamper_probe.o: scamper_probe.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_probe.o -MD -MP -MF $(DEPDIR)/scamper-scamper_probe.Tpo -c -o scamper-scamper_probe.o `test -f 'scamper_probe.c' || echo '$(srcdir)/'`scamper_probe.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_probe.Tpo $(DEPDIR)/scamper-scamper_probe.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_probe.c' object='scamper-scamper_probe.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_probe.o `test -f 'scamper_probe.c' || echo '$(srcdir)/'`scamper_probe.c scamper-scamper_probe.obj: scamper_probe.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_probe.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_probe.Tpo -c -o scamper-scamper_probe.obj `if test -f 'scamper_probe.c'; then $(CYGPATH_W) 'scamper_probe.c'; else $(CYGPATH_W) '$(srcdir)/scamper_probe.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_probe.Tpo $(DEPDIR)/scamper-scamper_probe.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_probe.c' object='scamper-scamper_probe.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_probe.obj `if test -f 'scamper_probe.c'; then $(CYGPATH_W) 'scamper_probe.c'; else $(CYGPATH_W) '$(srcdir)/scamper_probe.c'; fi` scamper-scamper_task.o: scamper_task.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_task.o -MD -MP -MF $(DEPDIR)/scamper-scamper_task.Tpo -c -o scamper-scamper_task.o `test -f 'scamper_task.c' || echo '$(srcdir)/'`scamper_task.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_task.Tpo $(DEPDIR)/scamper-scamper_task.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_task.c' object='scamper-scamper_task.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_task.o `test -f 'scamper_task.c' || echo '$(srcdir)/'`scamper_task.c scamper-scamper_task.obj: scamper_task.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_task.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_task.Tpo -c -o scamper-scamper_task.obj `if test -f 'scamper_task.c'; then $(CYGPATH_W) 'scamper_task.c'; else $(CYGPATH_W) '$(srcdir)/scamper_task.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_task.Tpo $(DEPDIR)/scamper-scamper_task.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_task.c' object='scamper-scamper_task.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_task.obj `if test -f 'scamper_task.c'; then $(CYGPATH_W) 'scamper_task.c'; else $(CYGPATH_W) '$(srcdir)/scamper_task.c'; fi` scamper-scamper_queue.o: scamper_queue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_queue.o -MD -MP -MF $(DEPDIR)/scamper-scamper_queue.Tpo -c -o scamper-scamper_queue.o `test -f 'scamper_queue.c' || echo '$(srcdir)/'`scamper_queue.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_queue.Tpo $(DEPDIR)/scamper-scamper_queue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_queue.c' object='scamper-scamper_queue.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_queue.o `test -f 'scamper_queue.c' || echo '$(srcdir)/'`scamper_queue.c scamper-scamper_queue.obj: scamper_queue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_queue.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_queue.Tpo -c -o scamper-scamper_queue.obj `if test -f 'scamper_queue.c'; then $(CYGPATH_W) 'scamper_queue.c'; else $(CYGPATH_W) '$(srcdir)/scamper_queue.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_queue.Tpo $(DEPDIR)/scamper-scamper_queue.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_queue.c' object='scamper-scamper_queue.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_queue.obj `if test -f 'scamper_queue.c'; then $(CYGPATH_W) 'scamper_queue.c'; else $(CYGPATH_W) '$(srcdir)/scamper_queue.c'; fi` scamper-scamper_cyclemon.o: scamper_cyclemon.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_cyclemon.o -MD -MP -MF $(DEPDIR)/scamper-scamper_cyclemon.Tpo -c -o scamper-scamper_cyclemon.o `test -f 'scamper_cyclemon.c' || echo '$(srcdir)/'`scamper_cyclemon.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_cyclemon.Tpo $(DEPDIR)/scamper-scamper_cyclemon.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_cyclemon.c' object='scamper-scamper_cyclemon.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_cyclemon.o `test -f 'scamper_cyclemon.c' || echo '$(srcdir)/'`scamper_cyclemon.c scamper-scamper_cyclemon.obj: scamper_cyclemon.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_cyclemon.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_cyclemon.Tpo -c -o scamper-scamper_cyclemon.obj `if test -f 'scamper_cyclemon.c'; then $(CYGPATH_W) 'scamper_cyclemon.c'; else $(CYGPATH_W) '$(srcdir)/scamper_cyclemon.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_cyclemon.Tpo $(DEPDIR)/scamper-scamper_cyclemon.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_cyclemon.c' object='scamper-scamper_cyclemon.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_cyclemon.obj `if test -f 'scamper_cyclemon.c'; then $(CYGPATH_W) 'scamper_cyclemon.c'; else $(CYGPATH_W) '$(srcdir)/scamper_cyclemon.c'; fi` scamper-scamper_options.o: scamper_options.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_options.o -MD -MP -MF $(DEPDIR)/scamper-scamper_options.Tpo -c -o scamper-scamper_options.o `test -f 'scamper_options.c' || echo '$(srcdir)/'`scamper_options.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_options.Tpo $(DEPDIR)/scamper-scamper_options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_options.c' object='scamper-scamper_options.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_options.o `test -f 'scamper_options.c' || echo '$(srcdir)/'`scamper_options.c scamper-scamper_options.obj: scamper_options.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_options.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_options.Tpo -c -o scamper-scamper_options.obj `if test -f 'scamper_options.c'; then $(CYGPATH_W) 'scamper_options.c'; else $(CYGPATH_W) '$(srcdir)/scamper_options.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_options.Tpo $(DEPDIR)/scamper-scamper_options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_options.c' object='scamper-scamper_options.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_options.obj `if test -f 'scamper_options.c'; then $(CYGPATH_W) 'scamper_options.c'; else $(CYGPATH_W) '$(srcdir)/scamper_options.c'; fi` scamper-scamper_file.o: scamper_file.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_file.o -MD -MP -MF $(DEPDIR)/scamper-scamper_file.Tpo -c -o scamper-scamper_file.o `test -f 'scamper_file.c' || echo '$(srcdir)/'`scamper_file.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_file.Tpo $(DEPDIR)/scamper-scamper_file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_file.c' object='scamper-scamper_file.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_file.o `test -f 'scamper_file.c' || echo '$(srcdir)/'`scamper_file.c scamper-scamper_file.obj: scamper_file.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_file.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_file.Tpo -c -o scamper-scamper_file.obj `if test -f 'scamper_file.c'; then $(CYGPATH_W) 'scamper_file.c'; else $(CYGPATH_W) '$(srcdir)/scamper_file.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_file.Tpo $(DEPDIR)/scamper-scamper_file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_file.c' object='scamper-scamper_file.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_file.obj `if test -f 'scamper_file.c'; then $(CYGPATH_W) 'scamper_file.c'; else $(CYGPATH_W) '$(srcdir)/scamper_file.c'; fi` scamper-scamper_file_arts.o: scamper_file_arts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_file_arts.o -MD -MP -MF $(DEPDIR)/scamper-scamper_file_arts.Tpo -c -o scamper-scamper_file_arts.o `test -f 'scamper_file_arts.c' || echo '$(srcdir)/'`scamper_file_arts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_file_arts.Tpo $(DEPDIR)/scamper-scamper_file_arts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_file_arts.c' object='scamper-scamper_file_arts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_file_arts.o `test -f 'scamper_file_arts.c' || echo '$(srcdir)/'`scamper_file_arts.c scamper-scamper_file_arts.obj: scamper_file_arts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_file_arts.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_file_arts.Tpo -c -o scamper-scamper_file_arts.obj `if test -f 'scamper_file_arts.c'; then $(CYGPATH_W) 'scamper_file_arts.c'; else $(CYGPATH_W) '$(srcdir)/scamper_file_arts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_file_arts.Tpo $(DEPDIR)/scamper-scamper_file_arts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_file_arts.c' object='scamper-scamper_file_arts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_file_arts.obj `if test -f 'scamper_file_arts.c'; then $(CYGPATH_W) 'scamper_file_arts.c'; else $(CYGPATH_W) '$(srcdir)/scamper_file_arts.c'; fi` scamper-scamper_file_warts.o: scamper_file_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_file_warts.o -MD -MP -MF $(DEPDIR)/scamper-scamper_file_warts.Tpo -c -o scamper-scamper_file_warts.o `test -f 'scamper_file_warts.c' || echo '$(srcdir)/'`scamper_file_warts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_file_warts.Tpo $(DEPDIR)/scamper-scamper_file_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_file_warts.c' object='scamper-scamper_file_warts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_file_warts.o `test -f 'scamper_file_warts.c' || echo '$(srcdir)/'`scamper_file_warts.c scamper-scamper_file_warts.obj: scamper_file_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_file_warts.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_file_warts.Tpo -c -o scamper-scamper_file_warts.obj `if test -f 'scamper_file_warts.c'; then $(CYGPATH_W) 'scamper_file_warts.c'; else $(CYGPATH_W) '$(srcdir)/scamper_file_warts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_file_warts.Tpo $(DEPDIR)/scamper-scamper_file_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_file_warts.c' object='scamper-scamper_file_warts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_file_warts.obj `if test -f 'scamper_file_warts.c'; then $(CYGPATH_W) 'scamper_file_warts.c'; else $(CYGPATH_W) '$(srcdir)/scamper_file_warts.c'; fi` scamper-scamper_file_text.o: scamper_file_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_file_text.o -MD -MP -MF $(DEPDIR)/scamper-scamper_file_text.Tpo -c -o scamper-scamper_file_text.o `test -f 'scamper_file_text.c' || echo '$(srcdir)/'`scamper_file_text.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_file_text.Tpo $(DEPDIR)/scamper-scamper_file_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_file_text.c' object='scamper-scamper_file_text.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_file_text.o `test -f 'scamper_file_text.c' || echo '$(srcdir)/'`scamper_file_text.c scamper-scamper_file_text.obj: scamper_file_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_file_text.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_file_text.Tpo -c -o scamper-scamper_file_text.obj `if test -f 'scamper_file_text.c'; then $(CYGPATH_W) 'scamper_file_text.c'; else $(CYGPATH_W) '$(srcdir)/scamper_file_text.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_file_text.Tpo $(DEPDIR)/scamper-scamper_file_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_file_text.c' object='scamper-scamper_file_text.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_file_text.obj `if test -f 'scamper_file_text.c'; then $(CYGPATH_W) 'scamper_file_text.c'; else $(CYGPATH_W) '$(srcdir)/scamper_file_text.c'; fi` scamper-scamper_file_json.o: scamper_file_json.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_file_json.o -MD -MP -MF $(DEPDIR)/scamper-scamper_file_json.Tpo -c -o scamper-scamper_file_json.o `test -f 'scamper_file_json.c' || echo '$(srcdir)/'`scamper_file_json.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_file_json.Tpo $(DEPDIR)/scamper-scamper_file_json.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_file_json.c' object='scamper-scamper_file_json.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_file_json.o `test -f 'scamper_file_json.c' || echo '$(srcdir)/'`scamper_file_json.c scamper-scamper_file_json.obj: scamper_file_json.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_file_json.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_file_json.Tpo -c -o scamper-scamper_file_json.obj `if test -f 'scamper_file_json.c'; then $(CYGPATH_W) 'scamper_file_json.c'; else $(CYGPATH_W) '$(srcdir)/scamper_file_json.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_file_json.Tpo $(DEPDIR)/scamper-scamper_file_json.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_file_json.c' object='scamper-scamper_file_json.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_file_json.obj `if test -f 'scamper_file_json.c'; then $(CYGPATH_W) 'scamper_file_json.c'; else $(CYGPATH_W) '$(srcdir)/scamper_file_json.c'; fi` scamper-scamper_sources.o: scamper_sources.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_sources.o -MD -MP -MF $(DEPDIR)/scamper-scamper_sources.Tpo -c -o scamper-scamper_sources.o `test -f 'scamper_sources.c' || echo '$(srcdir)/'`scamper_sources.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_sources.Tpo $(DEPDIR)/scamper-scamper_sources.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_sources.c' object='scamper-scamper_sources.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_sources.o `test -f 'scamper_sources.c' || echo '$(srcdir)/'`scamper_sources.c scamper-scamper_sources.obj: scamper_sources.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_sources.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_sources.Tpo -c -o scamper-scamper_sources.obj `if test -f 'scamper_sources.c'; then $(CYGPATH_W) 'scamper_sources.c'; else $(CYGPATH_W) '$(srcdir)/scamper_sources.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_sources.Tpo $(DEPDIR)/scamper-scamper_sources.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_sources.c' object='scamper-scamper_sources.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_sources.obj `if test -f 'scamper_sources.c'; then $(CYGPATH_W) 'scamper_sources.c'; else $(CYGPATH_W) '$(srcdir)/scamper_sources.c'; fi` scamper-scamper_source_cmdline.o: scamper_source_cmdline.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_source_cmdline.o -MD -MP -MF $(DEPDIR)/scamper-scamper_source_cmdline.Tpo -c -o scamper-scamper_source_cmdline.o `test -f 'scamper_source_cmdline.c' || echo '$(srcdir)/'`scamper_source_cmdline.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_source_cmdline.Tpo $(DEPDIR)/scamper-scamper_source_cmdline.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_source_cmdline.c' object='scamper-scamper_source_cmdline.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_source_cmdline.o `test -f 'scamper_source_cmdline.c' || echo '$(srcdir)/'`scamper_source_cmdline.c scamper-scamper_source_cmdline.obj: scamper_source_cmdline.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_source_cmdline.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_source_cmdline.Tpo -c -o scamper-scamper_source_cmdline.obj `if test -f 'scamper_source_cmdline.c'; then $(CYGPATH_W) 'scamper_source_cmdline.c'; else $(CYGPATH_W) '$(srcdir)/scamper_source_cmdline.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_source_cmdline.Tpo $(DEPDIR)/scamper-scamper_source_cmdline.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_source_cmdline.c' object='scamper-scamper_source_cmdline.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_source_cmdline.obj `if test -f 'scamper_source_cmdline.c'; then $(CYGPATH_W) 'scamper_source_cmdline.c'; else $(CYGPATH_W) '$(srcdir)/scamper_source_cmdline.c'; fi` scamper-scamper_source_control.o: scamper_source_control.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_source_control.o -MD -MP -MF $(DEPDIR)/scamper-scamper_source_control.Tpo -c -o scamper-scamper_source_control.o `test -f 'scamper_source_control.c' || echo '$(srcdir)/'`scamper_source_control.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_source_control.Tpo $(DEPDIR)/scamper-scamper_source_control.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_source_control.c' object='scamper-scamper_source_control.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_source_control.o `test -f 'scamper_source_control.c' || echo '$(srcdir)/'`scamper_source_control.c scamper-scamper_source_control.obj: scamper_source_control.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_source_control.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_source_control.Tpo -c -o scamper-scamper_source_control.obj `if test -f 'scamper_source_control.c'; then $(CYGPATH_W) 'scamper_source_control.c'; else $(CYGPATH_W) '$(srcdir)/scamper_source_control.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_source_control.Tpo $(DEPDIR)/scamper-scamper_source_control.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_source_control.c' object='scamper-scamper_source_control.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_source_control.obj `if test -f 'scamper_source_control.c'; then $(CYGPATH_W) 'scamper_source_control.c'; else $(CYGPATH_W) '$(srcdir)/scamper_source_control.c'; fi` scamper-scamper_source_file.o: scamper_source_file.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_source_file.o -MD -MP -MF $(DEPDIR)/scamper-scamper_source_file.Tpo -c -o scamper-scamper_source_file.o `test -f 'scamper_source_file.c' || echo '$(srcdir)/'`scamper_source_file.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_source_file.Tpo $(DEPDIR)/scamper-scamper_source_file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_source_file.c' object='scamper-scamper_source_file.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_source_file.o `test -f 'scamper_source_file.c' || echo '$(srcdir)/'`scamper_source_file.c scamper-scamper_source_file.obj: scamper_source_file.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_source_file.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_source_file.Tpo -c -o scamper-scamper_source_file.obj `if test -f 'scamper_source_file.c'; then $(CYGPATH_W) 'scamper_source_file.c'; else $(CYGPATH_W) '$(srcdir)/scamper_source_file.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_source_file.Tpo $(DEPDIR)/scamper-scamper_source_file.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_source_file.c' object='scamper-scamper_source_file.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_source_file.obj `if test -f 'scamper_source_file.c'; then $(CYGPATH_W) 'scamper_source_file.c'; else $(CYGPATH_W) '$(srcdir)/scamper_source_file.c'; fi` scamper-scamper_source_tsps.o: scamper_source_tsps.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_source_tsps.o -MD -MP -MF $(DEPDIR)/scamper-scamper_source_tsps.Tpo -c -o scamper-scamper_source_tsps.o `test -f 'scamper_source_tsps.c' || echo '$(srcdir)/'`scamper_source_tsps.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_source_tsps.Tpo $(DEPDIR)/scamper-scamper_source_tsps.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_source_tsps.c' object='scamper-scamper_source_tsps.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_source_tsps.o `test -f 'scamper_source_tsps.c' || echo '$(srcdir)/'`scamper_source_tsps.c scamper-scamper_source_tsps.obj: scamper_source_tsps.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT scamper-scamper_source_tsps.obj -MD -MP -MF $(DEPDIR)/scamper-scamper_source_tsps.Tpo -c -o scamper-scamper_source_tsps.obj `if test -f 'scamper_source_tsps.c'; then $(CYGPATH_W) 'scamper_source_tsps.c'; else $(CYGPATH_W) '$(srcdir)/scamper_source_tsps.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/scamper-scamper_source_tsps.Tpo $(DEPDIR)/scamper-scamper_source_tsps.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='scamper_source_tsps.c' object='scamper-scamper_source_tsps.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o scamper-scamper_source_tsps.obj `if test -f 'scamper_source_tsps.c'; then $(CYGPATH_W) 'scamper_source_tsps.c'; else $(CYGPATH_W) '$(srcdir)/scamper_source_tsps.c'; fi` trace/scamper-scamper_trace.o: trace/scamper_trace.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT trace/scamper-scamper_trace.o -MD -MP -MF trace/$(DEPDIR)/scamper-scamper_trace.Tpo -c -o trace/scamper-scamper_trace.o `test -f 'trace/scamper_trace.c' || echo '$(srcdir)/'`trace/scamper_trace.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) trace/$(DEPDIR)/scamper-scamper_trace.Tpo trace/$(DEPDIR)/scamper-scamper_trace.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trace/scamper_trace.c' object='trace/scamper-scamper_trace.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o trace/scamper-scamper_trace.o `test -f 'trace/scamper_trace.c' || echo '$(srcdir)/'`trace/scamper_trace.c trace/scamper-scamper_trace.obj: trace/scamper_trace.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT trace/scamper-scamper_trace.obj -MD -MP -MF trace/$(DEPDIR)/scamper-scamper_trace.Tpo -c -o trace/scamper-scamper_trace.obj `if test -f 'trace/scamper_trace.c'; then $(CYGPATH_W) 'trace/scamper_trace.c'; else $(CYGPATH_W) '$(srcdir)/trace/scamper_trace.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) trace/$(DEPDIR)/scamper-scamper_trace.Tpo trace/$(DEPDIR)/scamper-scamper_trace.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trace/scamper_trace.c' object='trace/scamper-scamper_trace.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o trace/scamper-scamper_trace.obj `if test -f 'trace/scamper_trace.c'; then $(CYGPATH_W) 'trace/scamper_trace.c'; else $(CYGPATH_W) '$(srcdir)/trace/scamper_trace.c'; fi` trace/scamper-scamper_trace_warts.o: trace/scamper_trace_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT trace/scamper-scamper_trace_warts.o -MD -MP -MF trace/$(DEPDIR)/scamper-scamper_trace_warts.Tpo -c -o trace/scamper-scamper_trace_warts.o `test -f 'trace/scamper_trace_warts.c' || echo '$(srcdir)/'`trace/scamper_trace_warts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) trace/$(DEPDIR)/scamper-scamper_trace_warts.Tpo trace/$(DEPDIR)/scamper-scamper_trace_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trace/scamper_trace_warts.c' object='trace/scamper-scamper_trace_warts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o trace/scamper-scamper_trace_warts.o `test -f 'trace/scamper_trace_warts.c' || echo '$(srcdir)/'`trace/scamper_trace_warts.c trace/scamper-scamper_trace_warts.obj: trace/scamper_trace_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT trace/scamper-scamper_trace_warts.obj -MD -MP -MF trace/$(DEPDIR)/scamper-scamper_trace_warts.Tpo -c -o trace/scamper-scamper_trace_warts.obj `if test -f 'trace/scamper_trace_warts.c'; then $(CYGPATH_W) 'trace/scamper_trace_warts.c'; else $(CYGPATH_W) '$(srcdir)/trace/scamper_trace_warts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) trace/$(DEPDIR)/scamper-scamper_trace_warts.Tpo trace/$(DEPDIR)/scamper-scamper_trace_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trace/scamper_trace_warts.c' object='trace/scamper-scamper_trace_warts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o trace/scamper-scamper_trace_warts.obj `if test -f 'trace/scamper_trace_warts.c'; then $(CYGPATH_W) 'trace/scamper_trace_warts.c'; else $(CYGPATH_W) '$(srcdir)/trace/scamper_trace_warts.c'; fi` trace/scamper-scamper_trace_text.o: trace/scamper_trace_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT trace/scamper-scamper_trace_text.o -MD -MP -MF trace/$(DEPDIR)/scamper-scamper_trace_text.Tpo -c -o trace/scamper-scamper_trace_text.o `test -f 'trace/scamper_trace_text.c' || echo '$(srcdir)/'`trace/scamper_trace_text.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) trace/$(DEPDIR)/scamper-scamper_trace_text.Tpo trace/$(DEPDIR)/scamper-scamper_trace_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trace/scamper_trace_text.c' object='trace/scamper-scamper_trace_text.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o trace/scamper-scamper_trace_text.o `test -f 'trace/scamper_trace_text.c' || echo '$(srcdir)/'`trace/scamper_trace_text.c trace/scamper-scamper_trace_text.obj: trace/scamper_trace_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT trace/scamper-scamper_trace_text.obj -MD -MP -MF trace/$(DEPDIR)/scamper-scamper_trace_text.Tpo -c -o trace/scamper-scamper_trace_text.obj `if test -f 'trace/scamper_trace_text.c'; then $(CYGPATH_W) 'trace/scamper_trace_text.c'; else $(CYGPATH_W) '$(srcdir)/trace/scamper_trace_text.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) trace/$(DEPDIR)/scamper-scamper_trace_text.Tpo trace/$(DEPDIR)/scamper-scamper_trace_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trace/scamper_trace_text.c' object='trace/scamper-scamper_trace_text.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o trace/scamper-scamper_trace_text.obj `if test -f 'trace/scamper_trace_text.c'; then $(CYGPATH_W) 'trace/scamper_trace_text.c'; else $(CYGPATH_W) '$(srcdir)/trace/scamper_trace_text.c'; fi` trace/scamper-scamper_trace_json.o: trace/scamper_trace_json.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT trace/scamper-scamper_trace_json.o -MD -MP -MF trace/$(DEPDIR)/scamper-scamper_trace_json.Tpo -c -o trace/scamper-scamper_trace_json.o `test -f 'trace/scamper_trace_json.c' || echo '$(srcdir)/'`trace/scamper_trace_json.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) trace/$(DEPDIR)/scamper-scamper_trace_json.Tpo trace/$(DEPDIR)/scamper-scamper_trace_json.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trace/scamper_trace_json.c' object='trace/scamper-scamper_trace_json.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o trace/scamper-scamper_trace_json.o `test -f 'trace/scamper_trace_json.c' || echo '$(srcdir)/'`trace/scamper_trace_json.c trace/scamper-scamper_trace_json.obj: trace/scamper_trace_json.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT trace/scamper-scamper_trace_json.obj -MD -MP -MF trace/$(DEPDIR)/scamper-scamper_trace_json.Tpo -c -o trace/scamper-scamper_trace_json.obj `if test -f 'trace/scamper_trace_json.c'; then $(CYGPATH_W) 'trace/scamper_trace_json.c'; else $(CYGPATH_W) '$(srcdir)/trace/scamper_trace_json.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) trace/$(DEPDIR)/scamper-scamper_trace_json.Tpo trace/$(DEPDIR)/scamper-scamper_trace_json.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trace/scamper_trace_json.c' object='trace/scamper-scamper_trace_json.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o trace/scamper-scamper_trace_json.obj `if test -f 'trace/scamper_trace_json.c'; then $(CYGPATH_W) 'trace/scamper_trace_json.c'; else $(CYGPATH_W) '$(srcdir)/trace/scamper_trace_json.c'; fi` trace/scamper-scamper_trace_do.o: trace/scamper_trace_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT trace/scamper-scamper_trace_do.o -MD -MP -MF trace/$(DEPDIR)/scamper-scamper_trace_do.Tpo -c -o trace/scamper-scamper_trace_do.o `test -f 'trace/scamper_trace_do.c' || echo '$(srcdir)/'`trace/scamper_trace_do.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) trace/$(DEPDIR)/scamper-scamper_trace_do.Tpo trace/$(DEPDIR)/scamper-scamper_trace_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trace/scamper_trace_do.c' object='trace/scamper-scamper_trace_do.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o trace/scamper-scamper_trace_do.o `test -f 'trace/scamper_trace_do.c' || echo '$(srcdir)/'`trace/scamper_trace_do.c trace/scamper-scamper_trace_do.obj: trace/scamper_trace_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT trace/scamper-scamper_trace_do.obj -MD -MP -MF trace/$(DEPDIR)/scamper-scamper_trace_do.Tpo -c -o trace/scamper-scamper_trace_do.obj `if test -f 'trace/scamper_trace_do.c'; then $(CYGPATH_W) 'trace/scamper_trace_do.c'; else $(CYGPATH_W) '$(srcdir)/trace/scamper_trace_do.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) trace/$(DEPDIR)/scamper-scamper_trace_do.Tpo trace/$(DEPDIR)/scamper-scamper_trace_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trace/scamper_trace_do.c' object='trace/scamper-scamper_trace_do.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o trace/scamper-scamper_trace_do.obj `if test -f 'trace/scamper_trace_do.c'; then $(CYGPATH_W) 'trace/scamper_trace_do.c'; else $(CYGPATH_W) '$(srcdir)/trace/scamper_trace_do.c'; fi` ping/scamper-scamper_ping.o: ping/scamper_ping.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ping/scamper-scamper_ping.o -MD -MP -MF ping/$(DEPDIR)/scamper-scamper_ping.Tpo -c -o ping/scamper-scamper_ping.o `test -f 'ping/scamper_ping.c' || echo '$(srcdir)/'`ping/scamper_ping.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ping/$(DEPDIR)/scamper-scamper_ping.Tpo ping/$(DEPDIR)/scamper-scamper_ping.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ping/scamper_ping.c' object='ping/scamper-scamper_ping.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ping/scamper-scamper_ping.o `test -f 'ping/scamper_ping.c' || echo '$(srcdir)/'`ping/scamper_ping.c ping/scamper-scamper_ping.obj: ping/scamper_ping.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ping/scamper-scamper_ping.obj -MD -MP -MF ping/$(DEPDIR)/scamper-scamper_ping.Tpo -c -o ping/scamper-scamper_ping.obj `if test -f 'ping/scamper_ping.c'; then $(CYGPATH_W) 'ping/scamper_ping.c'; else $(CYGPATH_W) '$(srcdir)/ping/scamper_ping.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ping/$(DEPDIR)/scamper-scamper_ping.Tpo ping/$(DEPDIR)/scamper-scamper_ping.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ping/scamper_ping.c' object='ping/scamper-scamper_ping.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ping/scamper-scamper_ping.obj `if test -f 'ping/scamper_ping.c'; then $(CYGPATH_W) 'ping/scamper_ping.c'; else $(CYGPATH_W) '$(srcdir)/ping/scamper_ping.c'; fi` ping/scamper-scamper_ping_warts.o: ping/scamper_ping_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ping/scamper-scamper_ping_warts.o -MD -MP -MF ping/$(DEPDIR)/scamper-scamper_ping_warts.Tpo -c -o ping/scamper-scamper_ping_warts.o `test -f 'ping/scamper_ping_warts.c' || echo '$(srcdir)/'`ping/scamper_ping_warts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ping/$(DEPDIR)/scamper-scamper_ping_warts.Tpo ping/$(DEPDIR)/scamper-scamper_ping_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ping/scamper_ping_warts.c' object='ping/scamper-scamper_ping_warts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ping/scamper-scamper_ping_warts.o `test -f 'ping/scamper_ping_warts.c' || echo '$(srcdir)/'`ping/scamper_ping_warts.c ping/scamper-scamper_ping_warts.obj: ping/scamper_ping_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ping/scamper-scamper_ping_warts.obj -MD -MP -MF ping/$(DEPDIR)/scamper-scamper_ping_warts.Tpo -c -o ping/scamper-scamper_ping_warts.obj `if test -f 'ping/scamper_ping_warts.c'; then $(CYGPATH_W) 'ping/scamper_ping_warts.c'; else $(CYGPATH_W) '$(srcdir)/ping/scamper_ping_warts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ping/$(DEPDIR)/scamper-scamper_ping_warts.Tpo ping/$(DEPDIR)/scamper-scamper_ping_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ping/scamper_ping_warts.c' object='ping/scamper-scamper_ping_warts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ping/scamper-scamper_ping_warts.obj `if test -f 'ping/scamper_ping_warts.c'; then $(CYGPATH_W) 'ping/scamper_ping_warts.c'; else $(CYGPATH_W) '$(srcdir)/ping/scamper_ping_warts.c'; fi` ping/scamper-scamper_ping_text.o: ping/scamper_ping_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ping/scamper-scamper_ping_text.o -MD -MP -MF ping/$(DEPDIR)/scamper-scamper_ping_text.Tpo -c -o ping/scamper-scamper_ping_text.o `test -f 'ping/scamper_ping_text.c' || echo '$(srcdir)/'`ping/scamper_ping_text.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ping/$(DEPDIR)/scamper-scamper_ping_text.Tpo ping/$(DEPDIR)/scamper-scamper_ping_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ping/scamper_ping_text.c' object='ping/scamper-scamper_ping_text.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ping/scamper-scamper_ping_text.o `test -f 'ping/scamper_ping_text.c' || echo '$(srcdir)/'`ping/scamper_ping_text.c ping/scamper-scamper_ping_text.obj: ping/scamper_ping_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ping/scamper-scamper_ping_text.obj -MD -MP -MF ping/$(DEPDIR)/scamper-scamper_ping_text.Tpo -c -o ping/scamper-scamper_ping_text.obj `if test -f 'ping/scamper_ping_text.c'; then $(CYGPATH_W) 'ping/scamper_ping_text.c'; else $(CYGPATH_W) '$(srcdir)/ping/scamper_ping_text.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ping/$(DEPDIR)/scamper-scamper_ping_text.Tpo ping/$(DEPDIR)/scamper-scamper_ping_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ping/scamper_ping_text.c' object='ping/scamper-scamper_ping_text.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ping/scamper-scamper_ping_text.obj `if test -f 'ping/scamper_ping_text.c'; then $(CYGPATH_W) 'ping/scamper_ping_text.c'; else $(CYGPATH_W) '$(srcdir)/ping/scamper_ping_text.c'; fi` ping/scamper-scamper_ping_json.o: ping/scamper_ping_json.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ping/scamper-scamper_ping_json.o -MD -MP -MF ping/$(DEPDIR)/scamper-scamper_ping_json.Tpo -c -o ping/scamper-scamper_ping_json.o `test -f 'ping/scamper_ping_json.c' || echo '$(srcdir)/'`ping/scamper_ping_json.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ping/$(DEPDIR)/scamper-scamper_ping_json.Tpo ping/$(DEPDIR)/scamper-scamper_ping_json.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ping/scamper_ping_json.c' object='ping/scamper-scamper_ping_json.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ping/scamper-scamper_ping_json.o `test -f 'ping/scamper_ping_json.c' || echo '$(srcdir)/'`ping/scamper_ping_json.c ping/scamper-scamper_ping_json.obj: ping/scamper_ping_json.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ping/scamper-scamper_ping_json.obj -MD -MP -MF ping/$(DEPDIR)/scamper-scamper_ping_json.Tpo -c -o ping/scamper-scamper_ping_json.obj `if test -f 'ping/scamper_ping_json.c'; then $(CYGPATH_W) 'ping/scamper_ping_json.c'; else $(CYGPATH_W) '$(srcdir)/ping/scamper_ping_json.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ping/$(DEPDIR)/scamper-scamper_ping_json.Tpo ping/$(DEPDIR)/scamper-scamper_ping_json.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ping/scamper_ping_json.c' object='ping/scamper-scamper_ping_json.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ping/scamper-scamper_ping_json.obj `if test -f 'ping/scamper_ping_json.c'; then $(CYGPATH_W) 'ping/scamper_ping_json.c'; else $(CYGPATH_W) '$(srcdir)/ping/scamper_ping_json.c'; fi` ping/scamper-scamper_ping_do.o: ping/scamper_ping_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ping/scamper-scamper_ping_do.o -MD -MP -MF ping/$(DEPDIR)/scamper-scamper_ping_do.Tpo -c -o ping/scamper-scamper_ping_do.o `test -f 'ping/scamper_ping_do.c' || echo '$(srcdir)/'`ping/scamper_ping_do.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ping/$(DEPDIR)/scamper-scamper_ping_do.Tpo ping/$(DEPDIR)/scamper-scamper_ping_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ping/scamper_ping_do.c' object='ping/scamper-scamper_ping_do.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ping/scamper-scamper_ping_do.o `test -f 'ping/scamper_ping_do.c' || echo '$(srcdir)/'`ping/scamper_ping_do.c ping/scamper-scamper_ping_do.obj: ping/scamper_ping_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT ping/scamper-scamper_ping_do.obj -MD -MP -MF ping/$(DEPDIR)/scamper-scamper_ping_do.Tpo -c -o ping/scamper-scamper_ping_do.obj `if test -f 'ping/scamper_ping_do.c'; then $(CYGPATH_W) 'ping/scamper_ping_do.c'; else $(CYGPATH_W) '$(srcdir)/ping/scamper_ping_do.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ping/$(DEPDIR)/scamper-scamper_ping_do.Tpo ping/$(DEPDIR)/scamper-scamper_ping_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ping/scamper_ping_do.c' object='ping/scamper-scamper_ping_do.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o ping/scamper-scamper_ping_do.obj `if test -f 'ping/scamper_ping_do.c'; then $(CYGPATH_W) 'ping/scamper_ping_do.c'; else $(CYGPATH_W) '$(srcdir)/ping/scamper_ping_do.c'; fi` tracelb/scamper-scamper_tracelb.o: tracelb/scamper_tracelb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tracelb/scamper-scamper_tracelb.o -MD -MP -MF tracelb/$(DEPDIR)/scamper-scamper_tracelb.Tpo -c -o tracelb/scamper-scamper_tracelb.o `test -f 'tracelb/scamper_tracelb.c' || echo '$(srcdir)/'`tracelb/scamper_tracelb.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tracelb/$(DEPDIR)/scamper-scamper_tracelb.Tpo tracelb/$(DEPDIR)/scamper-scamper_tracelb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tracelb/scamper_tracelb.c' object='tracelb/scamper-scamper_tracelb.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tracelb/scamper-scamper_tracelb.o `test -f 'tracelb/scamper_tracelb.c' || echo '$(srcdir)/'`tracelb/scamper_tracelb.c tracelb/scamper-scamper_tracelb.obj: tracelb/scamper_tracelb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tracelb/scamper-scamper_tracelb.obj -MD -MP -MF tracelb/$(DEPDIR)/scamper-scamper_tracelb.Tpo -c -o tracelb/scamper-scamper_tracelb.obj `if test -f 'tracelb/scamper_tracelb.c'; then $(CYGPATH_W) 'tracelb/scamper_tracelb.c'; else $(CYGPATH_W) '$(srcdir)/tracelb/scamper_tracelb.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tracelb/$(DEPDIR)/scamper-scamper_tracelb.Tpo tracelb/$(DEPDIR)/scamper-scamper_tracelb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tracelb/scamper_tracelb.c' object='tracelb/scamper-scamper_tracelb.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tracelb/scamper-scamper_tracelb.obj `if test -f 'tracelb/scamper_tracelb.c'; then $(CYGPATH_W) 'tracelb/scamper_tracelb.c'; else $(CYGPATH_W) '$(srcdir)/tracelb/scamper_tracelb.c'; fi` tracelb/scamper-scamper_tracelb_warts.o: tracelb/scamper_tracelb_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tracelb/scamper-scamper_tracelb_warts.o -MD -MP -MF tracelb/$(DEPDIR)/scamper-scamper_tracelb_warts.Tpo -c -o tracelb/scamper-scamper_tracelb_warts.o `test -f 'tracelb/scamper_tracelb_warts.c' || echo '$(srcdir)/'`tracelb/scamper_tracelb_warts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tracelb/$(DEPDIR)/scamper-scamper_tracelb_warts.Tpo tracelb/$(DEPDIR)/scamper-scamper_tracelb_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tracelb/scamper_tracelb_warts.c' object='tracelb/scamper-scamper_tracelb_warts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tracelb/scamper-scamper_tracelb_warts.o `test -f 'tracelb/scamper_tracelb_warts.c' || echo '$(srcdir)/'`tracelb/scamper_tracelb_warts.c tracelb/scamper-scamper_tracelb_warts.obj: tracelb/scamper_tracelb_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tracelb/scamper-scamper_tracelb_warts.obj -MD -MP -MF tracelb/$(DEPDIR)/scamper-scamper_tracelb_warts.Tpo -c -o tracelb/scamper-scamper_tracelb_warts.obj `if test -f 'tracelb/scamper_tracelb_warts.c'; then $(CYGPATH_W) 'tracelb/scamper_tracelb_warts.c'; else $(CYGPATH_W) '$(srcdir)/tracelb/scamper_tracelb_warts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tracelb/$(DEPDIR)/scamper-scamper_tracelb_warts.Tpo tracelb/$(DEPDIR)/scamper-scamper_tracelb_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tracelb/scamper_tracelb_warts.c' object='tracelb/scamper-scamper_tracelb_warts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tracelb/scamper-scamper_tracelb_warts.obj `if test -f 'tracelb/scamper_tracelb_warts.c'; then $(CYGPATH_W) 'tracelb/scamper_tracelb_warts.c'; else $(CYGPATH_W) '$(srcdir)/tracelb/scamper_tracelb_warts.c'; fi` tracelb/scamper-scamper_tracelb_text.o: tracelb/scamper_tracelb_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tracelb/scamper-scamper_tracelb_text.o -MD -MP -MF tracelb/$(DEPDIR)/scamper-scamper_tracelb_text.Tpo -c -o tracelb/scamper-scamper_tracelb_text.o `test -f 'tracelb/scamper_tracelb_text.c' || echo '$(srcdir)/'`tracelb/scamper_tracelb_text.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tracelb/$(DEPDIR)/scamper-scamper_tracelb_text.Tpo tracelb/$(DEPDIR)/scamper-scamper_tracelb_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tracelb/scamper_tracelb_text.c' object='tracelb/scamper-scamper_tracelb_text.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tracelb/scamper-scamper_tracelb_text.o `test -f 'tracelb/scamper_tracelb_text.c' || echo '$(srcdir)/'`tracelb/scamper_tracelb_text.c tracelb/scamper-scamper_tracelb_text.obj: tracelb/scamper_tracelb_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tracelb/scamper-scamper_tracelb_text.obj -MD -MP -MF tracelb/$(DEPDIR)/scamper-scamper_tracelb_text.Tpo -c -o tracelb/scamper-scamper_tracelb_text.obj `if test -f 'tracelb/scamper_tracelb_text.c'; then $(CYGPATH_W) 'tracelb/scamper_tracelb_text.c'; else $(CYGPATH_W) '$(srcdir)/tracelb/scamper_tracelb_text.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tracelb/$(DEPDIR)/scamper-scamper_tracelb_text.Tpo tracelb/$(DEPDIR)/scamper-scamper_tracelb_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tracelb/scamper_tracelb_text.c' object='tracelb/scamper-scamper_tracelb_text.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tracelb/scamper-scamper_tracelb_text.obj `if test -f 'tracelb/scamper_tracelb_text.c'; then $(CYGPATH_W) 'tracelb/scamper_tracelb_text.c'; else $(CYGPATH_W) '$(srcdir)/tracelb/scamper_tracelb_text.c'; fi` tracelb/scamper-scamper_tracelb_do.o: tracelb/scamper_tracelb_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tracelb/scamper-scamper_tracelb_do.o -MD -MP -MF tracelb/$(DEPDIR)/scamper-scamper_tracelb_do.Tpo -c -o tracelb/scamper-scamper_tracelb_do.o `test -f 'tracelb/scamper_tracelb_do.c' || echo '$(srcdir)/'`tracelb/scamper_tracelb_do.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tracelb/$(DEPDIR)/scamper-scamper_tracelb_do.Tpo tracelb/$(DEPDIR)/scamper-scamper_tracelb_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tracelb/scamper_tracelb_do.c' object='tracelb/scamper-scamper_tracelb_do.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tracelb/scamper-scamper_tracelb_do.o `test -f 'tracelb/scamper_tracelb_do.c' || echo '$(srcdir)/'`tracelb/scamper_tracelb_do.c tracelb/scamper-scamper_tracelb_do.obj: tracelb/scamper_tracelb_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tracelb/scamper-scamper_tracelb_do.obj -MD -MP -MF tracelb/$(DEPDIR)/scamper-scamper_tracelb_do.Tpo -c -o tracelb/scamper-scamper_tracelb_do.obj `if test -f 'tracelb/scamper_tracelb_do.c'; then $(CYGPATH_W) 'tracelb/scamper_tracelb_do.c'; else $(CYGPATH_W) '$(srcdir)/tracelb/scamper_tracelb_do.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tracelb/$(DEPDIR)/scamper-scamper_tracelb_do.Tpo tracelb/$(DEPDIR)/scamper-scamper_tracelb_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tracelb/scamper_tracelb_do.c' object='tracelb/scamper-scamper_tracelb_do.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tracelb/scamper-scamper_tracelb_do.obj `if test -f 'tracelb/scamper_tracelb_do.c'; then $(CYGPATH_W) 'tracelb/scamper_tracelb_do.c'; else $(CYGPATH_W) '$(srcdir)/tracelb/scamper_tracelb_do.c'; fi` dealias/scamper-scamper_dealias.o: dealias/scamper_dealias.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT dealias/scamper-scamper_dealias.o -MD -MP -MF dealias/$(DEPDIR)/scamper-scamper_dealias.Tpo -c -o dealias/scamper-scamper_dealias.o `test -f 'dealias/scamper_dealias.c' || echo '$(srcdir)/'`dealias/scamper_dealias.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dealias/$(DEPDIR)/scamper-scamper_dealias.Tpo dealias/$(DEPDIR)/scamper-scamper_dealias.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dealias/scamper_dealias.c' object='dealias/scamper-scamper_dealias.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o dealias/scamper-scamper_dealias.o `test -f 'dealias/scamper_dealias.c' || echo '$(srcdir)/'`dealias/scamper_dealias.c dealias/scamper-scamper_dealias.obj: dealias/scamper_dealias.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT dealias/scamper-scamper_dealias.obj -MD -MP -MF dealias/$(DEPDIR)/scamper-scamper_dealias.Tpo -c -o dealias/scamper-scamper_dealias.obj `if test -f 'dealias/scamper_dealias.c'; then $(CYGPATH_W) 'dealias/scamper_dealias.c'; else $(CYGPATH_W) '$(srcdir)/dealias/scamper_dealias.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dealias/$(DEPDIR)/scamper-scamper_dealias.Tpo dealias/$(DEPDIR)/scamper-scamper_dealias.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dealias/scamper_dealias.c' object='dealias/scamper-scamper_dealias.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o dealias/scamper-scamper_dealias.obj `if test -f 'dealias/scamper_dealias.c'; then $(CYGPATH_W) 'dealias/scamper_dealias.c'; else $(CYGPATH_W) '$(srcdir)/dealias/scamper_dealias.c'; fi` dealias/scamper-scamper_dealias_warts.o: dealias/scamper_dealias_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT dealias/scamper-scamper_dealias_warts.o -MD -MP -MF dealias/$(DEPDIR)/scamper-scamper_dealias_warts.Tpo -c -o dealias/scamper-scamper_dealias_warts.o `test -f 'dealias/scamper_dealias_warts.c' || echo '$(srcdir)/'`dealias/scamper_dealias_warts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dealias/$(DEPDIR)/scamper-scamper_dealias_warts.Tpo dealias/$(DEPDIR)/scamper-scamper_dealias_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dealias/scamper_dealias_warts.c' object='dealias/scamper-scamper_dealias_warts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o dealias/scamper-scamper_dealias_warts.o `test -f 'dealias/scamper_dealias_warts.c' || echo '$(srcdir)/'`dealias/scamper_dealias_warts.c dealias/scamper-scamper_dealias_warts.obj: dealias/scamper_dealias_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT dealias/scamper-scamper_dealias_warts.obj -MD -MP -MF dealias/$(DEPDIR)/scamper-scamper_dealias_warts.Tpo -c -o dealias/scamper-scamper_dealias_warts.obj `if test -f 'dealias/scamper_dealias_warts.c'; then $(CYGPATH_W) 'dealias/scamper_dealias_warts.c'; else $(CYGPATH_W) '$(srcdir)/dealias/scamper_dealias_warts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dealias/$(DEPDIR)/scamper-scamper_dealias_warts.Tpo dealias/$(DEPDIR)/scamper-scamper_dealias_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dealias/scamper_dealias_warts.c' object='dealias/scamper-scamper_dealias_warts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o dealias/scamper-scamper_dealias_warts.obj `if test -f 'dealias/scamper_dealias_warts.c'; then $(CYGPATH_W) 'dealias/scamper_dealias_warts.c'; else $(CYGPATH_W) '$(srcdir)/dealias/scamper_dealias_warts.c'; fi` dealias/scamper-scamper_dealias_text.o: dealias/scamper_dealias_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT dealias/scamper-scamper_dealias_text.o -MD -MP -MF dealias/$(DEPDIR)/scamper-scamper_dealias_text.Tpo -c -o dealias/scamper-scamper_dealias_text.o `test -f 'dealias/scamper_dealias_text.c' || echo '$(srcdir)/'`dealias/scamper_dealias_text.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dealias/$(DEPDIR)/scamper-scamper_dealias_text.Tpo dealias/$(DEPDIR)/scamper-scamper_dealias_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dealias/scamper_dealias_text.c' object='dealias/scamper-scamper_dealias_text.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o dealias/scamper-scamper_dealias_text.o `test -f 'dealias/scamper_dealias_text.c' || echo '$(srcdir)/'`dealias/scamper_dealias_text.c dealias/scamper-scamper_dealias_text.obj: dealias/scamper_dealias_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT dealias/scamper-scamper_dealias_text.obj -MD -MP -MF dealias/$(DEPDIR)/scamper-scamper_dealias_text.Tpo -c -o dealias/scamper-scamper_dealias_text.obj `if test -f 'dealias/scamper_dealias_text.c'; then $(CYGPATH_W) 'dealias/scamper_dealias_text.c'; else $(CYGPATH_W) '$(srcdir)/dealias/scamper_dealias_text.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dealias/$(DEPDIR)/scamper-scamper_dealias_text.Tpo dealias/$(DEPDIR)/scamper-scamper_dealias_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dealias/scamper_dealias_text.c' object='dealias/scamper-scamper_dealias_text.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o dealias/scamper-scamper_dealias_text.obj `if test -f 'dealias/scamper_dealias_text.c'; then $(CYGPATH_W) 'dealias/scamper_dealias_text.c'; else $(CYGPATH_W) '$(srcdir)/dealias/scamper_dealias_text.c'; fi` dealias/scamper-scamper_dealias_json.o: dealias/scamper_dealias_json.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT dealias/scamper-scamper_dealias_json.o -MD -MP -MF dealias/$(DEPDIR)/scamper-scamper_dealias_json.Tpo -c -o dealias/scamper-scamper_dealias_json.o `test -f 'dealias/scamper_dealias_json.c' || echo '$(srcdir)/'`dealias/scamper_dealias_json.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dealias/$(DEPDIR)/scamper-scamper_dealias_json.Tpo dealias/$(DEPDIR)/scamper-scamper_dealias_json.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dealias/scamper_dealias_json.c' object='dealias/scamper-scamper_dealias_json.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o dealias/scamper-scamper_dealias_json.o `test -f 'dealias/scamper_dealias_json.c' || echo '$(srcdir)/'`dealias/scamper_dealias_json.c dealias/scamper-scamper_dealias_json.obj: dealias/scamper_dealias_json.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT dealias/scamper-scamper_dealias_json.obj -MD -MP -MF dealias/$(DEPDIR)/scamper-scamper_dealias_json.Tpo -c -o dealias/scamper-scamper_dealias_json.obj `if test -f 'dealias/scamper_dealias_json.c'; then $(CYGPATH_W) 'dealias/scamper_dealias_json.c'; else $(CYGPATH_W) '$(srcdir)/dealias/scamper_dealias_json.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dealias/$(DEPDIR)/scamper-scamper_dealias_json.Tpo dealias/$(DEPDIR)/scamper-scamper_dealias_json.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dealias/scamper_dealias_json.c' object='dealias/scamper-scamper_dealias_json.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o dealias/scamper-scamper_dealias_json.obj `if test -f 'dealias/scamper_dealias_json.c'; then $(CYGPATH_W) 'dealias/scamper_dealias_json.c'; else $(CYGPATH_W) '$(srcdir)/dealias/scamper_dealias_json.c'; fi` dealias/scamper-scamper_dealias_do.o: dealias/scamper_dealias_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT dealias/scamper-scamper_dealias_do.o -MD -MP -MF dealias/$(DEPDIR)/scamper-scamper_dealias_do.Tpo -c -o dealias/scamper-scamper_dealias_do.o `test -f 'dealias/scamper_dealias_do.c' || echo '$(srcdir)/'`dealias/scamper_dealias_do.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dealias/$(DEPDIR)/scamper-scamper_dealias_do.Tpo dealias/$(DEPDIR)/scamper-scamper_dealias_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dealias/scamper_dealias_do.c' object='dealias/scamper-scamper_dealias_do.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o dealias/scamper-scamper_dealias_do.o `test -f 'dealias/scamper_dealias_do.c' || echo '$(srcdir)/'`dealias/scamper_dealias_do.c dealias/scamper-scamper_dealias_do.obj: dealias/scamper_dealias_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT dealias/scamper-scamper_dealias_do.obj -MD -MP -MF dealias/$(DEPDIR)/scamper-scamper_dealias_do.Tpo -c -o dealias/scamper-scamper_dealias_do.obj `if test -f 'dealias/scamper_dealias_do.c'; then $(CYGPATH_W) 'dealias/scamper_dealias_do.c'; else $(CYGPATH_W) '$(srcdir)/dealias/scamper_dealias_do.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dealias/$(DEPDIR)/scamper-scamper_dealias_do.Tpo dealias/$(DEPDIR)/scamper-scamper_dealias_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dealias/scamper_dealias_do.c' object='dealias/scamper-scamper_dealias_do.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o dealias/scamper-scamper_dealias_do.obj `if test -f 'dealias/scamper_dealias_do.c'; then $(CYGPATH_W) 'dealias/scamper_dealias_do.c'; else $(CYGPATH_W) '$(srcdir)/dealias/scamper_dealias_do.c'; fi` sting/scamper-scamper_sting.o: sting/scamper_sting.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sting/scamper-scamper_sting.o -MD -MP -MF sting/$(DEPDIR)/scamper-scamper_sting.Tpo -c -o sting/scamper-scamper_sting.o `test -f 'sting/scamper_sting.c' || echo '$(srcdir)/'`sting/scamper_sting.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sting/$(DEPDIR)/scamper-scamper_sting.Tpo sting/$(DEPDIR)/scamper-scamper_sting.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sting/scamper_sting.c' object='sting/scamper-scamper_sting.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sting/scamper-scamper_sting.o `test -f 'sting/scamper_sting.c' || echo '$(srcdir)/'`sting/scamper_sting.c sting/scamper-scamper_sting.obj: sting/scamper_sting.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sting/scamper-scamper_sting.obj -MD -MP -MF sting/$(DEPDIR)/scamper-scamper_sting.Tpo -c -o sting/scamper-scamper_sting.obj `if test -f 'sting/scamper_sting.c'; then $(CYGPATH_W) 'sting/scamper_sting.c'; else $(CYGPATH_W) '$(srcdir)/sting/scamper_sting.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sting/$(DEPDIR)/scamper-scamper_sting.Tpo sting/$(DEPDIR)/scamper-scamper_sting.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sting/scamper_sting.c' object='sting/scamper-scamper_sting.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sting/scamper-scamper_sting.obj `if test -f 'sting/scamper_sting.c'; then $(CYGPATH_W) 'sting/scamper_sting.c'; else $(CYGPATH_W) '$(srcdir)/sting/scamper_sting.c'; fi` sting/scamper-scamper_sting_warts.o: sting/scamper_sting_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sting/scamper-scamper_sting_warts.o -MD -MP -MF sting/$(DEPDIR)/scamper-scamper_sting_warts.Tpo -c -o sting/scamper-scamper_sting_warts.o `test -f 'sting/scamper_sting_warts.c' || echo '$(srcdir)/'`sting/scamper_sting_warts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sting/$(DEPDIR)/scamper-scamper_sting_warts.Tpo sting/$(DEPDIR)/scamper-scamper_sting_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sting/scamper_sting_warts.c' object='sting/scamper-scamper_sting_warts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sting/scamper-scamper_sting_warts.o `test -f 'sting/scamper_sting_warts.c' || echo '$(srcdir)/'`sting/scamper_sting_warts.c sting/scamper-scamper_sting_warts.obj: sting/scamper_sting_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sting/scamper-scamper_sting_warts.obj -MD -MP -MF sting/$(DEPDIR)/scamper-scamper_sting_warts.Tpo -c -o sting/scamper-scamper_sting_warts.obj `if test -f 'sting/scamper_sting_warts.c'; then $(CYGPATH_W) 'sting/scamper_sting_warts.c'; else $(CYGPATH_W) '$(srcdir)/sting/scamper_sting_warts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sting/$(DEPDIR)/scamper-scamper_sting_warts.Tpo sting/$(DEPDIR)/scamper-scamper_sting_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sting/scamper_sting_warts.c' object='sting/scamper-scamper_sting_warts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sting/scamper-scamper_sting_warts.obj `if test -f 'sting/scamper_sting_warts.c'; then $(CYGPATH_W) 'sting/scamper_sting_warts.c'; else $(CYGPATH_W) '$(srcdir)/sting/scamper_sting_warts.c'; fi` sting/scamper-scamper_sting_text.o: sting/scamper_sting_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sting/scamper-scamper_sting_text.o -MD -MP -MF sting/$(DEPDIR)/scamper-scamper_sting_text.Tpo -c -o sting/scamper-scamper_sting_text.o `test -f 'sting/scamper_sting_text.c' || echo '$(srcdir)/'`sting/scamper_sting_text.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sting/$(DEPDIR)/scamper-scamper_sting_text.Tpo sting/$(DEPDIR)/scamper-scamper_sting_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sting/scamper_sting_text.c' object='sting/scamper-scamper_sting_text.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sting/scamper-scamper_sting_text.o `test -f 'sting/scamper_sting_text.c' || echo '$(srcdir)/'`sting/scamper_sting_text.c sting/scamper-scamper_sting_text.obj: sting/scamper_sting_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sting/scamper-scamper_sting_text.obj -MD -MP -MF sting/$(DEPDIR)/scamper-scamper_sting_text.Tpo -c -o sting/scamper-scamper_sting_text.obj `if test -f 'sting/scamper_sting_text.c'; then $(CYGPATH_W) 'sting/scamper_sting_text.c'; else $(CYGPATH_W) '$(srcdir)/sting/scamper_sting_text.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sting/$(DEPDIR)/scamper-scamper_sting_text.Tpo sting/$(DEPDIR)/scamper-scamper_sting_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sting/scamper_sting_text.c' object='sting/scamper-scamper_sting_text.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sting/scamper-scamper_sting_text.obj `if test -f 'sting/scamper_sting_text.c'; then $(CYGPATH_W) 'sting/scamper_sting_text.c'; else $(CYGPATH_W) '$(srcdir)/sting/scamper_sting_text.c'; fi` sting/scamper-scamper_sting_do.o: sting/scamper_sting_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sting/scamper-scamper_sting_do.o -MD -MP -MF sting/$(DEPDIR)/scamper-scamper_sting_do.Tpo -c -o sting/scamper-scamper_sting_do.o `test -f 'sting/scamper_sting_do.c' || echo '$(srcdir)/'`sting/scamper_sting_do.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sting/$(DEPDIR)/scamper-scamper_sting_do.Tpo sting/$(DEPDIR)/scamper-scamper_sting_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sting/scamper_sting_do.c' object='sting/scamper-scamper_sting_do.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sting/scamper-scamper_sting_do.o `test -f 'sting/scamper_sting_do.c' || echo '$(srcdir)/'`sting/scamper_sting_do.c sting/scamper-scamper_sting_do.obj: sting/scamper_sting_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sting/scamper-scamper_sting_do.obj -MD -MP -MF sting/$(DEPDIR)/scamper-scamper_sting_do.Tpo -c -o sting/scamper-scamper_sting_do.obj `if test -f 'sting/scamper_sting_do.c'; then $(CYGPATH_W) 'sting/scamper_sting_do.c'; else $(CYGPATH_W) '$(srcdir)/sting/scamper_sting_do.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sting/$(DEPDIR)/scamper-scamper_sting_do.Tpo sting/$(DEPDIR)/scamper-scamper_sting_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sting/scamper_sting_do.c' object='sting/scamper-scamper_sting_do.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sting/scamper-scamper_sting_do.obj `if test -f 'sting/scamper_sting_do.c'; then $(CYGPATH_W) 'sting/scamper_sting_do.c'; else $(CYGPATH_W) '$(srcdir)/sting/scamper_sting_do.c'; fi` neighbourdisc/scamper-scamper_neighbourdisc.o: neighbourdisc/scamper_neighbourdisc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT neighbourdisc/scamper-scamper_neighbourdisc.o -MD -MP -MF neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc.Tpo -c -o neighbourdisc/scamper-scamper_neighbourdisc.o `test -f 'neighbourdisc/scamper_neighbourdisc.c' || echo '$(srcdir)/'`neighbourdisc/scamper_neighbourdisc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc.Tpo neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='neighbourdisc/scamper_neighbourdisc.c' object='neighbourdisc/scamper-scamper_neighbourdisc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o neighbourdisc/scamper-scamper_neighbourdisc.o `test -f 'neighbourdisc/scamper_neighbourdisc.c' || echo '$(srcdir)/'`neighbourdisc/scamper_neighbourdisc.c neighbourdisc/scamper-scamper_neighbourdisc.obj: neighbourdisc/scamper_neighbourdisc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT neighbourdisc/scamper-scamper_neighbourdisc.obj -MD -MP -MF neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc.Tpo -c -o neighbourdisc/scamper-scamper_neighbourdisc.obj `if test -f 'neighbourdisc/scamper_neighbourdisc.c'; then $(CYGPATH_W) 'neighbourdisc/scamper_neighbourdisc.c'; else $(CYGPATH_W) '$(srcdir)/neighbourdisc/scamper_neighbourdisc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc.Tpo neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='neighbourdisc/scamper_neighbourdisc.c' object='neighbourdisc/scamper-scamper_neighbourdisc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o neighbourdisc/scamper-scamper_neighbourdisc.obj `if test -f 'neighbourdisc/scamper_neighbourdisc.c'; then $(CYGPATH_W) 'neighbourdisc/scamper_neighbourdisc.c'; else $(CYGPATH_W) '$(srcdir)/neighbourdisc/scamper_neighbourdisc.c'; fi` neighbourdisc/scamper-scamper_neighbourdisc_warts.o: neighbourdisc/scamper_neighbourdisc_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT neighbourdisc/scamper-scamper_neighbourdisc_warts.o -MD -MP -MF neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_warts.Tpo -c -o neighbourdisc/scamper-scamper_neighbourdisc_warts.o `test -f 'neighbourdisc/scamper_neighbourdisc_warts.c' || echo '$(srcdir)/'`neighbourdisc/scamper_neighbourdisc_warts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_warts.Tpo neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='neighbourdisc/scamper_neighbourdisc_warts.c' object='neighbourdisc/scamper-scamper_neighbourdisc_warts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o neighbourdisc/scamper-scamper_neighbourdisc_warts.o `test -f 'neighbourdisc/scamper_neighbourdisc_warts.c' || echo '$(srcdir)/'`neighbourdisc/scamper_neighbourdisc_warts.c neighbourdisc/scamper-scamper_neighbourdisc_warts.obj: neighbourdisc/scamper_neighbourdisc_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT neighbourdisc/scamper-scamper_neighbourdisc_warts.obj -MD -MP -MF neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_warts.Tpo -c -o neighbourdisc/scamper-scamper_neighbourdisc_warts.obj `if test -f 'neighbourdisc/scamper_neighbourdisc_warts.c'; then $(CYGPATH_W) 'neighbourdisc/scamper_neighbourdisc_warts.c'; else $(CYGPATH_W) '$(srcdir)/neighbourdisc/scamper_neighbourdisc_warts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_warts.Tpo neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='neighbourdisc/scamper_neighbourdisc_warts.c' object='neighbourdisc/scamper-scamper_neighbourdisc_warts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o neighbourdisc/scamper-scamper_neighbourdisc_warts.obj `if test -f 'neighbourdisc/scamper_neighbourdisc_warts.c'; then $(CYGPATH_W) 'neighbourdisc/scamper_neighbourdisc_warts.c'; else $(CYGPATH_W) '$(srcdir)/neighbourdisc/scamper_neighbourdisc_warts.c'; fi` neighbourdisc/scamper-scamper_neighbourdisc_do.o: neighbourdisc/scamper_neighbourdisc_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT neighbourdisc/scamper-scamper_neighbourdisc_do.o -MD -MP -MF neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_do.Tpo -c -o neighbourdisc/scamper-scamper_neighbourdisc_do.o `test -f 'neighbourdisc/scamper_neighbourdisc_do.c' || echo '$(srcdir)/'`neighbourdisc/scamper_neighbourdisc_do.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_do.Tpo neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='neighbourdisc/scamper_neighbourdisc_do.c' object='neighbourdisc/scamper-scamper_neighbourdisc_do.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o neighbourdisc/scamper-scamper_neighbourdisc_do.o `test -f 'neighbourdisc/scamper_neighbourdisc_do.c' || echo '$(srcdir)/'`neighbourdisc/scamper_neighbourdisc_do.c neighbourdisc/scamper-scamper_neighbourdisc_do.obj: neighbourdisc/scamper_neighbourdisc_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT neighbourdisc/scamper-scamper_neighbourdisc_do.obj -MD -MP -MF neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_do.Tpo -c -o neighbourdisc/scamper-scamper_neighbourdisc_do.obj `if test -f 'neighbourdisc/scamper_neighbourdisc_do.c'; then $(CYGPATH_W) 'neighbourdisc/scamper_neighbourdisc_do.c'; else $(CYGPATH_W) '$(srcdir)/neighbourdisc/scamper_neighbourdisc_do.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_do.Tpo neighbourdisc/$(DEPDIR)/scamper-scamper_neighbourdisc_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='neighbourdisc/scamper_neighbourdisc_do.c' object='neighbourdisc/scamper-scamper_neighbourdisc_do.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o neighbourdisc/scamper-scamper_neighbourdisc_do.obj `if test -f 'neighbourdisc/scamper_neighbourdisc_do.c'; then $(CYGPATH_W) 'neighbourdisc/scamper_neighbourdisc_do.c'; else $(CYGPATH_W) '$(srcdir)/neighbourdisc/scamper_neighbourdisc_do.c'; fi` tbit/scamper-scamper_tbit.o: tbit/scamper_tbit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tbit/scamper-scamper_tbit.o -MD -MP -MF tbit/$(DEPDIR)/scamper-scamper_tbit.Tpo -c -o tbit/scamper-scamper_tbit.o `test -f 'tbit/scamper_tbit.c' || echo '$(srcdir)/'`tbit/scamper_tbit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tbit/$(DEPDIR)/scamper-scamper_tbit.Tpo tbit/$(DEPDIR)/scamper-scamper_tbit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tbit/scamper_tbit.c' object='tbit/scamper-scamper_tbit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tbit/scamper-scamper_tbit.o `test -f 'tbit/scamper_tbit.c' || echo '$(srcdir)/'`tbit/scamper_tbit.c tbit/scamper-scamper_tbit.obj: tbit/scamper_tbit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tbit/scamper-scamper_tbit.obj -MD -MP -MF tbit/$(DEPDIR)/scamper-scamper_tbit.Tpo -c -o tbit/scamper-scamper_tbit.obj `if test -f 'tbit/scamper_tbit.c'; then $(CYGPATH_W) 'tbit/scamper_tbit.c'; else $(CYGPATH_W) '$(srcdir)/tbit/scamper_tbit.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tbit/$(DEPDIR)/scamper-scamper_tbit.Tpo tbit/$(DEPDIR)/scamper-scamper_tbit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tbit/scamper_tbit.c' object='tbit/scamper-scamper_tbit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tbit/scamper-scamper_tbit.obj `if test -f 'tbit/scamper_tbit.c'; then $(CYGPATH_W) 'tbit/scamper_tbit.c'; else $(CYGPATH_W) '$(srcdir)/tbit/scamper_tbit.c'; fi` tbit/scamper-scamper_tbit_warts.o: tbit/scamper_tbit_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tbit/scamper-scamper_tbit_warts.o -MD -MP -MF tbit/$(DEPDIR)/scamper-scamper_tbit_warts.Tpo -c -o tbit/scamper-scamper_tbit_warts.o `test -f 'tbit/scamper_tbit_warts.c' || echo '$(srcdir)/'`tbit/scamper_tbit_warts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tbit/$(DEPDIR)/scamper-scamper_tbit_warts.Tpo tbit/$(DEPDIR)/scamper-scamper_tbit_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tbit/scamper_tbit_warts.c' object='tbit/scamper-scamper_tbit_warts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tbit/scamper-scamper_tbit_warts.o `test -f 'tbit/scamper_tbit_warts.c' || echo '$(srcdir)/'`tbit/scamper_tbit_warts.c tbit/scamper-scamper_tbit_warts.obj: tbit/scamper_tbit_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tbit/scamper-scamper_tbit_warts.obj -MD -MP -MF tbit/$(DEPDIR)/scamper-scamper_tbit_warts.Tpo -c -o tbit/scamper-scamper_tbit_warts.obj `if test -f 'tbit/scamper_tbit_warts.c'; then $(CYGPATH_W) 'tbit/scamper_tbit_warts.c'; else $(CYGPATH_W) '$(srcdir)/tbit/scamper_tbit_warts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tbit/$(DEPDIR)/scamper-scamper_tbit_warts.Tpo tbit/$(DEPDIR)/scamper-scamper_tbit_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tbit/scamper_tbit_warts.c' object='tbit/scamper-scamper_tbit_warts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tbit/scamper-scamper_tbit_warts.obj `if test -f 'tbit/scamper_tbit_warts.c'; then $(CYGPATH_W) 'tbit/scamper_tbit_warts.c'; else $(CYGPATH_W) '$(srcdir)/tbit/scamper_tbit_warts.c'; fi` tbit/scamper-scamper_tbit_text.o: tbit/scamper_tbit_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tbit/scamper-scamper_tbit_text.o -MD -MP -MF tbit/$(DEPDIR)/scamper-scamper_tbit_text.Tpo -c -o tbit/scamper-scamper_tbit_text.o `test -f 'tbit/scamper_tbit_text.c' || echo '$(srcdir)/'`tbit/scamper_tbit_text.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tbit/$(DEPDIR)/scamper-scamper_tbit_text.Tpo tbit/$(DEPDIR)/scamper-scamper_tbit_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tbit/scamper_tbit_text.c' object='tbit/scamper-scamper_tbit_text.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tbit/scamper-scamper_tbit_text.o `test -f 'tbit/scamper_tbit_text.c' || echo '$(srcdir)/'`tbit/scamper_tbit_text.c tbit/scamper-scamper_tbit_text.obj: tbit/scamper_tbit_text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tbit/scamper-scamper_tbit_text.obj -MD -MP -MF tbit/$(DEPDIR)/scamper-scamper_tbit_text.Tpo -c -o tbit/scamper-scamper_tbit_text.obj `if test -f 'tbit/scamper_tbit_text.c'; then $(CYGPATH_W) 'tbit/scamper_tbit_text.c'; else $(CYGPATH_W) '$(srcdir)/tbit/scamper_tbit_text.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tbit/$(DEPDIR)/scamper-scamper_tbit_text.Tpo tbit/$(DEPDIR)/scamper-scamper_tbit_text.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tbit/scamper_tbit_text.c' object='tbit/scamper-scamper_tbit_text.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tbit/scamper-scamper_tbit_text.obj `if test -f 'tbit/scamper_tbit_text.c'; then $(CYGPATH_W) 'tbit/scamper_tbit_text.c'; else $(CYGPATH_W) '$(srcdir)/tbit/scamper_tbit_text.c'; fi` tbit/scamper-scamper_tbit_json.o: tbit/scamper_tbit_json.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tbit/scamper-scamper_tbit_json.o -MD -MP -MF tbit/$(DEPDIR)/scamper-scamper_tbit_json.Tpo -c -o tbit/scamper-scamper_tbit_json.o `test -f 'tbit/scamper_tbit_json.c' || echo '$(srcdir)/'`tbit/scamper_tbit_json.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tbit/$(DEPDIR)/scamper-scamper_tbit_json.Tpo tbit/$(DEPDIR)/scamper-scamper_tbit_json.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tbit/scamper_tbit_json.c' object='tbit/scamper-scamper_tbit_json.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tbit/scamper-scamper_tbit_json.o `test -f 'tbit/scamper_tbit_json.c' || echo '$(srcdir)/'`tbit/scamper_tbit_json.c tbit/scamper-scamper_tbit_json.obj: tbit/scamper_tbit_json.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tbit/scamper-scamper_tbit_json.obj -MD -MP -MF tbit/$(DEPDIR)/scamper-scamper_tbit_json.Tpo -c -o tbit/scamper-scamper_tbit_json.obj `if test -f 'tbit/scamper_tbit_json.c'; then $(CYGPATH_W) 'tbit/scamper_tbit_json.c'; else $(CYGPATH_W) '$(srcdir)/tbit/scamper_tbit_json.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tbit/$(DEPDIR)/scamper-scamper_tbit_json.Tpo tbit/$(DEPDIR)/scamper-scamper_tbit_json.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tbit/scamper_tbit_json.c' object='tbit/scamper-scamper_tbit_json.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tbit/scamper-scamper_tbit_json.obj `if test -f 'tbit/scamper_tbit_json.c'; then $(CYGPATH_W) 'tbit/scamper_tbit_json.c'; else $(CYGPATH_W) '$(srcdir)/tbit/scamper_tbit_json.c'; fi` tbit/scamper-scamper_tbit_do.o: tbit/scamper_tbit_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tbit/scamper-scamper_tbit_do.o -MD -MP -MF tbit/$(DEPDIR)/scamper-scamper_tbit_do.Tpo -c -o tbit/scamper-scamper_tbit_do.o `test -f 'tbit/scamper_tbit_do.c' || echo '$(srcdir)/'`tbit/scamper_tbit_do.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tbit/$(DEPDIR)/scamper-scamper_tbit_do.Tpo tbit/$(DEPDIR)/scamper-scamper_tbit_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tbit/scamper_tbit_do.c' object='tbit/scamper-scamper_tbit_do.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tbit/scamper-scamper_tbit_do.o `test -f 'tbit/scamper_tbit_do.c' || echo '$(srcdir)/'`tbit/scamper_tbit_do.c tbit/scamper-scamper_tbit_do.obj: tbit/scamper_tbit_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT tbit/scamper-scamper_tbit_do.obj -MD -MP -MF tbit/$(DEPDIR)/scamper-scamper_tbit_do.Tpo -c -o tbit/scamper-scamper_tbit_do.obj `if test -f 'tbit/scamper_tbit_do.c'; then $(CYGPATH_W) 'tbit/scamper_tbit_do.c'; else $(CYGPATH_W) '$(srcdir)/tbit/scamper_tbit_do.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tbit/$(DEPDIR)/scamper-scamper_tbit_do.Tpo tbit/$(DEPDIR)/scamper-scamper_tbit_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tbit/scamper_tbit_do.c' object='tbit/scamper-scamper_tbit_do.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o tbit/scamper-scamper_tbit_do.obj `if test -f 'tbit/scamper_tbit_do.c'; then $(CYGPATH_W) 'tbit/scamper_tbit_do.c'; else $(CYGPATH_W) '$(srcdir)/tbit/scamper_tbit_do.c'; fi` sniff/scamper-scamper_sniff.o: sniff/scamper_sniff.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sniff/scamper-scamper_sniff.o -MD -MP -MF sniff/$(DEPDIR)/scamper-scamper_sniff.Tpo -c -o sniff/scamper-scamper_sniff.o `test -f 'sniff/scamper_sniff.c' || echo '$(srcdir)/'`sniff/scamper_sniff.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sniff/$(DEPDIR)/scamper-scamper_sniff.Tpo sniff/$(DEPDIR)/scamper-scamper_sniff.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sniff/scamper_sniff.c' object='sniff/scamper-scamper_sniff.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sniff/scamper-scamper_sniff.o `test -f 'sniff/scamper_sniff.c' || echo '$(srcdir)/'`sniff/scamper_sniff.c sniff/scamper-scamper_sniff.obj: sniff/scamper_sniff.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sniff/scamper-scamper_sniff.obj -MD -MP -MF sniff/$(DEPDIR)/scamper-scamper_sniff.Tpo -c -o sniff/scamper-scamper_sniff.obj `if test -f 'sniff/scamper_sniff.c'; then $(CYGPATH_W) 'sniff/scamper_sniff.c'; else $(CYGPATH_W) '$(srcdir)/sniff/scamper_sniff.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sniff/$(DEPDIR)/scamper-scamper_sniff.Tpo sniff/$(DEPDIR)/scamper-scamper_sniff.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sniff/scamper_sniff.c' object='sniff/scamper-scamper_sniff.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sniff/scamper-scamper_sniff.obj `if test -f 'sniff/scamper_sniff.c'; then $(CYGPATH_W) 'sniff/scamper_sniff.c'; else $(CYGPATH_W) '$(srcdir)/sniff/scamper_sniff.c'; fi` sniff/scamper-scamper_sniff_warts.o: sniff/scamper_sniff_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sniff/scamper-scamper_sniff_warts.o -MD -MP -MF sniff/$(DEPDIR)/scamper-scamper_sniff_warts.Tpo -c -o sniff/scamper-scamper_sniff_warts.o `test -f 'sniff/scamper_sniff_warts.c' || echo '$(srcdir)/'`sniff/scamper_sniff_warts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sniff/$(DEPDIR)/scamper-scamper_sniff_warts.Tpo sniff/$(DEPDIR)/scamper-scamper_sniff_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sniff/scamper_sniff_warts.c' object='sniff/scamper-scamper_sniff_warts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sniff/scamper-scamper_sniff_warts.o `test -f 'sniff/scamper_sniff_warts.c' || echo '$(srcdir)/'`sniff/scamper_sniff_warts.c sniff/scamper-scamper_sniff_warts.obj: sniff/scamper_sniff_warts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sniff/scamper-scamper_sniff_warts.obj -MD -MP -MF sniff/$(DEPDIR)/scamper-scamper_sniff_warts.Tpo -c -o sniff/scamper-scamper_sniff_warts.obj `if test -f 'sniff/scamper_sniff_warts.c'; then $(CYGPATH_W) 'sniff/scamper_sniff_warts.c'; else $(CYGPATH_W) '$(srcdir)/sniff/scamper_sniff_warts.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sniff/$(DEPDIR)/scamper-scamper_sniff_warts.Tpo sniff/$(DEPDIR)/scamper-scamper_sniff_warts.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sniff/scamper_sniff_warts.c' object='sniff/scamper-scamper_sniff_warts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sniff/scamper-scamper_sniff_warts.obj `if test -f 'sniff/scamper_sniff_warts.c'; then $(CYGPATH_W) 'sniff/scamper_sniff_warts.c'; else $(CYGPATH_W) '$(srcdir)/sniff/scamper_sniff_warts.c'; fi` sniff/scamper-scamper_sniff_do.o: sniff/scamper_sniff_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sniff/scamper-scamper_sniff_do.o -MD -MP -MF sniff/$(DEPDIR)/scamper-scamper_sniff_do.Tpo -c -o sniff/scamper-scamper_sniff_do.o `test -f 'sniff/scamper_sniff_do.c' || echo '$(srcdir)/'`sniff/scamper_sniff_do.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sniff/$(DEPDIR)/scamper-scamper_sniff_do.Tpo sniff/$(DEPDIR)/scamper-scamper_sniff_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sniff/scamper_sniff_do.c' object='sniff/scamper-scamper_sniff_do.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sniff/scamper-scamper_sniff_do.o `test -f 'sniff/scamper_sniff_do.c' || echo '$(srcdir)/'`sniff/scamper_sniff_do.c sniff/scamper-scamper_sniff_do.obj: sniff/scamper_sniff_do.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -MT sniff/scamper-scamper_sniff_do.obj -MD -MP -MF sniff/$(DEPDIR)/scamper-scamper_sniff_do.Tpo -c -o sniff/scamper-scamper_sniff_do.obj `if test -f 'sniff/scamper_sniff_do.c'; then $(CYGPATH_W) 'sniff/scamper_sniff_do.c'; else $(CYGPATH_W) '$(srcdir)/sniff/scamper_sniff_do.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sniff/$(DEPDIR)/scamper-scamper_sniff_do.Tpo sniff/$(DEPDIR)/scamper-scamper_sniff_do.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sniff/scamper_sniff_do.c' object='sniff/scamper-scamper_sniff_do.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(scamper_CFLAGS) $(CFLAGS) -c -o sniff/scamper-scamper_sniff_do.obj `if test -f 'sniff/scamper_sniff_do.c'; then $(CYGPATH_W) 'sniff/scamper_sniff_do.c'; else $(CYGPATH_W) '$(srcdir)/sniff/scamper_sniff_do.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf ../.libs ../_libs -rm -rf dealias/.libs dealias/_libs -rm -rf neighbourdisc/.libs neighbourdisc/_libs -rm -rf ping/.libs ping/_libs -rm -rf sniff/.libs sniff/_libs -rm -rf sting/.libs sting/_libs -rm -rf tbit/.libs tbit/_libs -rm -rf trace/.libs trace/_libs -rm -rf tracelb/.libs tracelb/_libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man3: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man3dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.3[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ done; } uninstall-man3: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.3[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) install-man5: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../$(DEPDIR)/$(am__dirstamp) -rm -f ../$(am__dirstamp) -rm -f dealias/$(DEPDIR)/$(am__dirstamp) -rm -f dealias/$(am__dirstamp) -rm -f neighbourdisc/$(DEPDIR)/$(am__dirstamp) -rm -f neighbourdisc/$(am__dirstamp) -rm -f ping/$(DEPDIR)/$(am__dirstamp) -rm -f ping/$(am__dirstamp) -rm -f sniff/$(DEPDIR)/$(am__dirstamp) -rm -f sniff/$(am__dirstamp) -rm -f sting/$(DEPDIR)/$(am__dirstamp) -rm -f sting/$(am__dirstamp) -rm -f tbit/$(DEPDIR)/$(am__dirstamp) -rm -f tbit/$(am__dirstamp) -rm -f trace/$(DEPDIR)/$(am__dirstamp) -rm -f trace/$(am__dirstamp) -rm -f tracelb/$(DEPDIR)/$(am__dirstamp) -rm -f tracelb/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ../$(DEPDIR) ./$(DEPDIR) dealias/$(DEPDIR) neighbourdisc/$(DEPDIR) ping/$(DEPDIR) sniff/$(DEPDIR) sting/$(DEPDIR) tbit/$(DEPDIR) trace/$(DEPDIR) tracelb/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man3 install-man5 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../$(DEPDIR) ./$(DEPDIR) dealias/$(DEPDIR) neighbourdisc/$(DEPDIR) ping/$(DEPDIR) sniff/$(DEPDIR) sting/$(DEPDIR) tbit/$(DEPDIR) trace/$(DEPDIR) tracelb/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-man uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS 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-man1 install-man3 \ install-man5 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 tags-am uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-man uninstall-man1 \ uninstall-man3 uninstall-man5 .PRECIOUS: Makefile # 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: scamper-cvs-20171204/scamper/tracelb/.cvsignore000644 001751 000000 00000000034 12415633115 021157 0ustar00mjlwheel000000 000000 .deps .dirstamp .libs *.lo scamper-cvs-20171204/scamper/tracelb/scamper_tracelb.c000644 001751 000000 00000044765 12346362030 022472 0ustar00mjlwheel000000 000000 /* * scamper_tracelb.c * * $Id: scamper_tracelb.c,v 1.55 2014/06/12 17:32:08 mjl Exp $ * * Copyright (C) 2008-2010 The University of Waikato * Copyright (C) 2012 The Regents of the University of California * Author: Matthew Luckie * * Load-balancer traceroute technique authored by * Ben Augustin, Timur Friedman, Renata Teixeira; "Measuring Load-balanced * Paths in the Internet", in Proc. Internet Measurement Conference 2007. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_tracelb.c,v 1.55 2014/06/12 17:32:08 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_tracelb.h" #include "utils.h" typedef struct tracelb_fwdpathc { int pathc; int pathcc; int loop; } tracelb_fwdpathc_t; /* * scamper_tracelb_node_cmp * * function to compare two nodes, taking into account the possibility that * the quoted ttl field is present and has a value. */ int scamper_tracelb_node_cmp(const scamper_tracelb_node_t *a, const scamper_tracelb_node_t *b) { int i; if(a->addr == NULL || b->addr == NULL) { if(a->addr == NULL && b->addr == NULL) return 0; else if(a->addr == NULL) return -1; return 1; } if((i = scamper_addr_human_cmp(a->addr, b->addr)) != 0) return i; if(SCAMPER_TRACELB_NODE_QTTL(a) == SCAMPER_TRACELB_NODE_QTTL(b)) { if(SCAMPER_TRACELB_NODE_QTTL(a)) { if(a->q_ttl < b->q_ttl) return -1; if(a->q_ttl > b->q_ttl) return 1; } return 0; } else if(SCAMPER_TRACELB_NODE_QTTL(a)) { return -1; } return 1; } /* * scamper_tracelb_link_cmp * * function to compare two links. the comparison is based on the nodes * present in each link. */ int scamper_tracelb_link_cmp(const scamper_tracelb_link_t *a, const scamper_tracelb_link_t *b) { int i; if(a == b) return 0; if((i = scamper_tracelb_node_cmp(a->from, b->from)) != 0) return i; if(a->to != NULL && b->to != NULL) return scamper_tracelb_node_cmp(a->to, b->to); if(a->to == NULL && b->to == NULL) return 0; else if(a->to == NULL) return 1; else return -1; } /* * tracelb_node_link_cmp * * compare the `to' node of two links. * the from node is the same; this function is used to compare a set of links * attached to a single node and order them accordingly. */ static int tracelb_node_link_cmp(const scamper_tracelb_link_t *a, const scamper_tracelb_link_t *b) { assert(a->from == b->from); return scamper_tracelb_node_cmp(a->to, b->to); } /* * scamper_tracelb_nodes_extract * * function to extract a set of nodes between two points in the graph. */ static void tracelb_nodes_extract(const scamper_tracelb_t *trace, scamper_tracelb_node_t *from, scamper_tracelb_node_t *to, scamper_tracelb_node_t **nodes, int *nodec) { uint16_t i; if(array_find((void **)nodes, *nodec, from, (array_cmp_t)scamper_tracelb_node_cmp) != NULL) return; nodes[*nodec] = from; *nodec = *nodec + 1; array_qsort((void **)nodes, *nodec, (array_cmp_t)scamper_tracelb_node_cmp); if(to != NULL && from == to) return; for(i=0; ilinkc; i++) { tracelb_nodes_extract(trace, from->links[i]->to, to, nodes, nodec); } return; } /* * tracelb_nodes_extract * * recursive function to extract a set of nodes between two points in the * graph. */ int scamper_tracelb_nodes_extract(const scamper_tracelb_t *trace, scamper_tracelb_node_t *from, scamper_tracelb_node_t *to, scamper_tracelb_node_t **nodes) { int nodec = 0; tracelb_nodes_extract(trace, from, to, nodes, &nodec); return nodec; } /* * tracelb_node_index * * find the corresponding index for a node in the trace. */ static int tracelb_node_index(const scamper_tracelb_t *trace, const scamper_tracelb_node_t *node) { uint16_t i; for(i=0; inodec; i++) { if(trace->nodes[i] == node) return i; } return -1; } int scamper_tracelb_node_convergencepoint(const scamper_tracelb_t *trace, const int *fwdpathc, int from, int *to) { scamper_tracelb_node_t *node; int n, nn, rc = -1; int *loop; /* if there are no forward links, then there is no convergence point */ if(trace->nodes[from]->linkc == 0) { *to = -1; return 0; } /* * if there is only one forward link, then the convergence point is the * next node */ if(trace->nodes[from]->linkc == 1) { if((n=tracelb_node_index(trace, trace->nodes[from]->links[0]->to)) == -1) return -1; *to = n; return 0; } /* * allocate an array to keep track of which nodes have been visited so * far on this exploration */ if((loop = malloc_zero(sizeof(int) * trace->nodec)) == NULL) return -1; n = nn = from; loop[n] = 1; for(;;) { node = trace->nodes[n]; /* if there is no forward link, then there is no convergence point */ if(node->linkc == 0) { *to = -1; rc = 0; break; } /* get the index into the node array of the next node to visit */ if((n = tracelb_node_index(trace, node->links[0]->to)) == -1) break; /* check for loops (i.e. already visited) */ if(loop[n] != 0) { *to = -1; rc = 0; break; } loop[n] = 1; /* * if the path converges here, then return the index into the node array * where it converges */ if(fwdpathc[n] >= fwdpathc[nn]) { *to = n; rc = 0; break; } } free(loop); return rc; } /* * tracelb_fwdpathc * * recursive function used to help determine how many unique forward * paths can be observed at a particular node. * */ static int tracelb_fwdpathc(const scamper_tracelb_t *trace, int n, tracelb_fwdpathc_t *nodes) { scamper_tracelb_link_t *link; scamper_tracelb_node_t *node; uint16_t i; int nn, c, t; if(nodes[n].pathc != 0) { /* * if we have already visited the nodes below this point * (non-zero pathc for the current node) then we increment the * number of paths observable going forward by the number of * unique paths from that point */ nodes[n].pathcc += nodes[n].pathc; node = trace->nodes[n]; for(i=0; ilinkc; i++) { link = node->links[i]; nn = tracelb_node_index(trace, link->to); assert(nn >= 0 && nn < trace->nodec); tracelb_fwdpathc(trace, nn, nodes); } } else if(trace->nodes[n]->linkc > 0) { /* * count the number of unique paths forward from this point by visiting * each node forward from this point */ nodes[n].loop = 1; c = 0; node = trace->nodes[n]; for(i=0; ilinkc; i++) { link = node->links[i]; /* get the index of the next node */ nn = tracelb_node_index(trace, link->to); assert(nn >= 0 && nn < trace->nodec); /* skip over any nodes that would cause us to get into a loop */ if(nodes[nn].loop != 0) continue; /* count the number of paths beneath it */ t = tracelb_fwdpathc(trace, nn, nodes); assert(t > 0); /* more paths! */ c += t; } /* at the end, we store the number of unique paths with the node */ nodes[n].pathcc = nodes[n].pathc = c; nodes[n].loop = 0; } else { /* * can't go any further. the first time this node has been visited. * it is part of one unique path so far. */ nodes[n].pathcc = nodes[n].pathc = 1; } return nodes[n].pathc; } /* * scamper_tracelb_fwdpathc * * count the number of unique paths visible from one point towards a * destination. */ int scamper_tracelb_fwdpathc(const scamper_tracelb_t *trace, int *nodes) { tracelb_fwdpathc_t *fwdpathc; uint16_t i; if(trace->nodec == 0) return 0; if((fwdpathc = malloc_zero(sizeof(tracelb_fwdpathc_t)*trace->nodec)) == NULL) return -1; tracelb_fwdpathc(trace, 0, fwdpathc); for(i=0; inodec; i++) { nodes[i] = fwdpathc[i].pathcc; } free(fwdpathc); return 0; } scamper_tracelb_node_t *scamper_tracelb_node_alloc(scamper_addr_t *addr) { scamper_tracelb_node_t *node; if((node = malloc_zero(sizeof(scamper_tracelb_node_t))) != NULL) { if(addr != NULL) node->addr = scamper_addr_use(addr); } return node; } void scamper_tracelb_node_free(scamper_tracelb_node_t *node) { if(node == NULL) return; if(node->links != NULL) free(node->links); if(node->addr != NULL) scamper_addr_free(node->addr); free(node); return; } int scamper_tracelb_node_add(scamper_tracelb_t *trace, scamper_tracelb_node_t *node) { size_t len = (trace->nodec + 1) * sizeof(scamper_tracelb_node_t *); if(realloc_wrap((void **)&trace->nodes, len) == 0) { trace->nodes[trace->nodec++] = node; return 0; } return -1; } scamper_tracelb_node_t *scamper_tracelb_node_find(scamper_tracelb_t *trace, scamper_tracelb_node_t *node) { uint16_t i; for(i=0; inodec; i++) { if(trace->nodes[i]->addr == NULL) continue; if(scamper_tracelb_node_cmp(trace->nodes[i], node) == 0) return trace->nodes[i]; } return NULL; } scamper_tracelb_reply_t *scamper_tracelb_reply_alloc(scamper_addr_t *addr) { scamper_tracelb_reply_t *reply; if((reply = malloc_zero(sizeof(scamper_tracelb_reply_t))) == NULL) return NULL; if(addr != NULL) reply->reply_from = scamper_addr_use(addr); return reply; } void scamper_tracelb_reply_free(scamper_tracelb_reply_t *reply) { if(reply == NULL) return; if(reply->reply_from != NULL) scamper_addr_free(reply->reply_from); if((reply->reply_flags & SCAMPER_TRACELB_REPLY_FLAG_TCP) == 0) scamper_icmpext_free(reply->reply_icmp_ext); free(reply); return; } scamper_tracelb_probe_t *scamper_tracelb_probe_alloc(void) { scamper_tracelb_probe_t *probe; probe = malloc_zero(sizeof(scamper_tracelb_probe_t)); return probe; } void scamper_tracelb_probe_free(scamper_tracelb_probe_t *probe) { uint16_t i; if(probe == NULL) return; if(probe->rxs != NULL) { for(i=0; irxc; i++) scamper_tracelb_reply_free(probe->rxs[i]); free(probe->rxs); } free(probe); return; } int scamper_tracelb_probe_reply(scamper_tracelb_probe_t *probe, scamper_tracelb_reply_t *reply) { size_t len; /* extend the replies array and store the reply in it */ len = (probe->rxc + 1) * sizeof(scamper_tracelb_reply_t *); if(realloc_wrap((void **)&probe->rxs, len) != 0) return -1; probe->rxs[probe->rxc++] = reply; return 0; } int scamper_tracelb_probeset_probes_alloc(scamper_tracelb_probeset_t *set, uint16_t probec) { size_t len = sizeof(scamper_tracelb_probe_t *) * probec; if((set->probes = malloc_zero(len)) == NULL) return -1; return 0; } int scamper_tracelb_probeset_add(scamper_tracelb_probeset_t *probeset, scamper_tracelb_probe_t *probe) { size_t len = (probeset->probec + 1) * sizeof(scamper_tracelb_probe_t *); if(realloc_wrap((void **)&probeset->probes, len) != 0) return -1; probeset->probes[probeset->probec++] = probe; return 0; } scamper_tracelb_probeset_t *scamper_tracelb_probeset_alloc(void) { scamper_tracelb_probeset_t *set; set = malloc_zero(sizeof(scamper_tracelb_probeset_t)); return set; } void scamper_tracelb_probeset_free(scamper_tracelb_probeset_t *set) { uint16_t i; if(set == NULL) return; if(set->probes != NULL) { for(i=0; iprobec; i++) scamper_tracelb_probe_free(set->probes[i]); free(set->probes); } free(set); return; } scamper_tracelb_link_t *scamper_tracelb_link_find(const scamper_tracelb_t *tr, scamper_tracelb_link_t *link) { return array_find((void **)tr->links, tr->linkc, link, (array_cmp_t)scamper_tracelb_link_cmp); } scamper_tracelb_link_t *scamper_tracelb_link_alloc(void) { return (scamper_tracelb_link_t *)malloc_zero(sizeof(scamper_tracelb_link_t)); } void scamper_tracelb_link_free(scamper_tracelb_link_t *link) { uint8_t i; if(link == NULL) return; if(link->sets != NULL) { for(i=0; ihopc; i++) scamper_tracelb_probeset_free(link->sets[i]); free(link->sets); } free(link); return; } int scamper_tracelb_link_add(scamper_tracelb_t *trace, scamper_tracelb_link_t *link) { scamper_tracelb_node_t *node = NULL; size_t size; uint16_t i; /* * to start with, find the node the link originates from, and add the link * to that node */ for(i=0; inodec; i++) { if((node = trace->nodes[i]) == link->from) break; } if(i == trace->nodec) return -1; assert(node != NULL); /* add the link to the node */ size = sizeof(scamper_tracelb_link_t *) * (node->linkc+1); if(realloc_wrap((void **)&node->links, size) == 0) { node->links[node->linkc++] = link; array_qsort((void **)node->links, node->linkc, (array_cmp_t)scamper_tracelb_link_cmp); } else return -1; /* add the link to the set of links held in the trace */ size = sizeof(scamper_tracelb_link_t *) * (trace->linkc+1); if(realloc_wrap((void **)&trace->links, size) == 0) { trace->links[trace->linkc++] = link; array_qsort((void **)trace->links, trace->linkc, (array_cmp_t)scamper_tracelb_link_cmp); return 0; } return -1; } /* * scamper_tracelb_link_zerottlfwd * * determine if a link is a case of zero-ttl forwarding. */ int scamper_tracelb_link_zerottlfwd(const scamper_tracelb_link_t *link) { if(link->from->addr == NULL) return 0; if(scamper_addr_cmp(link->from->addr, link->to->addr) != 0) return 0; if(SCAMPER_TRACELB_NODE_QTTL(link->from) == 0) return 0; if(SCAMPER_TRACELB_NODE_QTTL(link->to) == 0) return 0; if(link->from->q_ttl != 0 || link->to->q_ttl != 1) return 0; return 1; } int scamper_tracelb_link_probesets_alloc(scamper_tracelb_link_t *link, uint8_t hopc) { size_t len = hopc * sizeof(scamper_tracelb_probeset_t *); if((link->sets = malloc_zero(len)) == NULL) return -1; return 0; } int scamper_tracelb_link_probeset(scamper_tracelb_link_t *link, scamper_tracelb_probeset_t *set) { size_t len = (link->hopc + 1) * sizeof(scamper_tracelb_probeset_t *); if(realloc_wrap((void **)&link->sets, len) == 0) { link->sets[link->hopc++] = set; return 0; } return -1; } int scamper_tracelb_nodes_alloc(scamper_tracelb_t *trace, uint16_t count) { size_t size = sizeof(scamper_tracelb_node_t *) * count; if((trace->nodes = malloc_zero(size)) != NULL) return 0; return -1; } int scamper_tracelb_links_alloc(scamper_tracelb_t *trace, uint16_t count) { size_t size = sizeof(scamper_tracelb_link_t *) * count; if((trace->links = malloc_zero(size)) != NULL) return 0; return -1; } int scamper_tracelb_node_links_alloc(scamper_tracelb_node_t *node, uint16_t count) { size_t size = sizeof(scamper_tracelb_link_t *) * count; if((node->links = malloc_zero(size)) != NULL) return 0; return -1; } int scamper_tracelb_probe_replies_alloc(scamper_tracelb_probe_t *probe, uint16_t count) { size_t size = sizeof(scamper_tracelb_reply_t *) * count; if((probe->rxs = malloc_zero(size)) != NULL) return 0; return -1; } void scamper_tracelb_node_links_sort(scamper_tracelb_node_t *node) { array_qsort((void **)node->links, node->linkc, (array_cmp_t)tracelb_node_link_cmp); return; } scamper_addr_t *scamper_tracelb_addr(const void *va) { return ((scamper_tracelb_t *)va)->dst; } const char *scamper_tracelb_type_tostr(const scamper_tracelb_t *trace) { if(trace->type == SCAMPER_TRACELB_TYPE_UDP_DPORT) return "udp-dport"; if(trace->type == SCAMPER_TRACELB_TYPE_ICMP_ECHO) return "icmp-echo"; if(trace->type == SCAMPER_TRACELB_TYPE_UDP_SPORT) return "udp-sport"; if(trace->type == SCAMPER_TRACELB_TYPE_TCP_SPORT) return "tcp-sport"; if(trace->type == SCAMPER_TRACELB_TYPE_TCP_ACK_SPORT) return "tcp-ack-sport"; return NULL; } int scamper_tracelb_sort(scamper_tracelb_t *trace) { scamper_tracelb_node_t **nodes = NULL; scamper_tracelb_node_t **nq = NULL; int i, k, n, q, qt; size_t size; uint16_t j; if(trace->nodec == 0) return 0; size = sizeof(scamper_tracelb_node_t *) * trace->nodec; if((nodes = malloc_zero(size)) == NULL || (nq = malloc_zero(size)) == NULL) goto err; n = 0; q = 0; nq[q++] = trace->nodes[0]; while(q > 0) { qt = q; for(i=0; inodec); nodes[n++] = nq[i]; for(j=0; jlinkc; j++) { for(k=0; klinks[j]->to == nq[k]) break; } if(k != q) continue; for(k=0; klinks[j]->to == nodes[k]) break; } if(k != n) continue; assert(q < trace->nodec); nq[q++] = nq[i]->links[j]->to; } } memmove(nq, nq+qt, (q-qt) * sizeof(scamper_tracelb_node_t *)); q -= qt; } assert(n == trace->nodec); memcpy(trace->nodes, nodes, trace->nodec*sizeof(scamper_tracelb_node_t *)); free(nodes); free(nq); return 0; err: if(nodes != NULL) free(nodes); if(nq != NULL) free(nq); return -1; } /* * scamper_tracelb_free * */ void scamper_tracelb_free(scamper_tracelb_t *trace) { uint16_t i; if(trace == NULL) return; if(trace->links != NULL) { for(i=0; ilinkc; i++) scamper_tracelb_link_free(trace->links[i]); free(trace->links); } if(trace->nodes != NULL) { for(i=0; inodec; i++) scamper_tracelb_node_free(trace->nodes[i]); free(trace->nodes); } if(trace->dst != NULL) scamper_addr_free(trace->dst); if(trace->src != NULL) scamper_addr_free(trace->src); if(trace->cycle != NULL) scamper_cycle_free(trace->cycle); if(trace->list != NULL) scamper_list_free(trace->list); free(trace); return; } /* * scamper_tracelb_alloc * * allocate the trace and all the possibly necessary data fields */ scamper_tracelb_t *scamper_tracelb_alloc() { return (scamper_tracelb_t *)malloc_zero(sizeof(scamper_tracelb_t)); } scamper-cvs-20171204/scamper/tracelb/scamper_tracelb.h000644 001751 000000 00000034412 11737356726 022505 0ustar00mjlwheel000000 000000 /* * scamper_tracelb.h * * $Id: scamper_tracelb.h,v 1.57 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2008-2009 The University of Waikato * Author: Matthew Luckie * * Load-balancer traceroute technique authored by * Ben Augustin, Timur Friedman, Renata Teixeira; "Measuring Load-balanced * Paths in the Internet", in Proc. Internet Measurement Conference 2007. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_TRACELB_H #define __SCAMPER_TRACELB_H #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" /* forward declare some important structures */ typedef struct scamper_tracelb_node scamper_tracelb_node_t; typedef struct scamper_tracelb_link scamper_tracelb_link_t; typedef struct scamper_tracelb_probe scamper_tracelb_probe_t; typedef struct scamper_tracelb_reply scamper_tracelb_reply_t; typedef struct scamper_tracelb_probeset scamper_tracelb_probeset_t; /* * these values give the 'type' member of a scamper_tracelb_t structure * some meaning. */ #define SCAMPER_TRACELB_TYPE_UDP_DPORT 0x01 /* vary udp-dport */ #define SCAMPER_TRACELB_TYPE_ICMP_ECHO 0x02 /* vary icmp checksum */ #define SCAMPER_TRACELB_TYPE_UDP_SPORT 0x03 /* vary udp-sport */ #define SCAMPER_TRACELB_TYPE_TCP_SPORT 0x04 /* vary tcp-sport */ #define SCAMPER_TRACELB_TYPE_TCP_ACK_SPORT 0x05 /* tcp-ack, vary sport */ /* * these values give the 'flags' member of a scamper_tracelb_node_t * structure some meaning. */ #define SCAMPER_TRACELB_NODE_FLAG_QTTL 0x01 #define SCAMPER_TRACELB_NODE_QTTL(node) \ ((node)->flags & SCAMPER_TRACELB_NODE_FLAG_QTTL) #define SCAMPER_TRACELB_REPLY_FLAG_REPLY_TTL 0x01 /* reply ttl included */ #define SCAMPER_TRACELB_REPLY_FLAG_TCP 0x02 /* reply is TCP */ #define SCAMPER_TRACELB_REPLY_IS_ICMP_TTL_EXP(reply) ( \ ((reply)->reply_flags & SCAMPER_TRACELB_REPLY_FLAG_TCP) == 0 && \ (((reply)->reply_from->type == SCAMPER_ADDR_TYPE_IPV4 && \ (reply)->reply_icmp_type == 11) || \ ((reply)->reply_from->type == SCAMPER_ADDR_TYPE_IPV6 && \ (reply)->reply_icmp_type == 3))) #define SCAMPER_TRACELB_REPLY_IS_ICMP_UNREACH(reply) ( \ ((reply)->reply_flags & SCAMPER_TRACELB_REPLY_FLAG_TCP) == 0 && \ (((reply)->reply_from->type == SCAMPER_ADDR_TYPE_IPV4 && \ (reply)->reply_icmp_type == 3) || \ ((reply)->reply_from->type == SCAMPER_ADDR_TYPE_IPV6 && \ (reply)->reply_icmp_type == 1))) #define SCAMPER_TRACELB_REPLY_IS_ICMP_UNREACH_PORT(reply) ( \ ((reply)->reply_flags & SCAMPER_TRACELB_REPLY_FLAG_TCP) == 0 && \ (((reply)->reply_from->type == SCAMPER_ADDR_TYPE_IPV4 && \ (reply)->reply_icmp_type == 3 && (reply)->reply_icmp_code == 3) || \ ((reply)->reply_from->type == SCAMPER_ADDR_TYPE_IPV6 && \ (reply)->reply_icmp_type == 1 && (reply)->reply_icmp_code == 4))) #define SCAMPER_TRACELB_REPLY_IS_TCP(reply) ( \ ((reply)->reply_flags & SCAMPER_TRACELB_REPLY_FLAG_TCP) != 0) #define SCAMPER_TRACELB_TYPE_IS_TCP(trace) ( \ ((trace)->type == SCAMPER_TRACELB_TYPE_TCP_SPORT || \ (trace)->type == SCAMPER_TRACELB_TYPE_TCP_ACK_SPORT)) #define SCAMPER_TRACELB_TYPE_IS_UDP(trace) ( \ ((trace)->type == SCAMPER_TRACELB_TYPE_UDP_SPORT || \ (trace)->type == SCAMPER_TRACELB_TYPE_UDP_DPORT)) #define SCAMPER_TRACELB_TYPE_IS_ICMP(trace) ( \ ((trace)->type == SCAMPER_TRACELB_TYPE_ICMP_ECHO)) #define SCAMPER_TRACELB_TYPE_VARY_SPORT(trace) ( \ ((trace)->type == SCAMPER_TRACELB_TYPE_UDP_SPORT || \ (trace)->type == SCAMPER_TRACELB_TYPE_TCP_SPORT || \ (trace)->type == SCAMPER_TRACELB_TYPE_TCP_ACK_SPORT)) /* * scamper_tracelb_reply_t * * record details of each reply received. */ struct scamper_tracelb_reply { scamper_addr_t *reply_from; /* source of response */ struct timeval reply_rx; /* receive time */ uint16_t reply_ipid; /* IP ID of reply packet */ uint8_t reply_ttl; /* ttl of the reply packet */ uint8_t reply_flags; /* reply flags */ union { struct scamper_tracelb_reply_icmp { uint8_t reply_icmp_type; /* icmp type of the reply */ uint8_t reply_icmp_code; /* icmp code of the reply */ uint8_t reply_icmp_q_tos; /* tos byte in quote */ uint8_t reply_icmp_q_ttl; /* ttl byte in quote */ scamper_icmpext_t *reply_icmp_ext; /* icmp extensions included */ } icmp; struct scamper_tracelb_reply_tcp { uint8_t reply_tcp_flags; /* tcp flags of the reply */ } tcp; } reply_un; }; #define reply_icmp_type reply_un.icmp.reply_icmp_type #define reply_icmp_code reply_un.icmp.reply_icmp_code #define reply_icmp_ext reply_un.icmp.reply_icmp_ext #define reply_icmp_q_ttl reply_un.icmp.reply_icmp_q_ttl #define reply_icmp_q_tos reply_un.icmp.reply_icmp_q_tos #define reply_tcp_flags reply_un.tcp.reply_tcp_flags /* * scamper_tracelb_probe_t * * record details of each probe sent, and any replies received. */ struct scamper_tracelb_probe { struct timeval tx; uint16_t flowid; uint8_t ttl; uint8_t attempt; scamper_tracelb_reply_t **rxs; uint16_t rxc; }; /* * scamper_tracelb_probeset_t * * record details of each probe sent in a particular set. */ struct scamper_tracelb_probeset { scamper_tracelb_probe_t **probes; /* array of probes sent */ uint16_t probec; /* number of probes sent */ }; /* * scamper_tracelb_node_t * * record details of each node encountered */ struct scamper_tracelb_node { scamper_addr_t *addr; /* address of the node */ uint8_t flags; /* associated flags */ uint8_t q_ttl; /* quoted ttl */ scamper_tracelb_link_t **links; /* links */ uint16_t linkc; /* number of links */ }; /* * scamper_tracelb_link_t * * record probe details of each link encountered */ struct scamper_tracelb_link { scamper_tracelb_node_t *from; /* link from */ scamper_tracelb_node_t *to; /* link to */ uint8_t hopc; /* distance between the nodes */ scamper_tracelb_probeset_t **sets; /* array of probesets, for each hop */ }; /* * scamper_tracelb_t * * structure containing the results of probing to enumerate all load balanced * paths towards a destination */ typedef struct scamper_tracelb { /* the current list, cycle, and defaults */ scamper_list_t *list; scamper_cycle_t *cycle; uint32_t userid; /* source and destination addresses of the load balancer trace */ scamper_addr_t *src; scamper_addr_t *dst; /* when the load balancer trace commenced */ struct timeval start; /* load balancer traceroute parameters */ uint16_t sport; /* base source port */ uint16_t dport; /* base destination port */ uint16_t probe_size; /* size of probe to send */ uint8_t type; /* probe type to use */ uint8_t firsthop; /* where to start probing */ uint8_t wait_timeout; /* seconds to wait before timeout */ uint8_t wait_probe; /* min. inter-probe time per ttl */ uint8_t attempts; /* number of attempts per probe */ uint8_t confidence; /* confidence level to attain */ uint8_t tos; /* type-of-service byte to use */ uint8_t gaplimit; /* max consecutive unresp. hops */ uint32_t probec_max; /* max number of probes to send */ /* * data collected: * * nodes: * an IP address from each node inferred between the source and the * destination, recorded in the order they were discovered in * * links: * all links between the source and destination, sorted numerically by * from address and then by to address; each link contains the replies * collected for it * * probec: * count of probes sent. includes retries. * * error: * if non-zero, something went wrong. */ scamper_tracelb_node_t **nodes; uint16_t nodec; scamper_tracelb_link_t **links; uint16_t linkc; uint32_t probec; uint8_t error; } scamper_tracelb_t; /* * basic scamper_tracelb_t routines: * * scamper_tracelb_alloc: allocate a scamper_tracelb_t structure * scamper_tracelb_free: free a scamper_tracelb_t and contents * scamper_tracelb_addr: return destination address of the scamper_tracelb_t * scamper_tracelb_type_tostr: return a string specifying the trace type * scamper_tracelb_sort: sort nodes and links in a deterministic manner */ scamper_tracelb_t *scamper_tracelb_alloc(void); void scamper_tracelb_free(scamper_tracelb_t *); scamper_addr_t *scamper_tracelb_addr(const void *); const char *scamper_tracelb_type_tostr(const scamper_tracelb_t *trace); int scamper_tracelb_sort(scamper_tracelb_t *); /* * basic scamper_tracelb_node_t routines: * * scamper_tracelb_node_alloc: allocate a scamper_tracelb_node_t structure * scamper_tracelb_node_free: free a scamper_tracelb_node_t and contents * scamper_tracelb_node_add: add a node to a scamper_tracelb_t structure * scamper_tracelb_node_find: find a node structure by address * scamper_tracelb_node_cmp: comparison function for comparing nodes */ scamper_tracelb_node_t *scamper_tracelb_node_alloc(scamper_addr_t *); void scamper_tracelb_node_free(scamper_tracelb_node_t *); int scamper_tracelb_node_add(scamper_tracelb_t *, scamper_tracelb_node_t *); scamper_tracelb_node_t *scamper_tracelb_node_find(scamper_tracelb_t *, scamper_tracelb_node_t *); int scamper_tracelb_node_cmp(const scamper_tracelb_node_t *, const scamper_tracelb_node_t *); int scamper_tracelb_node_links_alloc(scamper_tracelb_node_t *, uint16_t); void scamper_tracelb_node_links_sort(scamper_tracelb_node_t *); /* * basic scamper_tracelb_reply_t routines: * * scamper_tracelb_reply_alloc: allocate a scamper_tracelb_reply_t structure * scamper_tracelb_reply_free: free a reply structure */ scamper_tracelb_reply_t *scamper_tracelb_reply_alloc(scamper_addr_t *); void scamper_tracelb_reply_free(scamper_tracelb_reply_t *); /* * basic scamper_tracelb_probe_t routines: * */ scamper_tracelb_probe_t *scamper_tracelb_probe_alloc(void); void scamper_tracelb_probe_free(scamper_tracelb_probe_t *); int scamper_tracelb_probe_reply(scamper_tracelb_probe_t *probe, scamper_tracelb_reply_t *reply); int scamper_tracelb_probe_replies_alloc(scamper_tracelb_probe_t *, uint16_t); /* * basic scamper_tracelb_link_t routines: * * scamper_tracelb_link_alloc: allocate a scamper_tracelb_link_t structure * scamper_tracelb_link_free: free a scamper_tracelb_link_t and contents * scamper_tracelb_link_cmp: convenient function to compare links with * scamper_tracelb_link_find: convenient function to find a link in a trace * scamper_tracelb_link_add: add a link to a scamper_tracelb_t structure */ scamper_tracelb_link_t *scamper_tracelb_link_alloc(void); scamper_tracelb_link_t *scamper_tracelb_link_find(const scamper_tracelb_t *, scamper_tracelb_link_t *); void scamper_tracelb_link_free(scamper_tracelb_link_t *); int scamper_tracelb_link_cmp(const scamper_tracelb_link_t *, const scamper_tracelb_link_t *); int scamper_tracelb_link_add(scamper_tracelb_t *, scamper_tracelb_link_t *); int scamper_tracelb_link_zerottlfwd(const scamper_tracelb_link_t *); int scamper_tracelb_link_probeset(scamper_tracelb_link_t *, scamper_tracelb_probeset_t *); int scamper_tracelb_link_probesets_alloc(scamper_tracelb_link_t *, uint8_t); /* * basic scamper_tracelb_probeset_t routines: * */ scamper_tracelb_probeset_t *scamper_tracelb_probeset_alloc(void); void scamper_tracelb_probeset_free(scamper_tracelb_probeset_t *); int scamper_tracelb_probeset_add(scamper_tracelb_probeset_t *, scamper_tracelb_probe_t *); int scamper_tracelb_probeset_probes_alloc(scamper_tracelb_probeset_t *, uint16_t); /* * these functions allocate arrays of appropriate size, all elements * initialised to null. */ int scamper_tracelb_nodes_alloc(scamper_tracelb_t *, uint16_t); int scamper_tracelb_links_alloc(scamper_tracelb_t *, uint16_t); /* * scamper_tracelb_fwdpathc * * this function determines the number of unique forward paths, counted * in IP-links, observed from each node in the trace structure. this * data is useful to then pull out redundant sections in the path. * returns zero on success. */ int scamper_tracelb_fwdpathc(const scamper_tracelb_t *trace, int *fwdpathc); /* * scamper_tracelb_node_convergencepoint * * this function determines the index (if any) into the trace at which * the path converges to a single node. the caller should pass the array * * if the path does not reconverge, -1 is passed back in the to variable. * returns zero on success, or -1 if an error occurs. */ int scamper_tracelb_node_convergencepoint(const scamper_tracelb_t *trace, const int *fwdpathc, int from, int *to); /* * scamper_tracelb_nodes_extract * * this function supplies all nodes between two points in the graph in the * nodes parameter. the caller therefore should pass a nodes array with * enough space to store trace->nodec items. * this function returns the number of nodes extracted, or -1 in an * error. */ int scamper_tracelb_nodes_extract(const scamper_tracelb_t *trace, scamper_tracelb_node_t *from, scamper_tracelb_node_t *to, scamper_tracelb_node_t **nodes); #endif /* __SCAMPER_TRACELB_H */ scamper-cvs-20171204/scamper/tracelb/scamper_tracelb_do.c000644 001751 000000 00000341405 13210743023 023137 0ustar00mjlwheel000000 000000 /* * scamper_do_tracelb.c * * $Id: scamper_tracelb_do.c,v 1.275 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2008-2011 The University of Waikato * Copyright (C) 2012 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * MDA traceroute technique authored by * Ben Augustin, Timur Friedman, Renata Teixeira; "Measuring Load-balanced * Paths in the Internet", in Proc. Internet Measurement Conference 2007. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_tracelb_do.c,v 1.275 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_tracelb.h" #include "scamper_task.h" #include "scamper_icmp_resp.h" #include "scamper_dl.h" #include "scamper_fds.h" #include "scamper_dlhdr.h" #include "scamper_rtsock.h" #include "scamper_probe.h" #include "scamper_getsrc.h" #include "scamper_udp4.h" #include "scamper_udp6.h" #include "scamper_icmp4.h" #include "scamper_icmp6.h" #include "scamper_queue.h" #include "scamper_file.h" #include "scamper_options.h" #include "scamper_debug.h" #include "scamper_tracelb_do.h" #include "utils.h" #include "mjl_list.h" #include "mjl_heap.h" #include "mjl_splaytree.h" #define SCAMPER_DO_TRACELB_ATTEMPTS_MIN 1 #define SCAMPER_DO_TRACELB_ATTEMPTS_DEF 2 #define SCAMPER_DO_TRACELB_ATTEMPTS_MAX 5 #define SCAMPER_DO_TRACELB_PORT_MIN 1 #define SCAMPER_DO_TRACELB_PORT_MAX 65535 #define SCAMPER_DO_TRACELB_DPORT_DEF (32768+666+1) #define SCAMPER_DO_TRACELB_FIRSTHOP_MIN 1 #define SCAMPER_DO_TRACELB_FIRSTHOP_DEF 1 #define SCAMPER_DO_TRACELB_FIRSTHOP_MAX 254 #define SCAMPER_DO_TRACELB_GAPLIMIT_MIN 1 #define SCAMPER_DO_TRACELB_GAPLIMIT_DEF 3 #define SCAMPER_DO_TRACELB_GAPLIMIT_MAX 5 #define SCAMPER_DO_TRACELB_PROBECMAX_MIN 50 #define SCAMPER_DO_TRACELB_PROBECMAX_DEF 3000 #define SCAMPER_DO_TRACELB_PROBECMAX_MAX 65535 #define SCAMPER_DO_TRACELB_TOS_MIN 0 #define SCAMPER_DO_TRACELB_TOS_DEF 0 #define SCAMPER_DO_TRACELB_TOS_MAX 255 #define SCAMPER_DO_TRACELB_WAITPROBE_MIN 15 #define SCAMPER_DO_TRACELB_WAITPROBE_DEF 25 #define SCAMPER_DO_TRACELB_WAITPROBE_MAX 200 #define SCAMPER_DO_TRACELB_WAITTIMEOUT_MIN 1 #define SCAMPER_DO_TRACELB_WAITTIMEOUT_DEF 5 #define SCAMPER_DO_TRACELB_WAITTIMEOUT_MAX 10 static const uint8_t MODE_RTSOCK = 0; /* need to determine outgoing if */ static const uint8_t MODE_DLHDR = 1; /* need to determine datalink hdr */ static const uint8_t MODE_FIRSTADDR = 2; /* probing for the first address */ static const uint8_t MODE_FIRSTHOP = 3; /* probing for the first hop */ static const uint8_t MODE_HOPPROBE = 4; /* probing a hop for lb paths */ static const uint8_t MODE_PERPACKET = 5; /* determine if router lb per pkt */ static const uint8_t MODE_BRINGFWD = 6; /* need more flowids for hop-probe */ static const uint8_t MODE_BRINGFWD0 = 7; /* when first addr branches */ static const uint8_t MODE_CLUMP = 8; /* clump of nodes */ /* forward declare some structs that are used to keep state */ typedef struct tracelb_link tracelb_link_t; typedef struct tracelb_path tracelb_path_t; typedef struct tracelb_probe tracelb_probe_t; /* * tracelb_link * * keep track of links discovered, the probes that discovered them, and * where in the path they are. */ struct tracelb_link { scamper_tracelb_link_t *link; slist_t *flowids; struct tracelb_path *path; }; /* * tracelb_path * * keep track of unique paths to probe and the probes which find them. * */ struct tracelb_path { /* * these fields maintain a graph structure * * the 'back' fields keep track of the paths that lead up to this path. * the 'fwd' fields keep track of the paths that follow on from this path. * the 'link' fields keep track of the links discovered in this path segment. */ tracelb_path_t **back; int backc; tracelb_link_t **links; int linkc; tracelb_path_t **fwd; int fwdc; /* * these fields maintain other useful items of state * * the 'visited' field says whether or not the path has been visited in DFS * the 'distance' field records the maximum distance from the root */ int visited; int distance; }; /* * tracelb_bringfwd * * this structure keeps track at the number of times a particular subpath has * been probed when attempting to bring a particular flowid forward through a * path so it can be used to probe a latter portion of the path. * * when k reaches the corresponding value in the confidence table, the attempt * to bring a flowid forward for the path ceases. */ typedef struct tracelb_bringfwd { tracelb_path_t *path; int k; } tracelb_bringfwd_t; /* * tracelb_flowid * * keep track of the flowid values known to be useful in probing a path. */ typedef struct tracelb_flowid { uint16_t id; uint8_t ttl; } tracelb_flowid_t; typedef struct tracelb_newnode { scamper_tracelb_node_t *node; scamper_tracelb_probe_t *probe; } tracelb_newnode_t; /* * tracelb_branch * * state to keep while probing a branch in the path. */ typedef struct tracelb_branch { tracelb_path_t *path; /* path being probed forward */ struct timeval last_tx; /* time last probe sent */ struct timeval next_tx; /* when to next probe */ uint8_t mode; /* mode this branch is in */ int k; /* # of probes replied to */ int l; /* # of lost probes */ int n; /* # of loadbal paths to rule out */ tracelb_bringfwd_t **bringfwd; /* paths leading to this path */ int bringfwdc; /* # of paths in subset */ int bringfwd0; /* number of probes in this state */ heap_node_t *heapnode; /* corresponding node in heap */ tracelb_newnode_t **newnodes; int newnodec; tracelb_probe_t **probes; int probec; } tracelb_branch_t; /* * tracelb_probe * * keep track of probes and the paths they probe. the tracelb_state structure * holds an array of these probe structures indexed by probe id. */ struct tracelb_probe { tracelb_link_t *link; /* the link found one ttl earlier */ tracelb_branch_t *branch; /* which branch is being probed */ scamper_tracelb_probe_t *probe; /* probe record to be held as data */ uint16_t id; /* id of the probe */ uint8_t mode; /* mode the probe was sent in */ }; /* * tracelb_state * * this keeps state for the load-balancer traceroute process. */ typedef struct tracelb_state { uint8_t confidence; /* index into k[] */ scamper_fd_t *icmp; /* fd to listen to icmp packets */ scamper_fd_t *probe; /* fd to probe with */ scamper_fd_t *dl; /* datalink fd to tx on */ splaytree_t *addrs; /* set of addresses */ #ifndef _WIN32 scamper_fd_t *rtsock; /* route socket */ #endif scamper_route_t *route; scamper_dlhdr_t *dlhdr; /* datalink header to prepend on tx */ struct timeval next_tx; /* time to send the next probe */ uint16_t payload_size; /* size of the probe packet payload */ tracelb_probe_t **probes; /* probes sent so far */ uint16_t id_next; /* next id to use in a probe */ uint16_t flowid_next; /* next flow-id to use in a probe */ heap_t *active; /* heap of active branches */ heap_t *waiting; /* heap of queued branches */ tracelb_link_t **links; /* links established */ int linkc; /* count of links */ tracelb_path_t **paths; /* paths established */ int pathc; /* count of paths */ } tracelb_state_t; /* temporary buffer shared amongst traceroutes */ static uint8_t *pktbuf = NULL; static size_t pktbuf_len = 0; /* the callback functions registered with the tracelb task */ static scamper_task_funcs_t funcs; #define TRACE_OPT_CONFIDENCE 1 #define TRACE_OPT_DPORT 2 #define TRACE_OPT_FIRSTHOP 3 #define TRACE_OPT_GAPLIMIT 4 #define TRACE_OPT_PROTOCOL 5 #define TRACE_OPT_ATTEMPTS 6 #define TRACE_OPT_PROBECMAX 7 #define TRACE_OPT_SPORT 8 #define TRACE_OPT_TOS 9 #define TRACE_OPT_USERID 10 #define TRACE_OPT_WAITTIMEOUT 11 #define TRACE_OPT_WAITPROBE 12 static const scamper_option_in_t opts[] = { {'c', NULL, TRACE_OPT_CONFIDENCE, SCAMPER_OPTION_TYPE_NUM}, {'d', NULL, TRACE_OPT_DPORT, SCAMPER_OPTION_TYPE_NUM}, {'f', NULL, TRACE_OPT_FIRSTHOP, SCAMPER_OPTION_TYPE_NUM}, {'g', NULL, TRACE_OPT_GAPLIMIT, SCAMPER_OPTION_TYPE_NUM}, {'P', NULL, TRACE_OPT_PROTOCOL, SCAMPER_OPTION_TYPE_STR}, {'q', NULL, TRACE_OPT_ATTEMPTS, SCAMPER_OPTION_TYPE_NUM}, {'Q', NULL, TRACE_OPT_PROBECMAX, SCAMPER_OPTION_TYPE_NUM}, {'s', NULL, TRACE_OPT_SPORT, SCAMPER_OPTION_TYPE_NUM}, {'t', NULL, TRACE_OPT_TOS, SCAMPER_OPTION_TYPE_NUM}, {'U', NULL, TRACE_OPT_USERID, SCAMPER_OPTION_TYPE_NUM}, {'w', NULL, TRACE_OPT_WAITTIMEOUT, SCAMPER_OPTION_TYPE_NUM}, {'W', NULL, TRACE_OPT_WAITPROBE, SCAMPER_OPTION_TYPE_NUM}, }; static const int opts_cnt = SCAMPER_OPTION_COUNT(opts); const char *scamper_do_tracelb_usage(void) { return "tracelb [-c confidence] [-d dport] [-f firsthop] [-g gaplimit]\n" " [-P method] [-q attempts] [-Q maxprobec] [-s sport]\n" " [-t tos] [-U userid] [-w wait-timeout] [-W wait-probe]"; } static tracelb_state_t *tracelb_getstate(const scamper_task_t *task) { return scamper_task_getstate(task); } static scamper_tracelb_t *tracelb_getdata(const scamper_task_t *task) { return scamper_task_getdata(task); } static int k(tracelb_state_t *state, int n) { /* * number of probes (k) to send to rule out a load-balancer having n hops; * 95% confidence level first from 823-augustin-e2emon.pdf, then extended * with gmp-based code. * 99% confidence derived with gmp-based code. */ static const int k[][2] = { { 0, 0 }, { 0, 0 }, { 6, 8 }, { 11, 15 }, { 16, 21 }, { 21, 28 }, { 27, 36 }, { 33, 43 }, { 38, 51 }, { 44, 58 }, { 51, 66 }, { 57, 74 }, { 63, 82 }, { 70, 90 }, { 76, 98 }, { 83, 106 }, { 90, 115 }, { 96, 123 }, { 103, 132 }, { 110, 140 }, { 117, 149 }, { 124, 157 }, { 131, 166 }, { 138, 175 }, { 145, 183 }, { 152, 192 }, { 159, 201 }, { 167, 210 }, { 174, 219 }, { 181, 228 }, { 189, 237 }, { 196, 246 }, { 203, 255 }, { 211, 264 }, { 218, 273 }, { 226, 282 }, { 233, 291 }, { 241, 300 }, { 248, 309 }, { 256, 319 }, { 264, 328 }, { 271, 337 }, { 279, 347 }, { 287, 356 }, { 294, 365 }, { 302, 375 }, { 310, 384 }, { 318, 393 }, { 326, 403 }, { 333, 412 }, { 341, 422 }, { 349, 431 }, { 357, 441 }, { 365, 450 }, { 373, 460 }, { 381, 470 }, { 389, 479 }, { 397, 489 }, { 405, 499 }, { 413, 508 }, { 421, 518 }, { 429, 528 }, { 437, 537 }, { 445, 547 }, { 453, 557 }, { 462, 566 }, { 470, 576 }, { 478, 586 }, { 486, 596 }, { 494, 606 }, { 502, 616 }, { 511, 625 }, { 519, 635 }, { 527, 645 }, { 535, 655 }, { 544, 665 }, { 552, 675 }, { 560, 685 }, { 569, 695 }, { 577, 705 }, { 585, 715 }, { 594, 725 }, { 602, 735 }, { 610, 745 }, { 619, 755 }, { 627, 765 }, { 635, 775 }, { 644, 785 }, { 652, 795 }, { 661, 805 }, { 669, 815 }, { 678, 825 }, { 686, 835 }, { 695, 845 }, { 703, 855 }, { 712, 866 }, { 720, 876 }, { 729, 886 }, { 737, 896 }, { 746, 906 }, }; #define TRACELB_CONFIDENCE_MAX_N 99 #define TRACELB_CONFIDENCE_NLIMIT(v) \ ((v) <= TRACELB_CONFIDENCE_MAX_N ? (v) : TRACELB_CONFIDENCE_MAX_N) assert(state->confidence < 2); assert(n >= 2); assert(n <= TRACELB_CONFIDENCE_MAX_N); return k[n][state->confidence]; } static void tracelb_handleerror(scamper_task_t *task, int err) { scamper_tracelb_t *trace = tracelb_getdata(task); trace->error = err; scamper_debug(__func__, "%d", err); scamper_task_queue_done(task, 0); return; } #ifdef NDEBUG #define tracelb_paths_assert(state) ((void)0) #define tracelb_paths_dump(state) ((void)0) #define tracelb_links_dump(state) ((void)0) #endif #ifndef NDEBUG static int tracelb_paths_loop_fwd(tracelb_path_t *path, tracelb_path_t *node) { int i; for(i=0; ifwdc; i++) { if(path->fwd[i] == node) return 1; if(tracelb_paths_loop_fwd(path->fwd[i], node) != 0) return 1; } return 0; } static int tracelb_paths_loop_back(tracelb_path_t *path, tracelb_path_t *node) { int i; for(i=0; ibackc; i++) { if(path->back[i] == node) return 1; if(tracelb_paths_loop_back(path->back[i], node) != 0) return 1; } return 0; } static void tracelb_paths_assert(tracelb_state_t *state) { tracelb_path_t *path; int i, j, d, p; for(p=0; ppathc; p++) { path = state->paths[p]; assert(path->linkc >= 0); if(path->linkc == 0) assert(path->links == NULL); else assert(path->links != NULL); assert(path->fwdc >= 0); if(path->fwdc == 0) assert(path->fwd == NULL); else assert(path->fwd != NULL); assert(path->backc >= 0); if(path->backc == 0) assert(path->back == NULL); else assert(path->back != NULL); if(path->linkc == 0 && path->backc > 0) { for(i=0; ibackc; i++) assert(path->back[i]->linkc > 0); } for(i=0; ilinkc; i++) { assert(path->links[i]->path == path); assert(path->links[i]->link != NULL); assert(path->links[i]->link->from != NULL); if(i+1 != path->linkc || path->fwdc > 0) assert(path->links[i]->link->to != NULL); } d = 0; for(i=0; ibackc; i++) { assert(path->back[i]->fwdc > 0); if(path->back[i]->distance > d) d = path->back[i]->distance; for(j=0; jback[i]->fwdc; j++) { assert(path->distance > path->back[i]->distance); if(path->back[i]->fwd[j] == path) break; } assert(j != path->back[i]->fwdc); } if(path->backc > 0) assert(d + 1 == path->distance); for(i=0; ifwdc; i++) { assert(path->fwd[i]->backc > 0); for(j=0; jfwd[i]->backc; j++) { if(path->fwd[i]->back[j] == path) break; } assert(j != path->fwd[i]->backc); } assert(tracelb_paths_loop_fwd(path, path) == 0); assert(tracelb_paths_loop_back(path, path) == 0); } return; } static void tracelb_paths_dump(tracelb_state_t *state) { tracelb_path_t *path; tracelb_link_t *link; char buf[4096], addr[64]; size_t off; int i, c, p; for(p=0; ppathc; p++) { path = state->paths[p]; off = 0; string_concat(buf, sizeof(buf), &off, "%p: %d %d %d %d", path, path->distance, path->backc, path->linkc, path->fwdc); if(path->linkc > 0) { if(path->links[0]->link->from->addr != NULL) { scamper_addr_tostr(path->links[0]->link->from->addr, addr, sizeof(addr)); string_concat(buf, sizeof(buf), &off, " %s", addr); } else { string_concat(buf, sizeof(buf), &off, " +"); } for(i=0; ilinkc; i++) { link = path->links[i]; if(link->link->to == NULL) { for(c=0; clink->hopc; c++) string_concat(buf, sizeof(buf), &off, " +"); } else { for(c=1; clink->hopc; c++) string_concat(buf, sizeof(buf), &off, " +"); scamper_addr_tostr(link->link->to->addr, addr, sizeof(addr)); string_concat(buf, sizeof(buf), &off, " %s", addr); } if(link->flowids != NULL && (c=slist_count(link->flowids)) != 0) string_concat(buf, sizeof(buf), &off, " (%d)", c); } } for(i=0; ifwdc; i++) string_concat(buf, sizeof(buf), &off, " %p", path->fwd[i]); scamper_debug(__func__, "%s", buf); } return; } static void tracelb_links_dump(tracelb_state_t *state) { scamper_tracelb_link_t *link; scamper_tracelb_node_t *node; tracelb_link_t *tlbl; char buf[256], addr[64]; size_t off; int i, j; for(i=0; ilinkc; i++) { tlbl = state->links[i]; link = tlbl->link; off = 0; node = link->from; if(node->addr != NULL) { scamper_addr_tostr(node->addr, addr, sizeof(addr)); string_concat(buf, sizeof(buf), &off, "%s", addr); if(SCAMPER_TRACELB_NODE_QTTL(node)) string_concat(buf, sizeof(buf), &off, ",%d", node->q_ttl); } else string_concat(buf, sizeof(buf), &off, "*"); for(j=1; jhopc; j++) string_concat(buf, sizeof(buf), &off, " +"); if(link->to == NULL) { string_concat(buf, sizeof(buf), &off, " *"); } else { node = link->to; scamper_addr_tostr(node->addr, addr, sizeof(addr)); string_concat(buf, sizeof(buf), &off, " %s", addr); if(SCAMPER_TRACELB_NODE_QTTL(node)) string_concat(buf, sizeof(buf), &off, ",%d", node->q_ttl); } scamper_debug(__func__, "%s", buf); } return; } #endif /* * tracelb_isloop_addr * * small utility function to determine if a loop exists. * called by tracelb_isloop. * this function does not have to do the zero-ttl check that trace_isloop * does and so should be faster. */ static tracelb_link_t *tracelb_isloop_addr(const tracelb_path_t *path, const scamper_addr_t *addr) { scamper_tracelb_probeset_t *set; scamper_tracelb_probe_t *probe; scamper_tracelb_link_t *link; tracelb_link_t *tlbl; int i, j; uint16_t k, l; for(i=path->linkc-1; i>=0; i--) { /* a tracelb_link_t state is required at each spot in the array */ tlbl = path->links[i]; assert(tlbl != NULL); /* but there does not have to be an actual link with the state */ if((link = tlbl->link) == NULL) continue; if(link->from->addr == NULL) continue; /* if the from address is the same, then we have a loop */ if(scamper_addr_cmp(link->from->addr, addr) == 0) return tlbl; /* if the link includes a clump, then check the replies in the clump */ for(j=0; jhopc-1; j++) { set = link->sets[j]; for(k=0; kprobec; k++) { probe = set->probes[k]; for(l=0; lrxc; l++) if(scamper_addr_cmp(probe->rxs[l]->reply_from, addr) == 0) return tlbl; } } } for(i=0; ibackc; i++) { if((tlbl = tracelb_isloop_addr(path->back[i], addr)) != NULL) { return tlbl; } } return NULL; } /* * tracelb_isloop * * check to see if the link that has just been added to the path has an * inferred loop. */ static tracelb_link_t *tracelb_isloop(const tracelb_path_t *path) { /* * the link has been added to this path before calling, so there should * be at least one link here */ assert(path->linkc > 0); /* * if the link is a case of zero-ttl forwarding, then there is no loop * at this link, or in any prior part, as the link->from address has * already been tested for a loop. */ if(scamper_tracelb_link_zerottlfwd(path->links[path->linkc-1]->link) != 0) { return 0; } return tracelb_isloop_addr(path, path->links[path->linkc-1]->link->to->addr); } /* * tracelb_link_continue * * iterate through the replies for the link. if any of the replies indicates * that the router won't forward packets any further, tell the caller not * to continue probing the path. */ static int tracelb_link_continue(const scamper_tracelb_t *trace, const tracelb_path_t *path, const scamper_tracelb_link_t *link) { scamper_tracelb_probeset_t *set; scamper_tracelb_probe_t *probe; scamper_tracelb_reply_t *reply; uint16_t i, j; /* don't continue probing if the destination address has been reached */ if(link->to != NULL && scamper_addr_cmp(trace->dst, link->to->addr) == 0) { scamper_debug(__func__, "reached destination"); return 0; } /* if any of the replies are not time exceeded, don't continue probing */ set = link->sets[link->hopc-1]; for(i=0; iprobec; i++) { probe = set->probes[i]; for(j=0; jrxc; j++) { reply = probe->rxs[j]; if(SCAMPER_TRACELB_REPLY_IS_ICMP_TTL_EXP(reply) == 0) { scamper_debug(__func__, "%d/%d not time exceeded", i, j); return 0; } } } /* if a loop is encountered, then don't continue probing */ if(tracelb_isloop(path) != NULL) { scamper_debug(__func__, "loop encountered"); return 0; } return 1; } /* * tracelb_addr * * keep a per-tracelb cache of addresses to avoid unnecessary malloc * of addresses. */ static scamper_addr_t *tracelb_addr(tracelb_state_t *state,int type,void *addr) { scamper_addr_t *a, fm; fm.type = type; fm.addr = addr; if((a = splaytree_find(state->addrs, &fm)) != NULL) return a; if((a = scamper_addr_alloc(type, addr)) == NULL) { printerror(__func__, "could not alloc addr"); return NULL; } if(splaytree_insert(state->addrs, a) == NULL) { printerror(__func__, "could not insert addr"); scamper_addr_free(a); return NULL; } return a; } /* * tracelb_set_visited0 * * set the visited field of all tracelb_path_t structures to zero */ static void tracelb_set_visited0(tracelb_state_t *state) { int i; for(i=0; ipathc; i++) state->paths[i]->visited = 0; return; } static void tracelb_bringfwd_free(tracelb_branch_t *br) { int i; if(br->bringfwd != NULL) { for(i=0; ibringfwdc; i++) if(br->bringfwd[i] != NULL) free(br->bringfwd[i]); free(br->bringfwd); br->bringfwd = NULL; } br->bringfwdc = 0; return; } static int tracelb_bringfwd_add(tracelb_branch_t *br, tracelb_path_t *path) { tracelb_bringfwd_t *bf; if((bf = malloc_zero(sizeof(tracelb_bringfwd_t))) == NULL) { printerror(__func__, "could not malloc"); return -1; } bf->path = path; br->bringfwd[br->bringfwdc++] = bf; return 0; } /* * tracelb_bringfwd_dft * * depth-first traversal of the paths leading to the specified path, for the * purposes of bring a flowid forward through the path to path[0]. */ static int tracelb_bringfwd_dft(tracelb_branch_t *branch, tracelb_path_t *path) { int i, x, rc = 0; assert(path != NULL); if(path->visited != 0) return 1; if(path->backc == 0) { if(tracelb_bringfwd_add(branch, path) != 0) return -1; path->visited = 1; return 1; } for(i=0; ibackc; i++) { if((x = tracelb_bringfwd_dft(branch, path->back[i])) == 1) rc = 1; else if(x == -1) return -1; } if(rc != 0) { if(tracelb_bringfwd_add(branch, path) != 0) return -1; path->visited = 1; } return rc; } /* * tracelb_bringfwd_set * * */ static int tracelb_bringfwd_set(tracelb_state_t *state, tracelb_branch_t *br, tracelb_link_t *tlbl, int set) { tracelb_path_t *path; int i, n; for(i=0; ibringfwdc; i++) { path = br->bringfwd[i]->path; if(path == tlbl->path) { assert(path->links[path->linkc-1] == tlbl); n = TRACELB_CONFIDENCE_NLIMIT(path->fwdc+2); if(set != 0) { br->bringfwd[i]->k++; if(br->bringfwd[i]->k >= k(state, n)) { return 1; } } else br->bringfwd[i]->k = 0; scamper_debug(__func__, "set %d i %d k %d < %d", set, i, br->bringfwd[i]->k, k(state, n)); break; } } assert(i != br->bringfwdc); return 0; } static int tracelb_flowids_list_add(slist_t *list, tracelb_probe_t *pr) { tracelb_flowid_t *tf; assert(pr->mode != MODE_PERPACKET); assert(pr->mode != MODE_BRINGFWD0); assert(pr->mode != MODE_BRINGFWD); if((tf = malloc_zero(sizeof(tracelb_flowid_t))) == NULL) { printerror(__func__, "could not malloc flowid"); return -1; } tf->id = pr->probe->flowid; tf->ttl = pr->probe->ttl; if(slist_tail_push(list, tf) == NULL) { free(tf); printerror(__func__, "could not slist_tail_push"); return -1; } return 0; } /* * tracelb_link_flowid_get * * return a flowid from the link, if there is one. when returning the last * flowid free the list structure. */ static tracelb_flowid_t *tracelb_link_flowid_get(tracelb_link_t *link) { tracelb_flowid_t *tf; if(link->flowids == NULL) return NULL; tf = slist_head_pop(link->flowids); if(slist_count(link->flowids) == 0) { slist_free(link->flowids); link->flowids = NULL; } return tf; } /* * tracelb_link_cmp * * useful for providing as a sort callback method for qsort on state->links */ static int tracelb_link_cmp(const tracelb_link_t *a, const tracelb_link_t *b) { assert(a != NULL); assert(a->link != NULL); assert(b != NULL); assert(b->link != NULL); return scamper_tracelb_link_cmp(a->link, b->link); } /* * tracelb_cmp_node2reply * * determine if a reply could be matched against a node. */ static int tracelb_cmp_node2reply(const scamper_tracelb_node_t *node, const scamper_tracelb_reply_t *reply) { scamper_tracelb_node_t cmp; memset(&cmp, 0, sizeof(cmp)); cmp.addr = reply->reply_from; if(SCAMPER_TRACELB_REPLY_IS_ICMP_TTL_EXP(reply) || SCAMPER_TRACELB_REPLY_IS_ICMP_UNREACH(reply)) { cmp.q_ttl = reply->reply_icmp_q_ttl; cmp.flags |= SCAMPER_TRACELB_NODE_FLAG_QTTL; } return scamper_tracelb_node_cmp(node, &cmp); } static int tracelb_newnode_cmp(const tracelb_newnode_t *a, const tracelb_newnode_t *b) { return scamper_tracelb_node_cmp(a->node, b->node); } static tracelb_newnode_t *tracelb_newnode_find(tracelb_branch_t *br, scamper_tracelb_reply_t *reply) { tracelb_newnode_t findme; scamper_tracelb_node_t node; memset(&node, 0, sizeof(node)); findme.node = &node; if(SCAMPER_TRACELB_REPLY_IS_ICMP_TTL_EXP(reply) || SCAMPER_TRACELB_REPLY_IS_ICMP_UNREACH(reply)) { node.q_ttl = reply->reply_icmp_q_ttl; node.flags |= SCAMPER_TRACELB_NODE_FLAG_QTTL; } node.addr = reply->reply_from; return array_find((void **)br->newnodes, br->newnodec, &findme, (array_cmp_t)tracelb_newnode_cmp); } static int tracelb_newnode_add(tracelb_branch_t *br, scamper_tracelb_probe_t *probe) { scamper_tracelb_reply_t *reply; tracelb_newnode_t *newnode; assert(probe->rxc == 1); if((newnode = malloc_zero(sizeof(tracelb_newnode_t))) == NULL) { printerror(__func__, "could not alloc newnode"); goto err; } newnode->probe = probe; reply = probe->rxs[0]; if((newnode->node = scamper_tracelb_node_alloc(reply->reply_from)) == NULL) { printerror(__func__, "could not alloc node"); goto err; } if(SCAMPER_TRACELB_REPLY_IS_ICMP_TTL_EXP(reply) || SCAMPER_TRACELB_REPLY_IS_ICMP_UNREACH(reply)) { newnode->node->q_ttl = reply->reply_icmp_q_ttl; newnode->node->flags |= SCAMPER_TRACELB_NODE_FLAG_QTTL; } if(array_insert((void ***)&br->newnodes, &br->newnodec, newnode, (array_cmp_t)tracelb_newnode_cmp) != 0) { printerror(__func__, "could not add node to branch"); goto err; } return 0; err: if(newnode != NULL) { if(newnode->node != NULL) scamper_tracelb_node_free(newnode->node); free(newnode); } return -1; } /* * tracelb_link_alloc * * simple function to allocate a new link. */ static tracelb_link_t *tracelb_link_alloc(tracelb_state_t *state, scamper_tracelb_link_t *link, tracelb_path_t *path) { tracelb_link_t *tlbl; if((tlbl = malloc_zero(sizeof(tracelb_link_t))) == NULL) { printerror(__func__, "could not alloc tlbl"); return NULL; } tlbl->link = link; tlbl->path = path; if(array_insert((void ***)&state->links, &state->linkc, tlbl, (array_cmp_t)tracelb_link_cmp) != 0) { printerror(__func__, "could not insert tlbl"); free(tlbl); return NULL;; } return tlbl; } static tracelb_link_t *tracelb_link_find(tracelb_state_t *state, scamper_tracelb_link_t *link) { tracelb_link_t findme; findme.link = link; return (tracelb_link_t *)array_find((void **)state->links, state->linkc, &findme, (array_cmp_t)tracelb_link_cmp); } /* * tracelb_link_free * * free up a tracelb_link structure. */ static void tracelb_link_free(tracelb_link_t *link) { tracelb_flowid_t *tf; while((tf = tracelb_link_flowid_get(link)) != NULL) { free(tf); } free(link); return; } /* * tracelb_link_flowid_add_tail * * record probe flowid/ttl details of a reply with a link */ static int tracelb_link_flowid_add_tail(tracelb_link_t *link, scamper_tracelb_probe_t *probe) { tracelb_flowid_t *tf; /* allocate a list structure, if necessary, to store the flowids */ if(link->flowids == NULL && (link->flowids = slist_alloc()) == NULL) { printerror(__func__, "could not alloc flowids list"); return -1; } if((tf = malloc_zero(sizeof(tracelb_flowid_t))) == NULL) { printerror(__func__, "could not malloc flowid"); return -1; } tf->id = probe->flowid; tf->ttl = probe->ttl; if(slist_tail_push(link->flowids, tf) == NULL) { free(tf); printerror(__func__, "could not slist_tail_push"); return -1; } return 0; } static void tracelb_link_flowids_inc(tracelb_link_t *tlbl) { tracelb_flowid_t *tf; slist_node_t *node; if(tlbl->flowids == NULL) return; node = slist_head_node(tlbl->flowids); while(node != NULL) { tf = slist_node_item(node); tf->ttl++; node = slist_node_next(node); } return; } /* * tracelb_link_flowids_add_list * */ static void tracelb_link_flowids_add_list(tracelb_link_t *tlbl, slist_t *list) { /* allocate a list structure, if necessary, to store the flowids */ if(tlbl->flowids == NULL) { tlbl->flowids = list; } else { slist_concat(list, tlbl->flowids); slist_free(tlbl->flowids); tlbl->flowids = list; } return; } /* * tracelb_probe_add * * simple function to add a probe to the array of probes sent */ static int tracelb_probe_add(tracelb_state_t *state, tracelb_branch_t *br, tracelb_probe_t *pr) { size_t len = sizeof(tracelb_probe_t *) * (state->id_next + 1); if(realloc_wrap((void **)&state->probes, len) != 0) { printerror(__func__, "could not realloc %d bytes", len); return -1; } pr->id = state->id_next; state->probes[state->id_next] = pr; state->id_next++; if(array_insert((void ***)&br->probes, &br->probec, pr, NULL) != 0) { printerror(__func__, "could not add probe to branch"); return -1; } pr->branch = br; return 0; } /* * tracelb_path_length * * return the length of the shortest sequence of path lengths back to the head */ static uint8_t tracelb_path_length(const tracelb_path_t *path) { const tracelb_path_t *shortest; uint8_t len = path->linkc; int i; while(path->backc > 0) { shortest = path->back[0]; for(i=1; ibackc; i++) { if(shortest->linkc > path->back[i]->linkc) shortest = path->back[i]; } len += shortest->linkc; path = shortest; } return len; } /* * tracelb_path_add_link * * simple function to add a link to an existing path */ static int tracelb_path_add_link(tracelb_path_t *path, tracelb_link_t *link) { if(array_insert((void ***)&path->links, &path->linkc, link, NULL) != 0) { printerror(__func__, "could not add link"); return -1; } return 0; } /* * tracelb_path_add_fwd * * simple function to add a forward path to another path. */ static int tracelb_path_add_fwd(tracelb_path_t *path, tracelb_path_t *fwd) { if(array_insert((void ***)&path->fwd, &path->fwdc, fwd, NULL) != 0) { printerror(__func__, "could not add fwd"); return -1; } return 0; } /* * tracelb_path_add_back * * simple function to add a back path to another path. */ static int tracelb_path_add_back(tracelb_path_t *path, tracelb_path_t *back) { if(array_insert((void ***)&path->back, &path->backc, back, NULL) != 0) { printerror(__func__, "could not add back"); return -1; } return tracelb_path_add_fwd(back, path); } static void tracelb_path_free(tracelb_path_t *path) { if(path == NULL) return; if(path->back != NULL) free(path->back); if(path->fwd != NULL) free(path->fwd); if(path->links != NULL) free(path->links); free(path); return; } /* * tracelb_path_alloc * * allocate a new path structure; advise how many backc/linkc entries * to pre-allocate, if any. */ static tracelb_path_t *tracelb_path_alloc(tracelb_state_t *state, int linkc) { tracelb_path_t *path; size_t len; assert(linkc >= 0); if((path = malloc_zero(sizeof(tracelb_path_t))) == NULL) { printerror(__func__, "could not malloc path"); goto err; } len = sizeof(scamper_tracelb_link_t *) * linkc; if(linkc != 0 && (path->links = malloc_zero(len)) == NULL) { printerror(__func__, "could not malloc path->links"); goto err; } if(array_insert((void ***)&state->paths, &state->pathc, path, NULL) != 0) { printerror(__func__, "could not insert path"); goto err; } return path; err: tracelb_path_free(path); return NULL; } /* * tracelb_bringfwd_cmp * * callback sort function used to sort the paths by distance (in branches) * from the top of the tree. */ static int tracelb_bringfwd_cmp(const tracelb_bringfwd_t *a, const tracelb_bringfwd_t *b) { if(a->path->distance < b->path->distance) return 1; if(a->path->distance > b->path->distance) return -1; return 0; } /* * tracelb_branch_active_cmp * * this function is used to sort the state->active heap so that the branch * due to be probed next is at the top of the heap. */ static int tracelb_branch_active_cmp(const tracelb_branch_t *a, const tracelb_branch_t *b) { return timeval_cmp(&b->next_tx, &a->next_tx); } static int tracelb_branch_active(tracelb_state_t *state, tracelb_branch_t *br) { assert(heap_count(state->active) == 0); assert(br->probec > 0 || br->mode == MODE_RTSOCK || br->mode == MODE_DLHDR); if((br->heapnode = heap_insert(state->active, br)) != NULL) { return 0; } printerror(__func__, "could not insert branch on active"); return -1; } /* * tracelb_branch_waiting_cmp * * this function is used to sort the state->branch heap so that next the * branch introduced to active probing is the one closest to the root, in * ttl terms. */ static int tracelb_branch_waiting_cmp(const tracelb_branch_t *a, const tracelb_branch_t *b) { return tracelb_path_length(b->path) - tracelb_path_length(a->path); } static int tracelb_branch_waiting(tracelb_state_t *state, tracelb_branch_t *br) { if((br->heapnode = heap_insert(state->waiting, br)) != NULL) { return 0; } printerror(__func__, "could not insert branch on waiting"); return -1; } /* * tracelb_branch_reset * * reset probing state on the branch, but do not reset the links/nodes * inferred so far. this allows us to determine per-packet load balancing * details for a set of */ static void tracelb_branch_reset(tracelb_branch_t *branch) { int i; branch->l = 0; branch->k = 0; branch->n = 2; if(branch->mode != MODE_PERPACKET) { /* don't want the probes */ if(branch->probes != NULL) { for(i=0; iprobec; i++) branch->probes[i]->branch = NULL; free(branch->probes); branch->probes = NULL; } branch->probec = 0; } /* won't need any state associated with bringing probes forward */ tracelb_bringfwd_free(branch); return; } static void tracelb_branch_free(tracelb_state_t *state, tracelb_branch_t *br) { int i; if(br->probes != NULL) { for(i=0; iprobec; i++) br->probes[i]->branch = NULL; free(br->probes); } tracelb_bringfwd_free(br); if(br->newnodes != NULL) free(br->newnodes); free(br); return; } /* * tracelb_path_add * * add a path to the heap of currently traced paths. */ static int tracelb_path_add(tracelb_state_t *state, tracelb_path_t *path) { tracelb_branch_t *branch = NULL; if((branch = malloc_zero(sizeof(tracelb_branch_t))) == NULL) { printerror(__func__, "could not alloc branch"); goto err; } branch->mode = MODE_HOPPROBE; branch->path = path; tracelb_branch_reset(branch); if(tracelb_branch_waiting(state, branch) != 0) goto err; return 0; err: if(branch != NULL) tracelb_branch_free(state, branch); return -1; } /* * tracelb_path_distance_1 * * recursive function to add a particular value to the distance field of * all paths ahead of a particular path. */ static void tracelb_path_distance_1(tracelb_path_t *path, int distance) { int i; scamper_debug(__func__, "path %p,%d %d->%d", path, path->visited, path->distance, distance); path->visited++; if(path->distance >= distance) return; path->distance = distance; for(i=0; ifwdc; i++) { assert(path != path->fwd[i]); tracelb_path_distance_1(path->fwd[i], distance+1); } return; } static int tracelb_path_cmp(const tracelb_path_t *a, const tracelb_path_t *b) { if(a->distance < b->distance) return -1; if(a->distance > b->distance) return 1; return 0; } static void tracelb_paths_sort(tracelb_state_t *state) { array_qsort((void **)state->paths, state->pathc, (array_cmp_t)tracelb_path_cmp); return; } /* * tracelb_path_distance * * function to add a particular value to the distance field of all paths * ahead of a particular path. uses the tracelb_path_distance_1 function * above, but first sets all of the visited values to zero so loops can * be detected when built with debugging. */ static void tracelb_path_distance(tracelb_state_t *state, tracelb_path_t *path, int distance) { tracelb_set_visited0(state); tracelb_path_distance_1(path, distance); heap_remake(state->waiting); tracelb_paths_sort(state); return; } /* * tracelb_paths_splice * * `path0' shares a link or node in common with `path'. take path, split * it into two parts. */ static int tracelb_paths_splice(tracelb_state_t *state, tracelb_path_t *path0, tracelb_path_t *path, int linkc) { tracelb_path_t *newp; int i, j, d; /* * allocate a new path. the new path will have the first half of `path' * by the end of this routine */ if((newp = tracelb_path_alloc(state, linkc)) == NULL) { return -1; } /* the new path inherits the back paths from the existing `path' */ newp->back = path->back; newp->backc = path->backc; path->back = NULL; path->backc = 0; for(i=0; ibackc; i++) { for(j=0; jback[i]->fwdc; j++) { if(newp->back[i]->fwd[j] == path) newp->back[i]->fwd[j] = newp; } } /* the new path inherits the first portion of the links in the old path */ for(newp->linkc=0; newp->linkc < linkc; newp->linkc++) { newp->links[newp->linkc] = path->links[newp->linkc]; newp->links[newp->linkc]->path = newp; } /* shift the links in the second portion into place */ if(path->linkc - linkc > 0) { for(i=0; ilinkc-linkc; i++) { path->links[i] = path->links[linkc+i]; } path->linkc = path->linkc - linkc; } else { assert(path->linkc - linkc == 0); free(path->links); path->links = NULL; path->linkc = 0; } /* the path now has two back pointers; add them */ if(tracelb_path_add_back(path, newp) != 0 || tracelb_path_add_back(path, path0) != 0) { return -1; } /* make sure the measure of distance for path segments are correct */ newp->distance = path->distance; if(path0->distance > path->distance) d = path0->distance + 1; else d = path->distance + 1; tracelb_path_distance(state, path, d); return 0; } /* * tracelb_paths_splice_bynode * * */ static int tracelb_paths_splice_bynode(tracelb_state_t *state, tracelb_path_t *path0) { scamper_tracelb_link_t *link; tracelb_path_t *path; tracelb_link_t *tlbl; int i, j; tracelb_paths_assert(state); /* * find a link where this node is found. * this is done before the link below is added, since we don't want to * find the new link we are adding, nor do we want the index value to be * changed by a new link being added (and sorted) into the array. */ tlbl = path0->links[path0->linkc-1]; link = tlbl->link; for(i=0; ilinkc; i++) { if(state->links[i] != tlbl && state->links[i]->link->to != NULL && scamper_tracelb_node_cmp(state->links[i]->link->to, link->to) == 0) { break; } } assert(i != state->linkc); /* find where abouts in the path segment the node is found */ tlbl = state->links[i]; path = tlbl->path; for(i=0; ilinkc; i++) { if(path->links[i] == tlbl) break; } assert(i != path->linkc); if(i+1 == path->linkc && path->fwdc != 0) { for(j=0; jfwdc; j++) { tracelb_path_add_back(path->fwd[j], path0); tracelb_path_distance(state, path->fwd[j], path0->distance + 1); } } else { tracelb_paths_splice(state, path0, path, i+1); } tracelb_paths_assert(state); return 0; } /* * tracelb_queue * * the task is ready to be probed again. put it in a queue to wait a little * longer, or put it into the queue to be probed asap. */ static void tracelb_queue(scamper_task_t *task) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_branch_t *branch; struct timeval now, next_tx; if(scamper_task_queue_isdone(task)) return; /* if there are no branches to probe, then we're done */ if(heap_count(state->active) == 0 && heap_count(state->waiting) == 0) { scamper_task_queue_done(task, 0); return; } if((branch = heap_head_item(state->active)) != NULL) { timeval_cpy(&next_tx, &branch->next_tx); } else { timeval_cpy(&next_tx, &state->next_tx); } /* get the current time */ gettimeofday_wrap(&now); /* if the time to probe has already passed, queue it up */ if(timeval_cmp(&next_tx, &now) <= 0) { /* check to see if we're permitted to send another probe */ if(trace->probec >= trace->probec_max) { scamper_task_queue_done(task, 0); return; } scamper_task_queue_probe(task); return; } scamper_task_queue_wait_tv(task, &next_tx); return; } static int tracelb_process_hops(scamper_task_t *task, tracelb_branch_t *br) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_path_t *path0 = br->path; scamper_tracelb_probeset_t *set; scamper_tracelb_probe_t *probe; scamper_tracelb_node_t *from, *to; scamper_tracelb_link_t *link; tracelb_link_t *tlbl; tracelb_path_t *newp; tracelb_probe_t *pr; uint16_t flowid; slist_t *flowids = NULL; int i, j, k, splice, record, timxceed; assert(br->probec > 0); /* * get the from node. the algorithm to obtain it depends on exactly what * happened prior to reaching here. */ if(br->mode == MODE_FIRSTHOP) from = trace->nodes[0]; else if(br->mode == MODE_CLUMP) from = NULL; else if(path0->linkc > 0) from = path0->links[path0->linkc-1]->link->to; else from = path0->back[0]->links[path0->back[0]->linkc-1]->link->to; for(i=0; inewnodec; i++) { /* get details about the far end of the link */ to = scamper_tracelb_node_find(trace, br->newnodes[i]->node); if(to == NULL) { to = br->newnodes[i]->node; if(scamper_tracelb_node_add(trace, to) != 0) goto err; splice = 0; } else { scamper_tracelb_node_free(br->newnodes[i]->node); splice = 1; } free(br->newnodes[i]); br->newnodes[i] = NULL; /* create a link to store in the trace */ if(br->mode != MODE_CLUMP) { assert(from != NULL); if((link = scamper_tracelb_link_alloc()) == NULL) { goto err; } link->from = from; link->to = to; } else { link = path0->links[path0->linkc-1]->link; assert(link->to == NULL); link->to = to; } /* * try and allocate a probeset to record details of probes. * if it fails, then we have to free the link allocated above */ if((set = scamper_tracelb_probeset_alloc()) == NULL || (flowids = slist_alloc()) == NULL) { if(br->mode != MODE_CLUMP) scamper_tracelb_link_free(link); goto err; } /* * record responses with each link. the code is relatively complicated * as we want to record all relevant probes with the link (some of which * did not obtain a response) and also figure out which flowids to use * probing forward. */ flowid = br->probes[0]->probe->flowid; k = 0; record = 0; timxceed = 1; for(j=0; j<=br->probec; j++) { /* * when we've got to the end of a sequence of probes with the same * flowid, look to record that sequence if applicable. * * the j == br->probec is a hack to make sure the last probe is * counted when processing all probes. */ if(j == br->probec || br->probes[j]->probe->flowid != flowid) { /* * record only if the response(s) came from the node we are * recording to */ if(record != 0) { /* * record the flowid for further use if we have only * received time exceeded responses when probing */ if(timxceed != 0 && br->probes[k]->mode != MODE_PERPACKET) { pr = br->probes[k]; if(tracelb_flowids_list_add(flowids, pr) != 0) goto err; } /* * record all attempts with a particular flowid/ttl * combination */ while(kprobes[k]; if(scamper_tracelb_probeset_add(set, pr->probe) != 0) goto err; k++; } } if(j == br->probec) break; /* moving onto the next flowid now. reset variables */ timxceed = 1; record = 0; flowid = br->probes[j]->probe->flowid; k = j; } pr = br->probes[j]; probe = pr->probe; /* if this probe is one which was brought forward, then skip it */ if(pr->mode == MODE_BRINGFWD || pr->mode == MODE_BRINGFWD0) { k++; continue; } /* check to see if this probe got any responses. */ if(probe->rxc == 0) continue; /* * if we're in this function, it is because no probe got more than * a single response */ assert(probe->rxc == 1 || pr->mode == MODE_PERPACKET); /* * if this reply matches the node we're processing, then set a * variable to say that we want to record this set of probes. */ if(tracelb_cmp_node2reply(to, probe->rxs[0]) == 0) { record = 1; if(SCAMPER_TRACELB_REPLY_IS_ICMP_TTL_EXP(probe->rxs[0]) == 0) timxceed = 0; } } /* record the probeset with the link */ if(scamper_tracelb_link_probeset(link, set) != 0) { printerror(__func__, "could not add probeset"); goto err; } /* record the link in the trace */ if(link->hopc == 1 && scamper_tracelb_link_add(trace, link) != 0) { printerror(__func__, "could not add new link"); goto err; } if(br->mode == MODE_FIRSTHOP) { assert(splice == 0 || link->from == link->to); if((newp = tracelb_path_alloc(state, 0)) == NULL || (tlbl = tracelb_link_alloc(state, link, newp)) == NULL || tracelb_path_add_link(newp, tlbl) != 0) { goto err; } } else if(br->mode == MODE_CLUMP) { tlbl = path0->links[path0->linkc-1]; tracelb_link_flowids_inc(tlbl); newp = path0; } else if(br->newnodec == 1) { /* * (1) allocate a tracelb_link_t structure to keep link state with * (2) add the link to the path being probed * (3) note the successful probes with the link state */ if((tlbl = tracelb_link_alloc(state, link, path0)) == NULL || tracelb_path_add_link(path0, tlbl) != 0) { goto err; } newp = path0; } else { if((newp = tracelb_path_alloc(state, 0)) == NULL || (tlbl = tracelb_link_alloc(state, link, newp)) == NULL || tracelb_path_add_link(newp, tlbl) != 0 || tracelb_path_add_back(newp, path0) != 0) { goto err; } /* the distance to the root is one more than the last path segment */ newp->distance = path0->distance + 1; tracelb_paths_sort(state); } tracelb_link_flowids_add_list(tlbl, flowids); flowids = NULL; if(tracelb_link_continue(trace, newp, link) == 0) continue; if(splice == 0) { if(tracelb_path_add(state, newp) != 0) { goto err; } } else { if(tracelb_paths_splice_bynode(state, newp) != 0) { goto err; } } } tracelb_branch_free(state, br); tracelb_paths_assert(state); return 0; err: return -1; } static int tracelb_process_clump(scamper_task_t *task, tracelb_branch_t *br) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_path_t *path0 = br->path; scamper_tracelb_probe_t *probe; scamper_tracelb_node_t *node; scamper_tracelb_link_t *link; scamper_tracelb_probeset_t *set = NULL; tracelb_probe_t *pr; tracelb_link_t *tlbl = NULL; slist_t *flowids = NULL; uint16_t flowid; int i, j, k, halt = 0; tracelb_paths_dump(state); if(path0 == NULL) { assert(trace->nodec == 1); for(i=0; inewnodec; i++) { node = br->newnodes[i]->node; if(scamper_tracelb_node_cmp(trace->nodes[0], node) == 0) { scamper_debug(__func__, "node %d loop", i); halt = 1; } scamper_tracelb_node_free(br->newnodes[i]->node); free(br->newnodes[i]); br->newnodes[i] = NULL; } free(br->newnodes); br->newnodes = NULL; br->newnodec = 0; if((path0 = tracelb_path_alloc(state, 0)) == NULL) goto err; br->path = path0; } else if(br->newnodec > 0) { /* * check if any of the nodes would indicate a loop. this is the only * thing we use the nodes for, so free them as we go. */ for(i=0; inewnodec; i++) { node = br->newnodes[i]->node; if(halt == 0 && tracelb_isloop_addr(path0, node->addr) != NULL) { scamper_debug(__func__, "node %d loop", i); halt = 1; } scamper_tracelb_node_free(br->newnodes[i]->node); free(br->newnodes[i]); br->newnodes[i] = NULL; } free(br->newnodes); br->newnodes = NULL; br->newnodec = 0; } else if(path0->linkc > 0) { link = path0->links[path0->linkc-1]->link; if(trace->gaplimit < 2) { halt = 1; } else if(link->to == NULL && link->hopc+1 >= trace->gaplimit) { k = 1; for(i=link->hopc-1; i>=0; i--) { if(k == trace->gaplimit) break; set = link->sets[i]; for(j=0; jprobec; j++) if(set->probes[j]->rxc > 0) break; if(j == set->probec) k++; } if(k == trace->gaplimit) halt = 1; } } /* allocate a list to store flowids in */ if((flowids = slist_alloc()) == NULL) { printerror(__func__, "could not alloc list"); goto err; } /* allocate a probeset and add all probes sent in the round */ if((set = scamper_tracelb_probeset_alloc()) == NULL) { printerror(__func__, "could not alloc probeset"); goto err; } flowid = br->probes[0]->probe->flowid; k = 0; for(i=0; i<=br->probec; i++) { /* * record the flowid in the branch so it will be used for further * probing, unless its already been noted the branch will not be * probed further. */ if(i == br->probec || flowid != br->probes[i]->probe->flowid) { if(halt == 0 && kprobes[k]; if(pr->mode != MODE_PERPACKET && tracelb_flowids_list_add(flowids, pr) != 0) goto err; } if(i == br->probec) break; flowid = br->probes[i]->probe->flowid; k = i; } pr = br->probes[i]; if(pr->mode == MODE_BRINGFWD || pr->mode == MODE_BRINGFWD0) { k++; continue; } probe = pr->probe; if(scamper_tracelb_probeset_add(set, probe) != 0) { printerror(__func__, "could not add probe %d", i); goto err; } /* * if any of the responses observed are not a time exceeded message, * then halt this branch of probing */ if(halt != 0) continue; for(j=0; jrxc; j++) { if(SCAMPER_TRACELB_REPLY_IS_ICMP_TTL_EXP(probe->rxs[j]) == 0) halt = 1; } } /* * determine if we have to create a new link or if the clump merely extends * an earlier one */ if(path0->linkc == 0 || path0->links[path0->linkc-1]->link->to != NULL) { if((link = scamper_tracelb_link_alloc()) == NULL) { printerror(__func__, "could not alloc link"); goto err; } if(path0->linkc > 0) link->from = path0->links[path0->linkc-1]->link->to; else if(path0->backc > 0) link->from = path0->back[0]->links[path0->back[0]->linkc-1]->link->to; else link->from = trace->nodes[0]; } else { tlbl = path0->links[path0->linkc-1]; link = tlbl->link; tracelb_link_flowids_inc(tlbl); } /* add the probeset to the link */ if(scamper_tracelb_link_probeset(link, set) != 0) { printerror(__func__, "could not add probeset"); goto err; } /* if this is the first probeset to be added, then record the link */ if(link->hopc == 1) { if(scamper_tracelb_link_add(trace, link) != 0) { printerror(__func__, "could not add new link"); goto err; } if((tlbl = tracelb_link_alloc(state, link, path0)) == NULL || tracelb_path_add_link(path0, tlbl) != 0) { goto err; } } if(halt == 0) { tracelb_link_flowids_add_list(tlbl, flowids); /* put the branch back in for probing */ br->mode = MODE_CLUMP; tracelb_branch_reset(br); timeval_add_cs(&br->next_tx, &br->last_tx, trace->wait_probe); if(tracelb_branch_waiting(state, br) != 0) goto err; } else { if(flowids != NULL) slist_free_cb(flowids, free); tracelb_branch_free(state, br); } return 0; err: return -1; } static int tracelb_process_perpacket(scamper_task_t *task,tracelb_branch_t *br) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); br->mode = MODE_PERPACKET; tracelb_branch_reset(br); timeval_add_cs(&br->next_tx, &br->last_tx, trace->wait_probe); if(tracelb_branch_active(state, br) != 0) return -1; return 0; } static void tracelb_process_probes(scamper_task_t *task, tracelb_branch_t *br) { tracelb_state_t *state = tracelb_getstate(task); tracelb_probe_t *pr; scamper_addr_t *addr = NULL; scamper_tracelb_probe_t *probe; scamper_tracelb_reply_t *reply; uint16_t flowid; uint8_t mode; int i, n = 0, c = 0, x = 0, hopprobe = 0; #ifndef NDEBUG char *ms; for(i=0; iprobec; i++) { pr = br->probes[i]; probe = pr->probe; if(pr->mode == MODE_FIRSTADDR) ms = "firstaddr"; else if(pr->mode == MODE_FIRSTHOP) ms = "firsthop"; else if(pr->mode == MODE_HOPPROBE) ms = "hopprobe"; else if(pr->mode == MODE_BRINGFWD) ms = "bringfwd"; else if(pr->mode == MODE_BRINGFWD0) ms = "bringfwd0"; else if(pr->mode == MODE_CLUMP) ms = "clump"; else if(pr->mode == MODE_PERPACKET) ms = "perpacket"; else ms = "???"; scamper_debug(__func__, "flow %d ttl %d rx %d %s", probe->flowid, probe->ttl, probe->rxc, ms); } #endif /* remove the branch from the active heap, if it is not already removed */ if(br->heapnode != NULL) heap_delete(state->active, br->heapnode); assert(br->mode == MODE_FIRSTHOP || br->mode == MODE_HOPPROBE || br->mode == MODE_PERPACKET || br->mode == MODE_CLUMP); /* * first, check the nature of the replies received; i.e. count the * number of probes which solicited multiple responses, and count the * number of probes which solicited no response. * * we will do this step twice in the face of a branch where we also * check for per-packet forwarding. this is because a second * response may arrive to the last probe (but not any earlier ones) * but the decision about checking for per-packet behaviour is done * before the second response arrives. */ flowid = br->probes[0]->probe->flowid; for(i=0; i<=br->probec; i++) { if(i == br->probec) { if(x == 0 && hopprobe != 0) n++; break; } pr = br->probes[i]; probe = pr->probe; if(probe->flowid != flowid) { /* * if a unique flowid had no response (even with multiple * attempts) then make a note of that. */ if(x == 0 && hopprobe != 0) n++; flowid = probe->flowid; x = 0; hopprobe = 0; addr = NULL; } /* * ignore what happened to probes if it isn't a probe that was * trying to enumerate hops. */ if(pr->mode == MODE_HOPPROBE || pr->mode == MODE_FIRSTHOP || pr->mode == MODE_CLUMP) { hopprobe = 1; /* make a note that this probe got a response */ if(probe->rxc > 0) x++; /* make a note that this probe got multiple responses */ if(probe->rxc > 1) c++; /* * check if probes with the same flowid got responses * from different addresses. */ if(probe->rxc == 1) { reply = probe->rxs[0]; if(addr == NULL) addr = reply->reply_from; else if(scamper_addr_cmp(addr, reply->reply_from) != 0) c++; } } } if(br->mode == MODE_PERPACKET) { if(br->k <= k(state, 2) || c > 0 || n > 0) mode = MODE_CLUMP; else mode = MODE_HOPPROBE; } else { if(c > 0 || n > 0) { mode = MODE_CLUMP; } else if(br->newnodec > 1) { if(br->mode == MODE_HOPPROBE) mode = MODE_PERPACKET; else mode = MODE_CLUMP; } else { mode = MODE_HOPPROBE; } } if(mode == MODE_HOPPROBE) tracelb_process_hops(task, br); else if(mode == MODE_CLUMP) tracelb_process_clump(task, br); else tracelb_process_perpacket(task, br); tracelb_paths_dump(state); tracelb_queue(task); return; } /* * tracelb_path_flowid * * determine if the path has a usable flowid that does not need to be * brought forward. */ static int tracelb_path_flowid(tracelb_path_t *path, scamper_tracelb_probe_t *probe) { tracelb_flowid_t *flowid; int i; /* check the path for a flow-id */ for(i=path->linkc-1; i>=0; i--) { if((flowid = tracelb_link_flowid_get(path->links[i])) == NULL) continue; probe->flowid = flowid->id; probe->ttl = flowid->ttl + 1; free(flowid); for(i=i+1; ilinkc; i++) probe->ttl += path->links[i]->link->hopc; return 1; } /* * if the path does not have a flow-id, descend through any prior paths * that only have one forward branch (to this path) for a usable flowid. * if one is found, then as the recursive function unwinds, the ttl is * incremented by the ttl of each path segment leading to it. */ for(i=0; ibackc; i++) { if(path->back[i]->fwdc == 1 && tracelb_path_flowid(path->back[i], probe) != 0) { for(i=0; ilinkc; i++) probe->ttl += path->links[i]->link->hopc; return 1; } } return 0; } /* * tracelb_probe_vals * * for the current path being traced, determine the flowid and * ttl values to use next. * */ static int tracelb_probe_vals(scamper_task_t *task, tracelb_branch_t *branch, tracelb_probe_t *pr) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_path_t *path0, *path; size_t len; int i; #ifndef NDEBUG scamper_tracelb_node_t *node; char from[64], to[64]; #endif tracelb_paths_assert(state); /* the current path being traced is found in position zero */ path0 = branch->path; /* this will be the first attempt made */ pr->mode = branch->mode; pr->probe->attempt = 0; /* * look through the links traced so far in this path, starting at the most * recent link prior to the current link. if a flow-id is found in * this link sequence then we can just probe with that at the current TTL * as there is some confidence there are no branches in this sequence. */ if(tracelb_path_flowid(path0, pr->probe) != 0) { /* this flowid has been brought all the way forward */ for(i=0; ibringfwdc; i++) branch->bringfwd[i]->k = 0; if(path0->linkc > 0) pr->link = path0->links[path0->linkc-1]; else if(path0->backc > 0) pr->link = path0->back[0]->links[path0->back[0]->linkc-1]; else return -1; return 0; } assert(trace->nodec > 0); assert(trace->nodes[0] != NULL); assert(trace->nodes[0]->linkc > 0); /* * if there are no prior path segments, then the probe is going to have * a brand new flowid */ if(path0->back == NULL && trace->nodes[0]->linkc == 1) { pr->probe->ttl = trace->firsthop + 1; for(i=0; ilinkc; i++) pr->probe->ttl += path0->links[i]->link->hopc; pr->probe->flowid = state->flowid_next++; pr->link = path0->links[path0->linkc-1]; return 0; } /* build the set of paths leading to the current path, if necessary */ if(branch->bringfwd == NULL || branch->bringfwd[0]->path != path0) { /* make sure any existing state is removed */ tracelb_bringfwd_free(branch); /* allocate enough entries to record all segments, if necessary */ len = sizeof(tracelb_bringfwd_t *) * state->pathc; if((branch->bringfwd = malloc_zero(len)) == NULL) { printerror(__func__, "could not malloc set"); return -1; } /* * do a depth-first traversal of the path, figuring out what sequence * of path segments are visited on the way up. sort the sequence * into the distance from the root of the tree, so that the root of * the tree is the last item in the array, and the current path is * found at the head. */ tracelb_set_visited0(state); if(tracelb_bringfwd_dft(branch, path0) == -1) return -1; array_qsort((void **)branch->bringfwd, branch->bringfwdc, (array_cmp_t)tracelb_bringfwd_cmp); #ifndef NDEBUG for(i=branch->bringfwdc-1; i>=0; i--) { path = branch->bringfwd[i]->path; if(path->linkc == 0) continue; node = path->links[0]->link->from; if(node->addr != NULL) scamper_addr_tostr(node->addr, from, sizeof(from)); else snprintf(from, sizeof(from), "*"); if((node = path->links[path->linkc-1]->link->to) != NULL) scamper_addr_tostr(node->addr, to, sizeof(to)); else snprintf(to, sizeof(to), "*"); scamper_debug(__func__, "%d %s %s", path->distance, from, to); } #endif } /* * sanity check that the table starts with the current path being probed * and extends back to the first path segment */ assert(branch->bringfwd[0]->path == path0); assert(branch->bringfwd[branch->bringfwdc-1]->path->backc == 0); /* reset the visited members to zero */ for(i=0; ibringfwdc; i++) branch->bringfwd[i]->path->visited = 0; /* we now have to bring a flowid forward through the path to probe a hop */ pr->mode = MODE_BRINGFWD; /* * descend through the table of paths, checking to see if there is any * flowid available for use */ for(i=1; ibringfwdc; i++) { path = branch->bringfwd[i]->path; if(path->visited != 0) { continue; } if(tracelb_path_flowid(path, pr->probe) != 0) { if(path->linkc != 0) pr->link = path->links[path->linkc-1]; else pr->link = path->back[0]->links[path->back[0]->linkc-1]; goto done; } } /* * there is no flowid available for use. * create a new one to bring forward */ pr->probe->flowid = state->flowid_next++; pr->probe->ttl = trace->firsthop + 1; if(trace->nodes[0]->linkc == 1) { path = branch->bringfwd[branch->bringfwdc-1]->path; pr->link = path->links[path->linkc-1]; for(i=0; ilinkc; i++) pr->probe->ttl += path->links[i]->link->hopc; } else { pr->mode = MODE_BRINGFWD0; pr->link = NULL; } done: scamper_debug(__func__, "bringfwd: ttl %d flowid %d", pr->probe->ttl, pr->probe->flowid); return 0; } static void tracelb_branch_cancel(scamper_task_t *task, tracelb_branch_t *br) { scamper_debug(__func__, "cancelling path %p", br->path); tracelb_process_probes(task, br); return; } /* * handleicmp_reply * * add details of the reply to the link */ static scamper_tracelb_reply_t *handleicmp_reply(const scamper_icmp_resp_t *ir, scamper_addr_t *from) { scamper_tracelb_reply_t *reply; if((reply = scamper_tracelb_reply_alloc(from)) == NULL) { printerror(__func__, "could not allocate reply"); return NULL; } timeval_cpy(&reply->reply_rx, &ir->ir_rx); reply->reply_ipid = ir->ir_ip_id; reply->reply_icmp_type = ir->ir_icmp_type; reply->reply_icmp_code = ir->ir_icmp_code; reply->reply_icmp_q_ttl = ir->ir_inner_ip_ttl; reply->reply_icmp_q_tos = ir->ir_inner_ip_tos; if(ir->ir_ip_ttl >= 0) { reply->reply_ttl = (uint8_t)ir->ir_ip_ttl; reply->reply_flags |= SCAMPER_TRACELB_REPLY_FLAG_REPLY_TTL; } if(ir->ir_ext != NULL && scamper_icmpext_parse(&reply->reply_icmp_ext, ir->ir_ext, ir->ir_extlen) != 0) { scamper_debug(__func__, "could not include icmp extension data"); scamper_tracelb_reply_free(reply); return NULL; } return reply; } static scamper_tracelb_reply_t *handletcp_reply(const scamper_dl_rec_t *dl, scamper_addr_t *from) { scamper_tracelb_reply_t *reply; if((reply = scamper_tracelb_reply_alloc(from)) == NULL) { printerror(__func__, "could not allocate reply"); return NULL; } timeval_cpy(&reply->reply_rx, &dl->dl_tv); reply->reply_flags = SCAMPER_TRACELB_REPLY_FLAG_TCP; reply->reply_flags |= SCAMPER_TRACELB_REPLY_FLAG_REPLY_TTL; reply->reply_ttl = dl->dl_ip_ttl; reply->reply_tcp_flags = dl->dl_tcp_flags; reply->reply_ipid = dl->dl_ip_id; return reply; } /* * handleicmp_firstaddr * * handle recording the first address discovered in the IP path. */ static void handleicmp_firstaddr(scamper_task_t *task, scamper_icmp_resp_t *ir, tracelb_probe_t *pr, scamper_addr_t *from) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_branch_t *branch = pr->branch; scamper_tracelb_node_t *node = NULL; assert(pr->probe->ttl == trace->firsthop); assert(trace->nodes == NULL); heap_delete(state->active, branch->heapnode); /* record the details of the first hop */ if((node = scamper_tracelb_node_alloc(from)) == NULL) { printerror(__func__, "could not alloc node"); goto err; } if(SCAMPER_ICMP_RESP_IS_TTL_EXP(ir) || SCAMPER_ICMP_RESP_IS_UNREACH(ir)) { node->flags |= SCAMPER_TRACELB_NODE_FLAG_QTTL; node->q_ttl = ir->ir_inner_ip_ttl; } if(scamper_tracelb_node_add(trace, node) != 0) { printerror(__func__, "could not add node"); goto err; } node = NULL; /* if we can't probe on, then we're done */ if(SCAMPER_ICMP_RESP_IS_TTL_EXP(ir) == 0 || scamper_addr_cmp(trace->dst, from) == 0) { tracelb_branch_free(state, branch); tracelb_queue(task); return; } /* we've got the first address; now probe active branches from here */ branch->mode = MODE_FIRSTHOP; tracelb_branch_reset(branch); timeval_add_cs(&branch->next_tx, &branch->last_tx, trace->wait_probe); if(tracelb_branch_waiting(state, branch) != 0) goto err; tracelb_queue(task); return; err: scamper_tracelb_node_free(node); tracelb_branch_free(state, branch); tracelb_handleerror(task, errno); return; } static int hopprobe_handlereply(scamper_task_t *task, tracelb_probe_t *pr, scamper_tracelb_reply_t *reply) { tracelb_branch_t *branch = pr->branch; scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); if(scamper_tracelb_probe_reply(pr->probe, reply) != 0) { printerror(__func__, "could not add reply to probe"); scamper_tracelb_reply_free(reply); return -1; } /* * if this was not the most recent probe to be sent, or it was not the first * response to the probe, we're done. */ if(branch->probes[branch->probec-1] != pr || pr->probe->rxc > 1) { return 0; } if(tracelb_newnode_find(branch, reply) == NULL) { if(tracelb_newnode_add(branch, pr->probe) != 0) return -1; if(branch->n == branch->newnodec) { scamper_debug(__func__, "branch->n %d", branch->n); branch->n++; } } heap_delete(state->active, branch->heapnode); branch->k++; /* * if a reply from the destination is received, assume that there is only * one link used to forward to the destination (in this case the directly * connected interface) and process that link now. * * otherwise, if the hop has been probed enough to the appropriate level * of confidence, process the links discovered. */ if(branch->n >= TRACELB_CONFIDENCE_MAX_N || (scamper_addr_cmp(reply->reply_from, trace->dst) == 0 && branch->newnodec < 2) || branch->k >= k(state, branch->n)) { tracelb_process_probes(task, branch); } else { timeval_add_cs(&branch->next_tx, &branch->last_tx, trace->wait_probe); if(tracelb_branch_active(state, branch) != 0) return -1; tracelb_queue(task); } return 0; } /* * handleicmp_hopprobe * * handle processing a reply, including recording details of the reply and * deciding what to do next */ static void handleicmp_hopprobe(scamper_task_t *task, scamper_icmp_resp_t *ir, tracelb_probe_t *pr, scamper_addr_t *irfrom) { scamper_tracelb_reply_t *reply; if(pr->branch == NULL) return; /* * generate a reply to store with the probe, and then record the reply with * the probe */ if((reply = handleicmp_reply(ir, irfrom)) == NULL || hopprobe_handlereply(task, pr, reply) != 0) { tracelb_handleerror(task, errno); } return; } /* * handleicmp_perpacket * * this routine is used to check if a load balancing router at a particular * hop forwards on a per-packet basis. */ static void handleicmp_perpacket(scamper_task_t *task, scamper_icmp_resp_t *ir, tracelb_probe_t *pr, scamper_addr_t *from) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_branch_t *branch = pr->branch; scamper_tracelb_node_t *node = branch->newnodes[0]->node; scamper_tracelb_reply_t *reply; int process = 0; if(pr->branch == NULL) return; assert(branch->newnodec > 1); if((reply = handleicmp_reply(ir, from)) == NULL) { goto err; } if(scamper_tracelb_probe_reply(pr->probe, reply) != 0) { scamper_tracelb_reply_free(reply); goto err; } if(pr->probe->rxc == 1) branch->k++; if(tracelb_cmp_node2reply(node, reply) != 0) { process = 1; } else if(pr->probe->rxc == 1 && branch->k == k(state, 2)) { process = 1; branch->k++; } if(process == 0) { heap_delete(state->active, branch->heapnode); timeval_add_cs(&branch->next_tx, &branch->last_tx, trace->wait_probe); if(tracelb_branch_active(state, branch) != 0) goto err; tracelb_queue(task); } else { tracelb_process_probes(task, pr->branch); } return; err: tracelb_handleerror(task, errno); return; } /* * handleicmp_bringfwd * * handle an ICMP reply in the bringfwd mode. */ static void handleicmp_bringfwd(scamper_task_t *task, scamper_icmp_resp_t *ir, tracelb_probe_t *pr, scamper_addr_t *from) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_branch_t *branch = pr->branch; tracelb_probe_t *cpr; scamper_tracelb_reply_t *reply; scamper_tracelb_link_t findme; scamper_tracelb_node_t node; tracelb_link_t *tlbl; int i, rx, set, n; #ifdef HAVE_SCAMPER_DEBUG char f[64], t[64]; #endif if((reply = handleicmp_reply(ir, from)) == NULL) { goto err; } if(scamper_tracelb_probe_reply(pr->probe, reply) != 0) { scamper_tracelb_reply_free(reply); goto err; } /* * check that the reply is for the current flowid/ttl combination, and * that the reply is the first reply for this flowid/ttl combination */ cpr = branch->probes[branch->probec-1]; if(pr->mode != cpr->mode || pr->probe->flowid != cpr->probe->flowid || pr->probe->ttl != cpr->probe->ttl) { return; } for(i=0, rx=0; i<=cpr->probe->attempt; i++) { rx += branch->probes[branch->probec-1-i]->probe->rxc; } if(rx != 1) { return; } memset(&node, 0, sizeof(node)); if(SCAMPER_ICMP_RESP_IS_TTL_EXP(ir) || SCAMPER_ICMP_RESP_IS_UNREACH(ir)) { node.q_ttl |= ir->ir_inner_ip_ttl; node.flags = SCAMPER_TRACELB_NODE_FLAG_QTTL; } node.addr = from; findme.to = &node; assert(pr->mode == MODE_BRINGFWD || pr->mode == MODE_BRINGFWD0); if(pr->mode == MODE_BRINGFWD) findme.from = pr->link->link->to; else findme.from = trace->nodes[0]; scamper_debug(__func__, "reply link %s %s", scamper_addr_tostr(findme.from->addr, f, sizeof(f)), scamper_addr_tostr(findme.to->addr, t, sizeof(t))); if((tlbl = tracelb_link_find(state, &findme)) == NULL) { scamper_debug(__func__, "no matching link in trace"); set = 1; } else { if(tracelb_link_flowid_add_tail(tlbl, pr->probe) != 0) goto err; for(i=0; ibringfwdc; i++) { if(branch->bringfwd[i]->path->linkc == 0) continue; if(branch->bringfwd[i]->path->links[0] == tlbl) break; } if(i != branch->bringfwdc) set = 0; else set = 1; } /* * if after trying to bring a flowid past a particular router we can't, * stop trying */ if(pr->mode == MODE_BRINGFWD) { if(tracelb_bringfwd_set(state, branch, pr->link, set) != 0) { tracelb_branch_cancel(task, branch); branch = NULL; } } else { assert(pr->mode == MODE_BRINGFWD0); n = TRACELB_CONFIDENCE_NLIMIT(trace->nodes[0]->linkc+2); if(set == 0) branch->bringfwd0 = 0; else branch->bringfwd0++; scamper_debug(__func__, "i 0 k %d : %d", branch->bringfwd0, k(state, n)); if(branch->bringfwd0 >= k(state, n)) { tracelb_branch_cancel(task, branch); branch = NULL; } } if(branch != NULL) { heap_delete(state->active, branch->heapnode); timeval_add_cs(&branch->next_tx, &branch->last_tx, trace->wait_probe); if(tracelb_branch_active(state, branch) != 0) goto err; } tracelb_paths_dump(state); tracelb_queue(task); return; err: tracelb_handleerror(task, errno); return; } static void do_tracelb_handle_icmp(scamper_task_t *task, scamper_icmp_resp_t *ir) { static void (*const func[])(scamper_task_t *, scamper_icmp_resp_t *, tracelb_probe_t *, scamper_addr_t *) = { NULL, /* MODE_RTSOCK */ NULL, /* MODE_DLHDR */ handleicmp_firstaddr, /* MODE_FIRSTADDR */ handleicmp_hopprobe, /* MODE_FIRSTHOP */ handleicmp_hopprobe, /* MODE_HOPPROBE */ handleicmp_perpacket, /* MODE_PERPACKET */ handleicmp_bringfwd, /* MODE_BRINGFWD */ handleicmp_bringfwd, /* MODE_BRINGFWD0 */ handleicmp_hopprobe, /* MODE_CLUMP */ }; scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_probe_t *pr; scamper_addr_t *icmpfrom = NULL; uint16_t id; uint8_t proto; void *addr; int type; assert(ir->ir_af == AF_INET || ir->ir_af == AF_INET6); /* * if the first probe has not been sent yet, then this cannot be a reply * for anything we sent. */ if(state->id_next == 0) return; /* * ignore the message if it is received on an fd that we didn't use to send * it. this is to avoid recording duplicate replies if an unbound socket * is in use. */ if(ir->ir_fd != scamper_fd_fd_get(state->icmp)) return; scamper_icmp_resp_print(ir); /* if the ICMP type is not something that we care for, then drop it */ if(!((SCAMPER_ICMP_RESP_IS_TTL_EXP(ir) || SCAMPER_ICMP_RESP_IS_UNREACH(ir) || SCAMPER_ICMP_RESP_IS_PACKET_TOO_BIG(ir)) && SCAMPER_ICMP_RESP_INNER_IS_SET(ir) && ir->ir_inner_ip_off == 0) && !(SCAMPER_TRACELB_TYPE_IS_ICMP(trace) && SCAMPER_ICMP_RESP_IS_ECHO_REPLY(ir))) { return; } if(SCAMPER_TRACELB_TYPE_IS_UDP(trace)) { /* * if the ICMP response does not reference a UDP probe sent from our * source port to a destination probe we're likely to have probed, then * ignore the packet */ if(ir->ir_inner_ip_proto != IPPROTO_UDP) return; if(trace->type == SCAMPER_TRACELB_TYPE_UDP_DPORT) { /* if the dport varies, the sport should match */ if(ir->ir_inner_udp_sport != trace->sport) return; } else { /* if the sport varies, the dport should match */ if(ir->ir_inner_udp_dport != trace->dport) return; } /* extract the id of the probe */ if(ir->ir_af == AF_INET) { if(ntohs(ir->ir_inner_udp_sum) == ir->ir_inner_ip_id && ir->ir_inner_udp_sum != 0) { id = ntohs(ir->ir_inner_udp_sum) - 1; } else if(ir->ir_inner_ip_id != 0) { id = ir->ir_inner_ip_id - 1; } else { return; } } else if(ir->ir_af == AF_INET6) { if(ir->ir_inner_udp_sum == 0) return; id = ntohs(ir->ir_inner_udp_sum) - 1; } else return; } else if(SCAMPER_TRACELB_TYPE_IS_ICMP(trace)) { if(SCAMPER_ICMP_RESP_IS_ECHO_REPLY(ir) == 0) { if(ir->ir_af == AF_INET) proto = IPPROTO_ICMP; else if(ir->ir_af == AF_INET6) proto = IPPROTO_ICMPV6; else return; if(ir->ir_inner_ip_proto != proto || ir->ir_inner_icmp_id != trace->sport || ir->ir_inner_icmp_seq >= state->id_next) { return; } id = ir->ir_inner_icmp_seq; } else { if(ir->ir_icmp_id != trace->sport || ir->ir_icmp_seq >= state->id_next) { return; } id = ir->ir_icmp_seq; } } else if(SCAMPER_TRACELB_TYPE_IS_TCP(trace)) { /* * if the ICMP response does not reference a UDP probe sent from our * source port to a destination probe we're likely to have probed, then * ignore the packet */ if(ir->ir_inner_ip_proto != IPPROTO_TCP || ir->ir_inner_tcp_dport != trace->dport) { return; } if(ir->ir_inner_ip_id != 0) id = ir->ir_inner_ip_id - 1; else return; } else return; /* make sure the id is in range */ if(id >= state->id_next) { return; } pr = state->probes[id]; if(pr->branch == NULL) { scamper_debug(__func__, "pr->branch is null"); return; } /* get the address of the icmp response */ if(ir->ir_af == AF_INET) { type = SCAMPER_ADDR_TYPE_IPV4; addr = &ir->ir_ip_src.v4; } else { type = SCAMPER_ADDR_TYPE_IPV6; addr = &ir->ir_ip_src.v6; } if((icmpfrom = tracelb_addr(state, type, addr)) == NULL) { tracelb_handleerror(task, errno); return; } func[pr->mode](task, ir, pr, icmpfrom); return; } /* * handletimeout_firstaddr * * if a reply for the first set of probes sent into the network is not * received, then abandon */ static void handletimeout_firstaddr(scamper_task_t *task, tracelb_branch_t *br) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); scamper_tracelb_node_t *node = NULL; heap_delete(state->active, br->heapnode); if((node = scamper_tracelb_node_alloc(NULL)) == NULL) { printerror(__func__, "could not alloc node"); goto err; } if(scamper_tracelb_node_add(trace, node) != 0) { printerror(__func__, "could not add node"); goto err; } node = NULL; br->mode = MODE_FIRSTHOP; tracelb_branch_reset(br); timeval_add_cs(&br->next_tx, &br->last_tx, trace->wait_probe); if(tracelb_branch_waiting(state, br) != 0) goto err; tracelb_queue(task); return; err: scamper_tracelb_node_free(node); tracelb_branch_free(state, br); tracelb_handleerror(task, errno); return; } /* * handletimeout_abandon * * if no route is received in response to a route socket query or datalink * header request, then abandon */ static void handletimeout_abandon(scamper_task_t *task, tracelb_branch_t *br) { tracelb_state_t *state = tracelb_getstate(task); heap_delete(state->active, br->heapnode); tracelb_branch_free(state, br); tracelb_queue(task); return; } /* * handletimeout_hopprobe * * if a reply for a probe is not received, record that fact with a null * record. if the number of lost probes now takes us to the confidence level * required, then halt further probing of this particular hop. */ static void handletimeout_hopprobe(scamper_task_t *task, tracelb_branch_t *br) { tracelb_state_t *state = tracelb_getstate(task); br->l++; assert(br->mode == MODE_FIRSTHOP || br->mode == MODE_HOPPROBE || br->mode == MODE_CLUMP); /* * stop probing the link when the number of replies and the number of * lost probes reach the required confidence level */ if((br->k + br->l) >= k(state, br->n)) { tracelb_process_probes(task, br); } else { tracelb_queue(task); } return; } /* * handletimeout_perpacket * */ static void handletimeout_perpacket(scamper_task_t *task, tracelb_branch_t *br) { assert(br->newnodec > 1); tracelb_process_probes(task, br); return; } static void handletimeout_bringfwd(scamper_task_t *task, tracelb_branch_t *br) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_probe_t *pr = br->probes[br->probec-1]; int cancel = 0, n; assert(pr->mode == MODE_BRINGFWD || pr->mode == MODE_BRINGFWD0); /* * if after trying to bring a flowid past a particular router we can't, * stop trying */ if(pr->mode == MODE_BRINGFWD) { if(tracelb_bringfwd_set(state, br, pr->link, 1) != 0) { cancel = 1; } } else { br->bringfwd0++; n = TRACELB_CONFIDENCE_NLIMIT(trace->nodes[0]->linkc+2); if(br->bringfwd0 >= k(state, n)) { cancel = 1; } } if(cancel != 0) { tracelb_branch_cancel(task, br); } tracelb_queue(task); return; } /* * do_tracelb_handle_timeout * * */ static void do_tracelb_handle_timeout(scamper_task_t *task) { static void (*const func[])(scamper_task_t *, tracelb_branch_t *) = { NULL, /* MODE_RTSOCK */ NULL, /* MODE_DLHDR */ handletimeout_firstaddr, /* MODE_FIRSTADDR */ handletimeout_hopprobe, /* MODE_FIRSTHOP */ handletimeout_hopprobe, /* MODE_HOPPROBE */ handletimeout_perpacket, /* MODE_PERPACKET */ handletimeout_bringfwd, /* MODE_BRINGFWD */ handletimeout_bringfwd, /* MODE_BRINGFWD0 */ handletimeout_hopprobe, /* MODE_CLUMP */ }; scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_branch_t *br; tracelb_probe_t *pr; assert(heap_count(state->active) > 0 || heap_count(state->waiting) > 0); /* * if there is nothing in the active heap, then its time to try something * from the waiting heap. */ if((br = heap_head_item(state->active)) == NULL) { tracelb_queue(task); return; } if(br->mode == MODE_RTSOCK || br->mode == MODE_DLHDR) { handletimeout_abandon(task, br); return; } /* * check to see if the last probe received any replies. if it did not, * then we leave the decision about what to do next to other code */ assert(br->probec > 0); pr = br->probes[br->probec-1]; if(pr->probe->rxc == 0 && pr->probe->attempt + 1 >= trace->attempts) { func[pr->mode](task, br); return; } tracelb_queue(task); return; } static void handletcp_firstaddr(scamper_task_t *task, scamper_dl_rec_t *dl, tracelb_probe_t *pr, scamper_addr_t *from) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); scamper_tracelb_node_t *node = NULL; tracelb_branch_t *br = pr->branch; assert(pr->probe->ttl == trace->firsthop); assert(trace->nodes == NULL); /* don't need the branch any more */ if(br->heapnode != NULL) heap_delete(state->active, br->heapnode); tracelb_branch_free(state, br); /* record the details of the first hop */ if((node = scamper_tracelb_node_alloc(from)) == NULL || scamper_tracelb_node_add(trace, node) != 0) { printerror(__func__, "could not alloc node"); goto err; } tracelb_paths_assert(state); tracelb_queue(task); return; err: scamper_tracelb_node_free(node); tracelb_handleerror(task, errno); return; } static void handletcp_hopprobe(scamper_task_t *task, scamper_dl_rec_t *dl, tracelb_probe_t *pr, scamper_addr_t *tcpfrom) { scamper_tracelb_reply_t *reply; if(pr->branch == NULL) return; if((reply = handletcp_reply(dl, tcpfrom)) == NULL || hopprobe_handlereply(task, pr, reply) != 0) { tracelb_handleerror(task, errno); } return; } /* * handletcp_perpacket * * got a TCP response when doing the per-packet test. this is unexpected * because we would have been obtaining ICMP time exceeded messages before * we did this test. ignore response for now, but this should probably be * revised. */ static void handletcp_perpacket(scamper_task_t *task, scamper_dl_rec_t *dl, tracelb_probe_t *probe, scamper_addr_t *from) { return; } static void do_tracelb_handle_dl(scamper_task_t *task, scamper_dl_rec_t *dl) { static void (* const handletcp_func[])(scamper_task_t *, scamper_dl_rec_t *, tracelb_probe_t *, scamper_addr_t *) = { NULL, /* MODE_RTSOCK */ NULL, /* MODE_DLHDR */ handletcp_firstaddr, /* MODE_FIRSTADDR */ handletcp_hopprobe, /* MODE_FIRSTHOP */ handletcp_hopprobe, /* MODE_HOPPROBE */ handletcp_perpacket, /* MODE_PERPACKET */ NULL, /* MODE_BRINGFWD */ NULL, /* MODE_BRINGFWD0 */ handletcp_hopprobe, /* MODE_CLUMP */ }; scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); scamper_addr_t *from; tracelb_probe_t *pr; if(SCAMPER_DL_IS_TCP(dl) == 0) return; /* ignore outgoing probes observed on the datalink socket */ if(trace->type == SCAMPER_TRACELB_TYPE_TCP_SPORT) { /* * if the syn flag (and only the syn flag is set) then the probe * is probably an outgoing one */ if(dl->dl_tcp_flags == TH_SYN) return; } else if(trace->type == SCAMPER_TRACELB_TYPE_TCP_ACK_SPORT) { /* * if the ack flag (and only the ack flag is set) then the probe * is probably an outgoing one */ if(dl->dl_tcp_flags == TH_ACK) return; } scamper_dl_rec_tcp_print(dl); if(dl->dl_tcp_sport != trace->dport) { scamper_debug(__func__, "ignoring reply sport %d dport %d", dl->dl_tcp_sport, trace->dport); return; } /* * there is no easy way to determine which probe the reply is * for, so assume it was for the last one */ assert(state->id_next > 0); pr = state->probes[state->id_next-1]; if(pr->branch == NULL) { scamper_debug(__func__, "pr->branch is null"); return; } /* if the port doesn't match the flowid sent to, ignore */ if(pr->probe->flowid != dl->dl_tcp_dport) { scamper_debug(__func__, "ignoring reply flowid %d dport %d", pr->probe->flowid, dl->dl_tcp_dport); return; } /* if this is an inbound packet with a timestamp attached */ if(handletcp_func[pr->mode] != NULL) { if((from = tracelb_addr(state, trace->dst->type, dl->dl_ip_src)) == NULL) goto err; handletcp_func[pr->mode](task, dl, pr, from); } return; err: tracelb_handleerror(task, errno); return; } /* * tracelb_handle_dlhdr * * a datalink header has come in. now move into probing. */ static void tracelb_handle_dlhdr(scamper_dlhdr_t *dlhdr) { scamper_task_t *task = dlhdr->param; tracelb_state_t *state = tracelb_getstate(task); tracelb_branch_t *br; if(dlhdr->error != 0) { scamper_task_queue_done(task, 0); return; } /* there is one head item, and it is in datalink header mode */ assert(heap_count(state->active) == 1); br = heap_head_item(state->active); assert(br->mode == MODE_DLHDR); /* move into probing */ br->mode = MODE_FIRSTADDR; tracelb_branch_reset(br); scamper_task_queue_probe(task); return; } /* * tracelb_handle_rt * * process a route record: open the appropriate interface and determine * the appropriate datalink header to use when transmitting a frame */ static void tracelb_handle_rt(scamper_route_t *rt) { scamper_task_t *task = rt->param; scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_branch_t *br; scamper_dl_t *dl; #ifndef _WIN32 if(state->rtsock == NULL) goto done; #endif if(state->route != rt) goto done; assert(heap_count(state->active) == 1); br = heap_head_item(state->active); assert(br->mode == MODE_RTSOCK); #ifndef _WIN32 scamper_fd_free(state->rtsock); state->rtsock = NULL; #endif /* if there was a problem getting the ifindex, handle that */ if(rt->error != 0 || rt->ifindex < 0) { printerror(__func__, "could not get ifindex"); tracelb_handleerror(task, errno); goto done; } if((state->dl = scamper_fd_dl(rt->ifindex)) == NULL) { scamper_debug(__func__, "could not get dl for %d", rt->ifindex); tracelb_handleerror(task, errno); goto done; } /* * determine the underlying framing to use with each probe packet that will * be sent on the datalink. */ br->mode = MODE_DLHDR; if((state->dlhdr = scamper_dlhdr_alloc()) == NULL) { tracelb_handleerror(task, errno); goto done; } dl = scamper_fd_dl_get(state->dl); state->dlhdr->dst = scamper_addr_use(trace->dst); state->dlhdr->gw = rt->gw != NULL ? scamper_addr_use(rt->gw) : NULL; state->dlhdr->ifindex = rt->ifindex; state->dlhdr->txtype = scamper_dl_tx_type(dl); state->dlhdr->param = task; state->dlhdr->cb = tracelb_handle_dlhdr; if(scamper_dlhdr_get(state->dlhdr) != 0) { tracelb_handleerror(task, errno); goto done; } /* we are ready to probe, so do so */ if(br->mode == MODE_FIRSTADDR) { timeval_cpy(&state->next_tx, &br->last_tx); timeval_cpy(&br->next_tx, &br->last_tx); } tracelb_queue(task); done: scamper_route_free(rt); if(state->route == rt) state->route = NULL; return; } static void do_tracelb_write(scamper_file_t *sf, scamper_task_t *task) { scamper_tracelb_t *trace = tracelb_getdata(task); scamper_file_write_tracelb(sf, trace); return; } static void tracelb_state_free(scamper_tracelb_t *trace,tracelb_state_t *state) { tracelb_branch_t *br; tracelb_probe_t *pr; int i; tracelb_paths_dump(state); tracelb_links_dump(state); /* free the address tree */ if(state->addrs != NULL) splaytree_free(state->addrs, (splaytree_free_t)scamper_addr_free); /* free the active branch records */ if(state->active != NULL) { while((br = heap_remove(state->active)) != NULL) tracelb_branch_free(state, br); heap_free(state->active, NULL); } /* free the waiting branch records */ if(state->waiting != NULL) { while((br = heap_remove(state->waiting)) != NULL) tracelb_branch_free(state, br); heap_free(state->waiting, NULL); } /* free the probe records */ if(state->probes != NULL) { for(i=0; iid_next; i++) { pr = state->probes[i]; if(pr->mode == MODE_FIRSTADDR || pr->mode == MODE_BRINGFWD || pr->mode == MODE_BRINGFWD0) { scamper_tracelb_probe_free(pr->probe); } free(pr); } free(state->probes); } /* free the path segments built up as the tracelb progressed */ if(state->paths != NULL) { for(i=0; ipathc; i++) tracelb_path_free(state->paths[i]); free(state->paths); } /* free the link records */ if(state->links != NULL) { for(i=0; ilinkc; i++) tracelb_link_free(state->links[i]); free(state->links); } if(state->icmp != NULL) scamper_fd_free(state->icmp); if(state->dl != NULL) scamper_fd_free(state->dl); #ifndef _WIN32 if(state->rtsock != NULL) scamper_fd_free(state->rtsock); #endif if(state->dlhdr != NULL) scamper_dlhdr_free(state->dlhdr); if(state->route != NULL) scamper_route_free(state->route); switch(trace->type) { case SCAMPER_TRACELB_TYPE_UDP_DPORT: case SCAMPER_TRACELB_TYPE_ICMP_ECHO: if(state->probe != NULL) scamper_fd_free(state->probe); break; case SCAMPER_TRACELB_TYPE_UDP_SPORT: case SCAMPER_TRACELB_TYPE_TCP_SPORT: case SCAMPER_TRACELB_TYPE_TCP_ACK_SPORT: break; } free(state); return; } static void do_tracelb_halt(scamper_task_t *task) { scamper_task_queue_done(task, 0); return; } static void do_tracelb_free(scamper_task_t *task) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); if(trace == NULL) { assert(state == NULL); return; } /* free any state kept */ if(state != NULL) tracelb_state_free(trace, state); /* free trace data collected */ scamper_tracelb_free(trace); return; } static void tracelb_branch_onremove(void *item) { ((tracelb_branch_t *)item)->heapnode = NULL; return; } /* * tracelb_state_alloc * * allocate the per-tracelb state data structures to be kept. * also decide on where to start. */ static int tracelb_state_alloc(scamper_task_t *task) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = NULL; void *addr = trace->src->addr; tracelb_branch_t *branch; assert(trace != NULL); if((state = malloc_zero(sizeof(tracelb_state_t))) == NULL) { printerror(__func__, "could not malloc state"); goto err; } switch(trace->confidence) { case 95: state->confidence = 0; break; case 99: state->confidence = 1; break; default: goto err; } if((state->addrs = splaytree_alloc((splaytree_cmp_t)scamper_addr_cmp))==NULL) { printerror(__func__, "could not alloc addr tree"); goto err; } if((state->active = heap_alloc((heap_cmp_t)tracelb_branch_active_cmp))==NULL) { printerror(__func__, "could not alloc active heap"); goto err; } heap_onremove(state->active, tracelb_branch_onremove); if((state->waiting=heap_alloc((heap_cmp_t)tracelb_branch_waiting_cmp))==NULL) { printerror(__func__, "could not alloc waiting heap"); goto err; } heap_onremove(state->waiting, tracelb_branch_onremove); if((branch = malloc_zero(sizeof(tracelb_branch_t))) == NULL) { printerror(__func__, "could not alloc branch"); goto err; } if(SCAMPER_TRACELB_TYPE_VARY_SPORT(trace)) { branch->mode = MODE_RTSOCK; #ifndef _WIN32 if((state->rtsock = scamper_fd_rtsock()) == NULL) { goto err; } #endif } else { branch->mode = MODE_FIRSTADDR; } tracelb_branch_reset(branch); if(tracelb_branch_waiting(state, branch) != 0) goto err; /* get the fds to probe and listen with */ if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) { if(trace->type == SCAMPER_TRACELB_TYPE_UDP_DPORT) { if((state->probe = scamper_fd_udp4(addr, trace->sport)) == NULL) goto err; } else if(trace->type == SCAMPER_TRACELB_TYPE_ICMP_ECHO) { if((state->probe = scamper_fd_icmp4(addr)) == NULL) goto err; } else if(SCAMPER_TRACELB_TYPE_VARY_SPORT(trace) == 0) { goto err; } if(SCAMPER_TRACELB_TYPE_IS_TCP(trace)) state->payload_size = 0; else state->payload_size = trace->probe_size - 28; state->icmp = scamper_fd_icmp4(addr); } else if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV6) { if(trace->type == SCAMPER_TRACELB_TYPE_UDP_DPORT) { if((state->probe = scamper_fd_udp6(addr, trace->sport)) == NULL) goto err; } else if(trace->type == SCAMPER_TRACELB_TYPE_ICMP_ECHO) { if((state->probe = scamper_fd_icmp6(addr)) == NULL) goto err; } else if(trace->type != SCAMPER_TRACELB_TYPE_UDP_SPORT) { goto err; } state->icmp = scamper_fd_icmp6(addr); state->payload_size = trace->probe_size - 48; } else goto err; /* allocate a larger global pktbuf if needed */ if(pktbuf_len < state->payload_size) { if(realloc_wrap((void **)&pktbuf, state->payload_size) != 0) { printerror(__func__, "could not realloc"); goto err; } pktbuf_len = state->payload_size; } if(state->icmp == NULL) { goto err; } switch(trace->type) { case SCAMPER_TRACELB_TYPE_UDP_DPORT: state->flowid_next = trace->dport; break; case SCAMPER_TRACELB_TYPE_ICMP_ECHO: state->flowid_next = 1; break; case SCAMPER_TRACELB_TYPE_UDP_SPORT: case SCAMPER_TRACELB_TYPE_TCP_SPORT: case SCAMPER_TRACELB_TYPE_TCP_ACK_SPORT: state->flowid_next = trace->sport; break; default: goto err; } scamper_task_setstate(task, state); return 0; err: tracelb_state_free(trace, state); return -1; } static void do_tracelb_probe(scamper_task_t *task) { scamper_tracelb_t *trace = tracelb_getdata(task); tracelb_state_t *state = tracelb_getstate(task); tracelb_branch_t *branch; tracelb_probe_t *tp = NULL; tracelb_probe_t *tpl; scamper_probe_t probe; uint16_t u16; assert(trace != NULL); if(state == NULL) { /* timestamp when the trace began */ gettimeofday_wrap(&trace->start); /* allocate state and store it with the task */ if(tracelb_state_alloc(task) != 0) goto err; state = tracelb_getstate(task); } /* select an appropriate branch to probe */ if((branch = heap_remove(state->active)) == NULL) { branch = heap_remove(state->waiting); } assert(branch != NULL); if(branch->mode == MODE_RTSOCK) { state->route = scamper_route_alloc(trace->dst, task, tracelb_handle_rt); if(state->route == NULL) goto err; #ifndef _WIN32 if(scamper_rtsock_getroute(state->rtsock, state->route) != 0) goto err; #else if(scamper_rtsock_getroute(state->route) != 0) goto err; #endif if(scamper_task_queue_isdone(task)) { tracelb_branch_free(state, branch); return; } if(branch->mode == MODE_RTSOCK || branch->mode == MODE_DLHDR) { /* * re-queue the tracelb. have to setup the time values in the * branch and state structs as part of this. */ gettimeofday_wrap(&branch->last_tx); timeval_add_cs(&state->next_tx,&branch->last_tx,trace->wait_probe); timeval_add_s(&branch->next_tx,&branch->last_tx,trace->wait_timeout); if(tracelb_branch_active(state, branch) != 0) goto err; tracelb_queue(task); return; } } /* get a reference to the previous probe sent, if there is one */ if(branch->probec > 0) { tpl = branch->probes[branch->probec-1]; } else tpl = NULL; /* allocate a probe structure to record state of the probe to be sent */ if((tp = malloc_zero(sizeof(tracelb_probe_t))) == NULL || (tp->probe = scamper_tracelb_probe_alloc()) == NULL) { printerror(__func__, "could not alloc probe"); goto err; } assert((tpl != NULL && tpl->probe->rxc == 0 && tpl->probe->attempt+1 < trace->attempts) || branch->mode == MODE_FIRSTADDR || branch->mode == MODE_FIRSTHOP || branch->mode == MODE_HOPPROBE || branch->mode == MODE_PERPACKET || branch->mode == MODE_CLUMP); /* default mode, can be changed to something more specific if appropriate */ tp->mode = branch->mode; if(tpl != NULL && tpl->probe->rxc == 0 && tpl->probe->attempt+1 < trace->attempts) { /* * if a reply to the previous probe was not received and the allotted * number of attempts is not yet reached, retransmit */ tp->probe->flowid = tpl->probe->flowid; tp->probe->ttl = tpl->probe->ttl; tp->probe->attempt = tpl->probe->attempt + 1; tp->link = tpl->link; tp->mode = tpl->mode; } else if(branch->mode == MODE_FIRSTADDR) { /* probe to determine the address of the first hop. */ assert(trace->nodec == 0); tp->probe->flowid = state->flowid_next; tp->probe->ttl = trace->firsthop; tp->probe->attempt = 0; } else if(branch->mode == MODE_FIRSTHOP) { /* still enumerating the first set of links */ assert(trace->nodec > 0); tp->probe->flowid = state->flowid_next++; tp->probe->ttl = trace->firsthop + 1; tp->probe->attempt = 0; } else if(branch->mode == MODE_HOPPROBE || branch->mode == MODE_CLUMP) { /* * call a function that can deal with the possibly complex details of * selecting a flowid/ttl to probe with */ if(tracelb_probe_vals(task, branch, tp) < 0) goto err; } else if(branch->mode == MODE_PERPACKET) { assert(branch->newnodec > 1); tp->probe->flowid = branch->newnodes[0]->probe->flowid; tp->probe->ttl = branch->newnodes[0]->probe->ttl; tp->probe->attempt = 0; } memset(&probe, 0, sizeof(probe)); probe.pr_ip_src = trace->src; probe.pr_ip_dst = trace->dst; probe.pr_ip_tos = trace->tos; probe.pr_data = pktbuf; probe.pr_len = state->payload_size; probe.pr_ip_ttl = tp->probe->ttl; if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) probe.pr_ip_off = IP_DF; /* reset the payload of the packet */ memset(probe.pr_data, 0, probe.pr_len); if(SCAMPER_TRACELB_TYPE_IS_UDP(trace)) { probe.pr_ip_proto = IPPROTO_UDP; probe.pr_ip_id = state->id_next + 1; if(trace->type == SCAMPER_TRACELB_TYPE_UDP_DPORT) { probe.pr_fd = scamper_fd_fd_get(state->probe); probe.pr_udp_sport = trace->sport; probe.pr_udp_dport = tp->probe->flowid; } else { probe.pr_udp_dport = trace->dport; probe.pr_udp_sport = tp->probe->flowid; } /* * fudge it so the probe id goes into the checksum field. * the probe id also goes in the IP-ID field to guard against FreeBSD * systems that munge the checksum on rx when checking the packet. */ u16 = htons(state->id_next + 1); memcpy(probe.pr_data, &u16, 2); if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) { probe.pr_ip_id = state->id_next + 1; u16 = scamper_udp4_cksum(&probe); } else { u16 = scamper_udp6_cksum(&probe); } memcpy(probe.pr_data, &u16, 2); } else if(SCAMPER_TRACELB_TYPE_IS_ICMP(trace)) { probe.pr_fd = scamper_fd_fd_get(state->probe); SCAMPER_PROBE_ICMP_ECHO(&probe, trace->sport, state->id_next); /* this is the flow-id to use -- the ICMP checksum */ u16 = htons(tp->probe->flowid); probe.pr_icmp_sum = u16; /* fudge the checksum field so it is used as the flow id */ memcpy(probe.pr_data, &u16, 2); if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) u16 = scamper_icmp4_cksum(&probe); else u16 = scamper_icmp6_cksum(&probe); memcpy(probe.pr_data, &u16, 2); } else { assert(SCAMPER_TRACELB_TYPE_IS_TCP(trace)); probe.pr_ip_proto = IPPROTO_TCP; probe.pr_tcp_dport = trace->dport; probe.pr_tcp_sport = tp->probe->flowid; probe.pr_tcp_seq = 0; probe.pr_tcp_ack = 0; probe.pr_tcp_win = 0; probe.pr_ip_id = state->id_next + 1; if(trace->type == SCAMPER_TRACELB_TYPE_TCP_SPORT) probe.pr_tcp_flags = TH_SYN; else probe.pr_tcp_flags = TH_ACK; } if(SCAMPER_TRACELB_TYPE_VARY_SPORT(trace)) { probe.pr_dl = scamper_fd_dl_get(state->dl); probe.pr_dl_buf = state->dlhdr->buf; probe.pr_dl_len = state->dlhdr->len; } if(scamper_probe(&probe) == -1) { errno = probe.pr_errno; goto err; } /* another probe sent */ trace->probec++; /* make a note that the probe was sent */ timeval_cpy(&tp->probe->tx, &probe.pr_tx); /* record the probe in state */ if(tracelb_probe_add(state, branch, tp) != 0) goto err; /* figure out when the next probe may be sent */ timeval_add_cs(&state->next_tx, &probe.pr_tx, trace->wait_probe); /* * put the branch back in the heap structure, but with appropriate * timestamps */ timeval_cpy(&branch->last_tx, &probe.pr_tx); branch->next_tx.tv_sec = probe.pr_tx.tv_sec + trace->wait_timeout; branch->next_tx.tv_usec = probe.pr_tx.tv_usec; if(tracelb_branch_active(state, branch) != 0) goto err; tracelb_queue(task); return; err: if(tp != NULL) free(tp); tracelb_handleerror(task, errno); return; } static int tracelb_arg_param_validate(int optid, char *param, long *out) { long tmp; switch(optid) { case TRACE_OPT_CONFIDENCE: if(string_tolong(param, &tmp) != 0 || (tmp != 95 && tmp != 99)) { goto err; } break; case TRACE_OPT_SPORT: case TRACE_OPT_DPORT: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_TRACELB_PORT_MIN || tmp > SCAMPER_DO_TRACELB_PORT_MAX) { goto err; } break; case TRACE_OPT_FIRSTHOP: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_TRACELB_FIRSTHOP_MIN || tmp > SCAMPER_DO_TRACELB_FIRSTHOP_MAX) { goto err; } break; case TRACE_OPT_GAPLIMIT: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_TRACELB_GAPLIMIT_MIN || tmp > SCAMPER_DO_TRACELB_GAPLIMIT_MAX) { goto err; } break; case TRACE_OPT_PROTOCOL: if(strcasecmp(param, "udp-dport") == 0) tmp = SCAMPER_TRACELB_TYPE_UDP_DPORT; else if(strcasecmp(param, "icmp-echo") == 0) tmp = SCAMPER_TRACELB_TYPE_ICMP_ECHO; else if(strcasecmp(param, "udp-sport") == 0) tmp = SCAMPER_TRACELB_TYPE_UDP_SPORT; else if(strcasecmp(param, "tcp-sport") == 0) tmp = SCAMPER_TRACELB_TYPE_TCP_SPORT; else if(strcasecmp(param, "tcp-ack-sport") == 0) tmp = SCAMPER_TRACELB_TYPE_TCP_ACK_SPORT; else goto err; break; case TRACE_OPT_TOS: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_TRACELB_TOS_MIN || tmp > SCAMPER_DO_TRACELB_TOS_MAX) { goto err; } break; case TRACE_OPT_ATTEMPTS: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_TRACELB_ATTEMPTS_MIN || tmp > SCAMPER_DO_TRACELB_ATTEMPTS_MAX) { goto err; } break; case TRACE_OPT_PROBECMAX: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_TRACELB_PROBECMAX_MIN || tmp > SCAMPER_DO_TRACELB_PROBECMAX_MAX) { goto err; } break; case TRACE_OPT_USERID: if(string_tolong(param, &tmp) != 0 || tmp < 0) { goto err; } break; case TRACE_OPT_WAITPROBE: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_TRACELB_WAITPROBE_MIN || tmp > SCAMPER_DO_TRACELB_WAITPROBE_MAX) { goto err; } break; case TRACE_OPT_WAITTIMEOUT: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_TRACELB_WAITTIMEOUT_MIN || tmp > SCAMPER_DO_TRACELB_WAITTIMEOUT_MAX) { goto err; } break; default: return -1; } /* valid parameter */ if(out != NULL) *out = tmp; return 0; err: return -1; } /* * scamper_do_tracelb_alloc * * given a string representing a traceroute task, parse the parameters and * assemble a trace. return the trace structure so that it is all ready to * go. */ void *scamper_do_tracelb_alloc(char *str) { scamper_option_out_t *opts_out = NULL, *opt; scamper_tracelb_t *trace = NULL; uint8_t type = SCAMPER_TRACELB_TYPE_UDP_DPORT; uint16_t sport = scamper_sport_default(); uint8_t confidence = 95; uint16_t dport = SCAMPER_DO_TRACELB_DPORT_DEF; uint8_t attempts = SCAMPER_DO_TRACELB_ATTEMPTS_DEF; uint8_t firsthop = SCAMPER_DO_TRACELB_FIRSTHOP_DEF; uint8_t wait_timeout = SCAMPER_DO_TRACELB_WAITTIMEOUT_DEF; uint8_t wait_probe = SCAMPER_DO_TRACELB_WAITPROBE_DEF; uint8_t tos = SCAMPER_DO_TRACELB_TOS_DEF; uint32_t probec_max = SCAMPER_DO_TRACELB_PROBECMAX_DEF; uint8_t gaplimit = SCAMPER_DO_TRACELB_GAPLIMIT_DEF; uint32_t userid = 0; char *addr; long tmp = 0; /* try and parse the string passed in */ if(scamper_options_parse(str, opts, opts_cnt, &opts_out, &addr) != 0) { goto err; } /* if there is no IP address after the options string, then stop now */ if(addr == NULL) { goto err; } for(opt = opts_out; opt != NULL; opt = opt->next) { if(opt->type != SCAMPER_OPTION_TYPE_NULL && tracelb_arg_param_validate(opt->id, opt->str, &tmp) != 0) { scamper_debug(__func__, "validation of optid %d failed", opt->id); goto err; } switch(opt->id) { case TRACE_OPT_CONFIDENCE: confidence = (uint8_t)tmp; break; case TRACE_OPT_DPORT: dport = (uint16_t)tmp; break; case TRACE_OPT_FIRSTHOP: firsthop = (uint8_t)tmp; break; case TRACE_OPT_GAPLIMIT: gaplimit = (uint8_t)tmp; break; case TRACE_OPT_PROTOCOL: type = (uint8_t)tmp; break; case TRACE_OPT_TOS: tos = (uint8_t)tmp; break; case TRACE_OPT_ATTEMPTS: attempts = (uint8_t)tmp; break; case TRACE_OPT_PROBECMAX: probec_max = (uint32_t)tmp; break; case TRACE_OPT_USERID: userid = (uint32_t)tmp; break; case TRACE_OPT_WAITPROBE: wait_probe = (uint8_t)tmp; break; case TRACE_OPT_WAITTIMEOUT: wait_timeout = (uint8_t)tmp; break; } } scamper_options_free(opts_out); opts_out = NULL; if((trace = scamper_tracelb_alloc()) == NULL) { goto err; } if((trace->dst = scamper_addr_resolve(AF_UNSPEC, addr)) == NULL) { goto err; } if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV6 && SCAMPER_TRACELB_TYPE_IS_TCP(trace)) { goto err; } trace->sport = sport; trace->dport = dport; trace->tos = tos; trace->firsthop = firsthop; trace->wait_timeout = wait_timeout; trace->wait_probe = wait_probe; trace->attempts = attempts; trace->confidence = confidence; trace->type = type; trace->probec_max = probec_max; trace->gaplimit = gaplimit; trace->userid = userid; switch(trace->dst->type) { case SCAMPER_ADDR_TYPE_IPV4: if(SCAMPER_TRACELB_TYPE_IS_TCP(trace)) trace->probe_size = 40; else trace->probe_size = 44; break; case SCAMPER_ADDR_TYPE_IPV6: trace->probe_size = 60; break; default: goto err; } return trace; err: if(trace != NULL) scamper_tracelb_free(trace); if(opts_out != NULL) scamper_options_free(opts_out); return NULL; } scamper_task_t *scamper_do_tracelb_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle) { scamper_tracelb_t *trace = (scamper_tracelb_t *)data; scamper_task_sig_t *sig = NULL; scamper_task_t *task = NULL; /* allocate a task structure and store the trace with it */ if((task = scamper_task_alloc(trace, &funcs)) == NULL) goto err; /* declare the signature of the task */ if((sig = scamper_task_sig_alloc(SCAMPER_TASK_SIG_TYPE_TX_IP)) == NULL) goto err; sig->sig_tx_ip_dst = scamper_addr_use(trace->dst); if(trace->src == NULL && (trace->src = scamper_getsrc(trace->dst,0)) == NULL) goto err; sig->sig_tx_ip_src = scamper_addr_use(trace->src); if(scamper_task_sig_add(task, sig) != 0) goto err; sig = NULL; /* associate the list and cycle with the trace */ trace->list = scamper_list_use(list); trace->cycle = scamper_cycle_use(cycle); return task; err: if(sig != NULL) scamper_task_sig_free(sig); if(task != NULL) { scamper_task_setdatanull(task); scamper_task_free(task); } return NULL; } /* * scamper_do_tracelb_arg_validate * * */ int scamper_do_tracelb_arg_validate(int argc, char *argv[], int *stop) { return scamper_options_validate(opts, opts_cnt, argc, argv, stop, tracelb_arg_param_validate); } void scamper_do_tracelb_free(void *data) { scamper_tracelb_free((scamper_tracelb_t *)data); return; } void scamper_do_tracelb_cleanup(void) { if(pktbuf != NULL) { free(pktbuf); pktbuf = NULL; } return; } int scamper_do_tracelb_init(void) { funcs.probe = do_tracelb_probe; funcs.handle_icmp = do_tracelb_handle_icmp; funcs.handle_dl = do_tracelb_handle_dl; funcs.handle_timeout = do_tracelb_handle_timeout; funcs.write = do_tracelb_write; funcs.task_free = do_tracelb_free; funcs.halt = do_tracelb_halt; return 0; } scamper-cvs-20171204/scamper/tracelb/scamper_tracelb_do.h000644 001751 000000 00000003003 11737356726 023157 0ustar00mjlwheel000000 000000 /* * scamper_do_tracelb.h * * $Id: scamper_tracelb_do.h,v 1.9 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2008-2010 The University of Waikato * Author: Matthew Luckie * * Load-balancer traceroute technique authored by * Ben Augustin, Timur Friedman, Renata Teixeira; "Measuring Load-balanced * Paths in the Internet", in Proc. Internet Measurement Conference 2007. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DO_TRACELB_H #define __SCAMPER_DO_TRACELB_H void *scamper_do_tracelb_alloc(char *str); scamper_task_t *scamper_do_tracelb_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle); int scamper_do_tracelb_arg_validate(int argc, char *argv[], int *stop); void scamper_do_tracelb_free(void *); const char *scamper_do_tracelb_usage(void); void scamper_do_tracelb_cleanup(void); int scamper_do_tracelb_init(void); #endif /*__SCAMPER_DO_TRACELB_H */ scamper-cvs-20171204/scamper/tracelb/scamper_tracelb_text.c000644 001751 000000 00000011735 11734723110 023525 0ustar00mjlwheel000000 000000 /* * scamper_tracelb_text.c * * Copyright (C) 2008-2011 The University of Waikato * Copyright (C) 2012 The Regents of the University of California * Author: Matthew Luckie * * $Id: scamper_tracelb_text.c,v 1.4 2012/03/29 00:01:12 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_tracelb_text.c,v 1.4 2012/03/29 00:01:12 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_tracelb.h" #include "scamper_file.h" #include "scamper_tracelb_text.h" #include "utils.h" typedef struct probeset_summary { scamper_addr_t **addrs; int addrc; int nullc; } probeset_summary_t; static probeset_summary_t *probeset_summary(scamper_tracelb_probeset_t *set) { scamper_tracelb_probe_t *probe; scamper_addr_t *addr; probeset_summary_t *sum; uint16_t flowid, j; int i, x; if((sum = malloc_zero(sizeof(probeset_summary_t))) == NULL) { return NULL; } if(set->probec == 0) return sum; flowid = set->probes[0]->flowid; x = 0; for(i=0; i<=set->probec; i++) { if(i == set->probec) { if(x == 0) sum->nullc++; break; } probe = set->probes[i]; if(probe->flowid != flowid) { /* * if a unique flowid had no response (even with multiple * attempts) then make a note of that. */ if(x == 0) sum->nullc++; flowid = probe->flowid; x = 0; } if(probe->rxc > 0) { for(j=0; jrxc; j++) { addr = probe->rxs[j]->reply_from; if(array_find((void **)sum->addrs, sum->addrc, addr, (array_cmp_t)scamper_addr_cmp) != NULL) continue; array_insert((void ***)&sum->addrs, &sum->addrc, addr, (array_cmp_t)scamper_addr_cmp); } x++; } } return sum; } static void probeset_summary_tostr(probeset_summary_t *sum, char *buf, size_t len, size_t *off) { char dst[64]; int k; if(sum->nullc > 0 && sum->addrc == 0) { string_concat(buf, len, off, "*"); return; } scamper_addr_tostr(sum->addrs[0], dst, sizeof(dst)); string_concat(buf, len, off, "(%s", dst); for(k=1; kaddrc; k++) { scamper_addr_tostr(sum->addrs[k], dst, sizeof(dst)); string_concat(buf, len, off, ", %s", dst); } if(sum->nullc > 0) string_concat(buf, len, off, ", *)"); else string_concat(buf, len, off, ")"); return; } int scamper_file_text_tracelb_write(const scamper_file_t *sf, const scamper_tracelb_t *trace) { const scamper_tracelb_node_t *node; scamper_tracelb_link_t *link; probeset_summary_t *sum; size_t len; size_t off; char buf[1024], src[64], dst[64]; int fd = scamper_file_getfd(sf); int i, j; snprintf(buf, sizeof(buf), "tracelb from %s to %s, %d nodes, %d links, %d probes, %d%%\n", scamper_addr_tostr(trace->src, src, sizeof(src)), scamper_addr_tostr(trace->dst, dst, sizeof(dst)), trace->nodec, trace->linkc, trace->probec, trace->confidence); len = strlen(buf); write_wrap(fd, buf, NULL, len); for(i=0; inodec; i++) { node = trace->nodes[i]; if(node->addr != NULL) scamper_addr_tostr(node->addr, src, sizeof(src)); else snprintf(src, sizeof(src), "*"); if(node->linkc > 1) { for(j=0; jlinkc; j++) { scamper_addr_tostr(node->links[j]->to->addr, dst, sizeof(dst)); snprintf(buf, sizeof(buf), "%s -> %s\n", src, dst); len = strlen(buf); write_wrap(fd, buf, NULL, len); } } else if(node->linkc == 1) { link = node->links[0]; len = sizeof(buf); off = 0; string_concat(buf, len, &off, "%s -> ", src); for(j=0; jhopc-1; j++) { sum = probeset_summary(link->sets[j]); probeset_summary_tostr(sum, buf, len, &off); string_concat(buf, len, &off, " -> "); if(sum->addrs != NULL) free(sum->addrs); free(sum); } if(link->to != NULL) { scamper_addr_tostr(link->to->addr, dst, sizeof(dst)); string_concat(buf, len, &off, "%s", dst); } else { sum = probeset_summary(link->sets[link->hopc-1]); probeset_summary_tostr(sum, buf, len, &off); if(sum->addrs != NULL) free(sum->addrs); free(sum); } string_concat(buf, len, &off, "\n"); write_wrap(fd, buf, NULL, off); } } return 0; } scamper-cvs-20171204/scamper/tracelb/scamper_tracelb_text.h000644 001751 000000 00000002030 11452510530 023513 0ustar00mjlwheel000000 000000 /* * scamper_tracelb_text.h * Copyright (C) 2008-2010 The University of Waikato * Author: Matthew Luckie * * $Id: scamper_tracelb_text.h,v 1.1 2010/10/05 02:45:44 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_TRACELB_TEXT_H #define __SCAMPER_TRACELB_TEXT_H int scamper_file_text_tracelb_write(const scamper_file_t *sf, const scamper_tracelb_t *trace); #endif /* __SCAMPER_TRACELB_TEXT_H */ scamper-cvs-20171204/scamper/tracelb/scamper_tracelb_warts.c000644 001751 000000 00000110435 13022467213 023677 0ustar00mjlwheel000000 000000 /* * scamper_tracelb_warts.c * * Copyright (C) 2008-2011 The University of Waikato * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * $Id: scamper_tracelb_warts.c,v 1.7 2016/12/09 08:42:51 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_tracelb_warts.c,v 1.7 2016/12/09 08:42:51 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_tracelb.h" #include "scamper_file.h" #include "scamper_file_warts.h" #include "scamper_tracelb_warts.h" #include "mjl_splaytree.h" #include "utils.h" /* * the optional bits of a tracelb structure */ #define WARTS_TRACELB_LIST_ID 1 /* list id assigned by warts */ #define WARTS_TRACELB_CYCLE_ID 2 /* cycle id assigned by warts */ #define WARTS_TRACELB_ADDR_SRC_GID 3 /* src address key, deprecated */ #define WARTS_TRACELB_ADDR_DST_GID 4 /* dst address key, deprecated */ #define WARTS_TRACELB_START 5 /* start timestamp */ #define WARTS_TRACELB_SPORT 6 /* source port */ #define WARTS_TRACELB_DPORT 7 /* destination port */ #define WARTS_TRACELB_PROBE_SIZE 8 /* probe size */ #define WARTS_TRACELB_TYPE 9 /* type */ #define WARTS_TRACELB_FIRSTHOP 10 /* first hop */ #define WARTS_TRACELB_WAIT_TIMEOUT 11 /* wait before probe timeout */ #define WARTS_TRACELB_WAIT_PROBE 12 /* minimum wait between probes */ #define WARTS_TRACELB_ATTEMPTS 13 /* attempts */ #define WARTS_TRACELB_CONFIDENCE 14 /* confidence level to attain */ #define WARTS_TRACELB_TOS 15 /* type of service bits */ #define WARTS_TRACELB_NODEC 16 /* the number of nodes found */ #define WARTS_TRACELB_LINKC 17 /* the number of links found */ #define WARTS_TRACELB_PROBEC 18 /* number of probes sent */ #define WARTS_TRACELB_PROBECMAX 19 /* max number of probes to send */ #define WARTS_TRACELB_GAPLIMIT 20 /* gaplimit */ #define WARTS_TRACELB_ADDR_SRC 21 /* src address */ #define WARTS_TRACELB_ADDR_DST 22 /* dst address */ #define WARTS_TRACELB_USERID 23 /* user id */ static const warts_var_t tracelb_vars[] = { {WARTS_TRACELB_LIST_ID, 4, -1}, {WARTS_TRACELB_CYCLE_ID, 4, -1}, {WARTS_TRACELB_ADDR_SRC_GID, 4, -1}, {WARTS_TRACELB_ADDR_DST_GID, 4, -1}, {WARTS_TRACELB_START, 8, -1}, {WARTS_TRACELB_SPORT, 2, -1}, {WARTS_TRACELB_DPORT, 2, -1}, {WARTS_TRACELB_PROBE_SIZE, 2, -1}, {WARTS_TRACELB_TYPE, 1, -1}, {WARTS_TRACELB_FIRSTHOP, 1, -1}, {WARTS_TRACELB_WAIT_TIMEOUT, 1, -1}, {WARTS_TRACELB_WAIT_PROBE, 1, -1}, {WARTS_TRACELB_ATTEMPTS, 1, -1}, {WARTS_TRACELB_CONFIDENCE, 1, -1}, {WARTS_TRACELB_TOS, 1, -1}, {WARTS_TRACELB_NODEC, 2, -1}, {WARTS_TRACELB_LINKC, 2, -1}, {WARTS_TRACELB_PROBEC, 4, -1}, {WARTS_TRACELB_PROBECMAX, 4, -1}, {WARTS_TRACELB_GAPLIMIT, 1, -1}, {WARTS_TRACELB_ADDR_SRC, -1, -1}, {WARTS_TRACELB_ADDR_DST, -1, -1}, {WARTS_TRACELB_USERID, 4, -1}, }; #define tracelb_vars_mfb WARTS_VAR_MFB(tracelb_vars) #define WARTS_TRACELB_NODE_ADDR_GID 1 #define WARTS_TRACELB_NODE_FLAGS 2 #define WARTS_TRACELB_NODE_LINKC 3 #define WARTS_TRACELB_NODE_QTTL 4 #define WARTS_TRACELB_NODE_ADDR 5 static const warts_var_t tracelb_node_vars[] = { {WARTS_TRACELB_NODE_ADDR_GID, 4, -1}, /* deprecated */ {WARTS_TRACELB_NODE_FLAGS, 1, -1}, {WARTS_TRACELB_NODE_LINKC, 2, -1}, {WARTS_TRACELB_NODE_QTTL, 1, -1}, {WARTS_TRACELB_NODE_ADDR, -1, -1}, }; #define tracelb_node_vars_mfb WARTS_VAR_MFB(tracelb_node_vars) #define WARTS_TRACELB_LINK_FROM 1 #define WARTS_TRACELB_LINK_TO 2 #define WARTS_TRACELB_LINK_HOPC 3 static const warts_var_t tracelb_link_vars[] = { {WARTS_TRACELB_LINK_FROM, 2, -1}, {WARTS_TRACELB_LINK_TO, 2, -1}, {WARTS_TRACELB_LINK_HOPC, 1, -1}, }; #define tracelb_link_vars_mfb WARTS_VAR_MFB(tracelb_link_vars) #define WARTS_TRACELB_PROBE_TX 1 #define WARTS_TRACELB_PROBE_FLOWID 2 #define WARTS_TRACELB_PROBE_TTL 3 #define WARTS_TRACELB_PROBE_ATTEMPT 4 #define WARTS_TRACELB_PROBE_RXC 5 static const warts_var_t tracelb_probe_vars[] = { {WARTS_TRACELB_PROBE_TX, 8, -1}, {WARTS_TRACELB_PROBE_FLOWID, 2, -1}, {WARTS_TRACELB_PROBE_TTL, 1, -1}, {WARTS_TRACELB_PROBE_ATTEMPT, 1, -1}, {WARTS_TRACELB_PROBE_RXC, 2, -1}, }; #define tracelb_probe_vars_mfb WARTS_VAR_MFB(tracelb_probe_vars) #define WARTS_TRACELB_REPLY_RX 1 #define WARTS_TRACELB_REPLY_IPID 2 #define WARTS_TRACELB_REPLY_TTL 3 #define WARTS_TRACELB_REPLY_FLAGS 4 #define WARTS_TRACELB_REPLY_ICMP_TC 5 #define WARTS_TRACELB_REPLY_TCP_FLAGS 6 #define WARTS_TRACELB_REPLY_ICMP_EXT 7 #define WARTS_TRACELB_REPLY_ICMP_Q_TTL 8 #define WARTS_TRACELB_REPLY_ICMP_Q_TOS 9 #define WARTS_TRACELB_REPLY_FROM_GID 10 /* deprecated */ #define WARTS_TRACELB_REPLY_FROM 11 static const warts_var_t tracelb_reply_vars[] = { {WARTS_TRACELB_REPLY_RX, 8, -1}, {WARTS_TRACELB_REPLY_IPID, 2, -1}, {WARTS_TRACELB_REPLY_TTL, 1, -1}, {WARTS_TRACELB_REPLY_FLAGS, 1, -1}, {WARTS_TRACELB_REPLY_ICMP_TC, 2, -1}, {WARTS_TRACELB_REPLY_TCP_FLAGS, 1, -1}, {WARTS_TRACELB_REPLY_ICMP_EXT, -1, -1}, {WARTS_TRACELB_REPLY_ICMP_Q_TTL, 1, -1}, {WARTS_TRACELB_REPLY_ICMP_Q_TOS, 1, -1}, {WARTS_TRACELB_REPLY_FROM_GID, 4, -1}, {WARTS_TRACELB_REPLY_FROM, -1, -1}, }; #define tracelb_reply_vars_mfb WARTS_VAR_MFB(tracelb_reply_vars) #define WARTS_TRACELB_PROBESET_PROBEC 1 static const warts_var_t tracelb_probeset_vars[] = { {WARTS_TRACELB_PROBESET_PROBEC, 2, -1}, }; #define tracelb_probeset_vars_mfb WARTS_VAR_MFB(tracelb_probeset_vars) typedef struct warts_tracelb_node { uint8_t flags[WARTS_VAR_MFB(tracelb_node_vars)]; uint16_t flags_len; uint16_t params_len; } warts_tracelb_node_t; typedef struct warts_tracelb_reply { uint8_t flags[WARTS_VAR_MFB(tracelb_reply_vars)]; uint16_t flags_len; uint16_t params_len; } warts_tracelb_reply_t; typedef struct warts_tracelb_probe { uint8_t flags[WARTS_VAR_MFB(tracelb_probe_vars)]; uint16_t flags_len; uint16_t params_len; warts_tracelb_reply_t *replies; } warts_tracelb_probe_t; typedef struct warts_tracelb_probeset { uint8_t flags[WARTS_VAR_MFB(tracelb_probeset_vars)]; uint16_t flags_len; uint16_t params_len; warts_tracelb_probe_t *probes; uint16_t probec; } warts_tracelb_probeset_t; typedef struct warts_tracelb_link { uint16_t from; uint16_t to; uint8_t flags[WARTS_VAR_MFB(tracelb_link_vars)]; uint16_t flags_len; uint16_t params_len; warts_tracelb_probeset_t *sets; uint8_t hopc; } warts_tracelb_link_t; static void warts_tracelb_params(const scamper_tracelb_t *trace, warts_addrtable_t *table, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { int i, max_id = 0; const warts_var_t *var; /* unset all the flags possible */ memset(flags, 0, tracelb_vars_mfb); *params_len = 0; /* for now, we include the base data items */ for(i=0; iid == WARTS_TRACELB_ADDR_SRC_GID || var->id == WARTS_TRACELB_ADDR_DST_GID) { continue; } if(var->id == WARTS_TRACELB_USERID) { if(trace->userid == 0) continue; } flag_set(flags, var->id, &max_id); if(var->id == WARTS_TRACELB_ADDR_SRC) { *params_len += warts_addr_size(table, trace->src); continue; } else if(var->id == WARTS_TRACELB_ADDR_DST) { *params_len += warts_addr_size(table, trace->dst); continue; } assert(var->size >= 0); *params_len += var->size; } *flags_len = fold_flags(flags, max_id); return; } static int warts_tracelb_params_read(scamper_tracelb_t *trace, warts_state_t *state, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&trace->list, (wpr_t)extract_list, state}, {&trace->cycle, (wpr_t)extract_cycle, state}, {&trace->src, (wpr_t)extract_addr_gid, state}, {&trace->dst, (wpr_t)extract_addr_gid, state}, {&trace->start, (wpr_t)extract_timeval, NULL}, {&trace->sport, (wpr_t)extract_uint16, NULL}, {&trace->dport, (wpr_t)extract_uint16, NULL}, {&trace->probe_size, (wpr_t)extract_uint16, NULL}, {&trace->type, (wpr_t)extract_byte, NULL}, {&trace->firsthop, (wpr_t)extract_byte, NULL}, {&trace->wait_timeout, (wpr_t)extract_byte, NULL}, {&trace->wait_probe, (wpr_t)extract_byte, NULL}, {&trace->attempts, (wpr_t)extract_byte, NULL}, {&trace->confidence, (wpr_t)extract_byte, NULL}, {&trace->tos, (wpr_t)extract_byte, NULL}, {&trace->nodec, (wpr_t)extract_uint16, NULL}, {&trace->linkc, (wpr_t)extract_uint16, NULL}, {&trace->probec, (wpr_t)extract_uint32, NULL}, {&trace->probec_max, (wpr_t)extract_uint32, NULL}, {&trace->gaplimit, (wpr_t)extract_byte, NULL}, {&trace->src, (wpr_t)extract_addr, table}, {&trace->dst, (wpr_t)extract_addr, table}, {&trace->userid, (wpr_t)extract_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); int rc; if((rc = warts_params_read(buf, off, len, handlers, handler_cnt)) != 0) return rc; if(trace->src == NULL || trace->dst == NULL) return -1; return 0; } static int warts_tracelb_params_write(const scamper_tracelb_t *trace, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len) { uint32_t list_id, cycle_id; warts_param_writer_t handlers[] = { {&list_id, (wpw_t)insert_uint32, NULL}, {&cycle_id, (wpw_t)insert_uint32, NULL}, {NULL, NULL, NULL}, {NULL, NULL, NULL}, {&trace->start, (wpw_t)insert_timeval, NULL}, {&trace->sport, (wpw_t)insert_uint16, NULL}, {&trace->dport, (wpw_t)insert_uint16, NULL}, {&trace->probe_size, (wpw_t)insert_uint16, NULL}, {&trace->type, (wpw_t)insert_byte, NULL}, {&trace->firsthop, (wpw_t)insert_byte, NULL}, {&trace->wait_timeout, (wpw_t)insert_byte, NULL}, {&trace->wait_probe, (wpw_t)insert_byte, NULL}, {&trace->attempts, (wpw_t)insert_byte, NULL}, {&trace->confidence, (wpw_t)insert_byte, NULL}, {&trace->tos, (wpw_t)insert_byte, NULL}, {&trace->nodec, (wpw_t)insert_uint16, NULL}, {&trace->linkc, (wpw_t)insert_uint16, NULL}, {&trace->probec, (wpw_t)insert_uint32, NULL}, {&trace->probec_max, (wpw_t)insert_uint32, NULL}, {&trace->gaplimit, (wpw_t)insert_byte, NULL}, {trace->src, (wpw_t)insert_addr, table}, {trace->dst, (wpw_t)insert_addr, table}, {&trace->userid, (wpw_t)insert_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); if(warts_list_getid(sf, trace->list, &list_id) == -1) return -1; if(warts_cycle_getid(sf, trace->cycle, &cycle_id) == -1) return -1; warts_params_write(buf, off, len, flags, flags_len, params_len, handlers, handler_cnt); return 0; } static int warts_tracelb_node_state(const scamper_file_t *sf, const scamper_tracelb_node_t *node, warts_addrtable_t *table, warts_tracelb_node_t *state, uint32_t *len) { const warts_var_t *var; int i, max_id = 0; /* unset all the flags possible */ memset(state->flags, 0, tracelb_node_vars_mfb); state->params_len = 0; /* for now, we include the base data items */ for(i=0; iid == WARTS_TRACELB_NODE_ADDR_GID) { continue; } else if(var->id == WARTS_TRACELB_NODE_QTTL) { /* don't include the qttl field if it isn't used */ if(SCAMPER_TRACELB_NODE_QTTL(node) == 0) continue; } if(var->id == WARTS_TRACELB_NODE_ADDR) { if(node->addr != NULL) { flag_set(state->flags, var->id, &max_id); state->params_len += warts_addr_size(table, node->addr); } continue; } assert(var->size >= 0); flag_set(state->flags, var->id, &max_id); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_tracelb_node_read(scamper_tracelb_node_t *node, warts_state_t *state, warts_addrtable_t *table,const uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&node->addr, (wpr_t)extract_addr_gid, state}, {&node->flags, (wpr_t)extract_byte, NULL}, {&node->linkc, (wpr_t)extract_uint16, NULL}, {&node->q_ttl, (wpr_t)extract_byte, NULL}, {&node->addr, (wpr_t)extract_addr, table}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; if(node->addr == NULL) return -1; return 0; } static void warts_tracelb_node_write(const scamper_tracelb_node_t *node, const warts_tracelb_node_t *state, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_writer_t handlers[] = { {NULL, NULL, NULL}, {&node->flags, (wpw_t)insert_byte, NULL}, {&node->linkc, (wpw_t)insert_uint16, NULL}, {&node->q_ttl, (wpw_t)insert_byte, NULL}, {node->addr, (wpw_t)insert_addr, table}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static int extract_tracelb_reply_icmp_tc(const uint8_t *buf, uint32_t *off, uint32_t len, scamper_tracelb_reply_t *reply, void *param) { if(*off >= len || len - *off < 2) return -1; reply->reply_icmp_type = buf[(*off)++]; reply->reply_icmp_code = buf[(*off)++]; return 0; } static void insert_tracelb_reply_icmp_tc(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_tracelb_reply_t *reply, void *param) { assert(len - *off >= 2); buf[(*off)++] = reply->reply_icmp_type; buf[(*off)++] = reply->reply_icmp_code; return; } static int extract_tracelb_reply_icmp_ext(const uint8_t *buf, uint32_t *off, uint32_t len, scamper_tracelb_reply_t *reply, void *param) { return warts_icmpext_read(buf, off, len, &reply->reply_icmp_ext); } static void insert_tracelb_reply_icmp_ext(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_tracelb_reply_t *reply, void *param) { warts_icmpext_write(buf, off, len, reply->reply_icmp_ext); return; } static int warts_tracelb_reply_state(const scamper_file_t *sf, const scamper_tracelb_reply_t *reply, warts_tracelb_reply_t *state, warts_addrtable_t *table, uint32_t *len) { const warts_var_t *var; scamper_icmpext_t *ie; int i, max_id = 0; /* unset all the flags possible */ memset(state->flags, 0, tracelb_reply_vars_mfb); state->params_len = 0; /* figure out what to include */ for(i=0; iid == WARTS_TRACELB_REPLY_FROM_GID) { continue; } else if(var->id == WARTS_TRACELB_REPLY_TTL) { if((reply->reply_flags & SCAMPER_TRACELB_REPLY_FLAG_REPLY_TTL) == 0) continue; } else if(var->id == WARTS_TRACELB_REPLY_ICMP_TC || var->id == WARTS_TRACELB_REPLY_ICMP_Q_TTL || var->id == WARTS_TRACELB_REPLY_ICMP_Q_TOS) { if((reply->reply_flags & SCAMPER_TRACELB_REPLY_FLAG_TCP) != 0) continue; } else if(var->id == WARTS_TRACELB_REPLY_TCP_FLAGS) { if((reply->reply_flags & SCAMPER_TRACELB_REPLY_FLAG_TCP) == 0) continue; } else if(var->id == WARTS_TRACELB_REPLY_ICMP_EXT) { if((reply->reply_flags & SCAMPER_TRACELB_REPLY_FLAG_TCP) != 0 || reply->reply_icmp_ext == NULL) continue; state->params_len += 2; for(ie = reply->reply_icmp_ext; ie != NULL; ie = ie->ie_next) { state->params_len += (2 + 1 + 1 + ie->ie_dl); } } else if(var->id == WARTS_TRACELB_REPLY_FROM) { state->params_len += warts_addr_size(table, reply->reply_from); } flag_set(state->flags, var->id, &max_id); if(var->size > 0) { state->params_len += var->size; } } state->flags_len = fold_flags(state->flags, max_id); *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_tracelb_reply_read(scamper_tracelb_reply_t *reply, warts_state_t *state, warts_addrtable_t *table, const uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&reply->reply_rx, (wpr_t)extract_timeval, NULL}, {&reply->reply_ipid, (wpr_t)extract_uint16, NULL}, {&reply->reply_ttl, (wpr_t)extract_byte, NULL}, {&reply->reply_flags, (wpr_t)extract_byte, NULL}, {reply, (wpr_t)extract_tracelb_reply_icmp_tc, NULL}, {&reply->reply_tcp_flags, (wpr_t)extract_byte, NULL}, {reply, (wpr_t)extract_tracelb_reply_icmp_ext, NULL}, {&reply->reply_icmp_q_ttl, (wpr_t)extract_byte, NULL}, {&reply->reply_icmp_q_tos, (wpr_t)extract_byte, NULL}, {&reply->reply_from, (wpr_t)extract_addr_gid, state}, {&reply->reply_from, (wpr_t)extract_addr, table}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); return warts_params_read(buf, off, len, handlers, handler_cnt); } static void warts_tracelb_reply_write(const scamper_tracelb_reply_t *reply, const warts_tracelb_reply_t *state, warts_addrtable_t *table, uint8_t *buf,uint32_t *off,uint32_t len) { warts_param_writer_t handlers[] = { {&reply->reply_rx, (wpw_t)insert_timeval, NULL}, {&reply->reply_ipid, (wpw_t)insert_uint16, NULL}, {&reply->reply_ttl, (wpw_t)insert_byte, NULL}, {&reply->reply_flags, (wpw_t)insert_byte, NULL}, {reply, (wpw_t)insert_tracelb_reply_icmp_tc, NULL}, {&reply->reply_tcp_flags, (wpw_t)insert_byte, NULL}, {reply, (wpw_t)insert_tracelb_reply_icmp_ext, NULL}, {&reply->reply_icmp_q_ttl, (wpw_t)insert_byte, NULL}, {&reply->reply_icmp_q_tos, (wpw_t)insert_byte, NULL}, {NULL, NULL, NULL}, {reply->reply_from, (wpw_t)insert_addr, table}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static void warts_tracelb_probe_free(warts_tracelb_probe_t *state) { if(state->replies != NULL) { free(state->replies); state->replies = NULL; } return; } static int warts_tracelb_probe_state(const scamper_file_t *sf, const scamper_tracelb_probe_t *probe, warts_tracelb_probe_t *state, warts_addrtable_t *table, uint32_t *len) { const warts_var_t *var; int i, max_id = 0; size_t size; memset(state->flags, 0, tracelb_probe_vars_mfb); state->params_len = 0; for(i=0; iflags, var->id, &max_id); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; if(probe->rxc > 0) { size = sizeof(warts_tracelb_reply_t) * probe->rxc; if((state->replies = malloc_zero(size)) == NULL) { return -1; } for(i=0; irxc; i++) { if(warts_tracelb_reply_state(sf, probe->rxs[i], &state->replies[i], table, len) != 0) return -1; } } return 0; } static int warts_tracelb_probe_read(scamper_tracelb_probe_t *probe, warts_state_t *state, warts_addrtable_t *table, const uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&probe->tx, (wpr_t)extract_timeval, NULL}, {&probe->flowid, (wpr_t)extract_uint16, NULL}, {&probe->ttl, (wpr_t)extract_byte, NULL}, {&probe->attempt, (wpr_t)extract_byte, NULL}, {&probe->rxc, (wpr_t)extract_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); scamper_tracelb_reply_t *reply; uint16_t i; if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; if(probe->rxc > 0) { if(scamper_tracelb_probe_replies_alloc(probe, probe->rxc) != 0) return -1; for(i=0; irxc; i++) { if((reply = scamper_tracelb_reply_alloc(NULL)) == NULL) return -1; probe->rxs[i] = reply; if(warts_tracelb_reply_read(reply, state, table, buf, off, len) != 0) return -1; } } return 0; } static void warts_tracelb_probe_write(const scamper_tracelb_probe_t *probe, const warts_tracelb_probe_t *state, warts_addrtable_t *table, uint8_t *buf,uint32_t *off,uint32_t len) { warts_param_writer_t handlers[] = { {&probe->tx, (wpw_t)insert_timeval, NULL}, {&probe->flowid, (wpw_t)insert_uint16, NULL}, {&probe->ttl, (wpw_t)insert_byte, NULL}, {&probe->attempt, (wpw_t)insert_byte, NULL}, {&probe->rxc, (wpw_t)insert_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); uint16_t i; warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); for(i=0; irxc; i++) { warts_tracelb_reply_write(probe->rxs[i], &state->replies[i], table, buf, off, len); } return; } static void warts_tracelb_probeset_free(warts_tracelb_probeset_t *state) { uint16_t i; if(state->probes != NULL) { for(i=0; iprobec; i++) warts_tracelb_probe_free(&state->probes[i]); free(state->probes); state->probes = NULL; } return; } static int warts_tracelb_probeset_state(const scamper_file_t *sf, const scamper_tracelb_probeset_t *set, warts_tracelb_probeset_t *state, warts_addrtable_t *table, uint32_t *len) { const warts_var_t *var; int i, max_id = 0; size_t size; state->probec = set->probec; memset(state->flags, 0, tracelb_probeset_vars_mfb); state->params_len = 0; for(i=0; iflags, var->id, &max_id); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; if(set->probec > 0) { size = sizeof(warts_tracelb_probe_t) * set->probec; if((state->probes = malloc_zero(size)) == NULL) { return -1; } for(i=0; iprobec; i++) { if(warts_tracelb_probe_state(sf, set->probes[i], &state->probes[i], table, len) != 0) return -1; } } return 0; } static int warts_tracelb_probeset_read(scamper_tracelb_probeset_t *set, warts_state_t *state, warts_addrtable_t *table, const uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&set->probec, (wpr_t)extract_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); uint16_t i; if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; if(set->probec > 0) { if(scamper_tracelb_probeset_probes_alloc(set, set->probec) != 0) return -1; for(i=0; iprobec; i++) { if((set->probes[i] = scamper_tracelb_probe_alloc()) == NULL || warts_tracelb_probe_read(set->probes[i], state, table, buf, off, len) != 0) { return -1; } } } return 0; } static void warts_tracelb_probeset_write(const scamper_tracelb_probeset_t *set, const warts_tracelb_probeset_t *state, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_writer_t handlers[] = { {&set->probec, (wpw_t)insert_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); uint16_t i; warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); for(i=0; iprobec; i++) { warts_tracelb_probe_write(set->probes[i], &state->probes[i], table, buf, off, len); } return; } static void warts_tracelb_link_free(warts_tracelb_link_t *state) { uint8_t i; if(state->sets != NULL) { for(i=0; ihopc; i++) warts_tracelb_probeset_free(&state->sets[i]); free(state->sets); state->sets = NULL; } return; } static int warts_tracelb_link_state(const scamper_file_t *sf, const scamper_tracelb_t *trace, const scamper_tracelb_link_t *link, warts_tracelb_link_t *state, warts_addrtable_t *table, uint32_t *len) { const warts_var_t *var; size_t size; int i, j, max_id = 0; uint8_t s; state->hopc = link->hopc; /* * get the index into the nodes array for each of the nodes represented * in the link. the loop finishes when j reaches 2, i.e. both nodes have * been identified. */ for(i=0, j=0; inodec; i++) { if(link->from == trace->nodes[i]) { state->from = i; j++; } if(link->to == trace->nodes[i]) { state->to = i; j++; } if(j == 2 || (link->to == NULL && j == 1)) break; } /* unset all the flags possible */ memset(state->flags, 0, tracelb_link_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_TRACELB_LINK_TO && link->to == NULL) continue; flag_set(state->flags, var->id, &max_id); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; if(link->hopc > 0) { size = sizeof(warts_tracelb_probeset_t) * link->hopc; if((state->sets = malloc_zero(size)) == NULL) { return -1; } for(s=0; shopc; s++) { if(warts_tracelb_probeset_state(sf, link->sets[s], &state->sets[s], table, len) != 0) return -1; } } return 0; } static int warts_tracelb_link_read(scamper_tracelb_t *trace, scamper_tracelb_link_t *link, warts_state_t *state, warts_addrtable_t *table, const uint8_t *buf, uint32_t *off, uint32_t len) { uint16_t from, to; warts_param_reader_t handlers[] = { {&from, (wpr_t)extract_uint16, NULL}, {&to, (wpr_t)extract_uint16, NULL}, {&link->hopc, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); scamper_tracelb_probeset_t *set; uint8_t i; uint32_t o = *off; if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) { return -1; } if(from >= trace->nodec) return -1; link->from = trace->nodes[from]; if(flag_isset(&buf[o], WARTS_TRACELB_LINK_TO) != 0) link->to = trace->nodes[to]; else link->to = NULL; if(link->hopc > 0) { if(scamper_tracelb_link_probesets_alloc(link, link->hopc) != 0) return -1; for(i=0; ihopc; i++) { if((set = scamper_tracelb_probeset_alloc()) == NULL) return -1; link->sets[i] = set; if(warts_tracelb_probeset_read(set, state, table, buf, off, len) != 0) return -1; } } return 0; } static void warts_tracelb_link_write(const scamper_tracelb_link_t *link, const warts_tracelb_link_t *state, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_writer_t handlers[] = { {&state->from, (wpw_t)insert_uint16, NULL}, {&state->to, (wpw_t)insert_uint16, NULL}, {&link->hopc, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); uint32_t i; warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); for(i=0; ihopc; i++) { warts_tracelb_probeset_write(link->sets[i], &state->sets[i], table, buf, off, len); } return; } /* * warts_tracelb_read * */ int scamper_file_warts_tracelb_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_tracelb_t **trace_out) { warts_state_t *state = scamper_file_getstate(sf); scamper_tracelb_t *trace = NULL; uint8_t *buf = NULL; uint32_t i, off = 0; uint16_t *nlc = NULL, j; scamper_tracelb_node_t *node; warts_addrtable_t *table = NULL; if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { *trace_out = NULL; return 0; } if((trace = scamper_tracelb_alloc()) == NULL) { goto err; } if((table = warts_addrtable_alloc_byid()) == NULL) goto err; /* read the trace's parameters */ if(warts_tracelb_params_read(trace, state, table, buf, &off, hdr->len) != 0) { goto err; } /* read the nodes */ if(trace->nodec > 0) { if(scamper_tracelb_nodes_alloc(trace, trace->nodec) != 0) { goto err; } for(i=0; inodec; i++) { if((trace->nodes[i] = scamper_tracelb_node_alloc(NULL)) == NULL) goto err; if(warts_tracelb_node_read(trace->nodes[i], state, table, buf, &off, hdr->len) != 0) goto err; } } /* read the links */ if(trace->linkc > 0) { if(scamper_tracelb_links_alloc(trace, trace->linkc) != 0) { goto err; } for(i=0; ilinkc; i++) { if((trace->links[i] = scamper_tracelb_link_alloc()) == NULL) goto err; if(warts_tracelb_link_read(trace, trace->links[i], state, table, buf, &off, hdr->len) != 0) goto err; } } /* don't need the buf any more */ free(buf); buf = NULL; /* * add the links to their respective nodes. */ if(trace->nodec > 0) { if((nlc = malloc_zero(sizeof(uint16_t) * trace->nodec)) == NULL) { goto err; } for(i=0; ilinkc; i++) { for(j=0; jnodec; j++) { if(trace->links[i]->from == trace->nodes[j]) break; } if(j == trace->nodec) goto err; node = trace->nodes[j]; if(node->links == NULL && scamper_tracelb_node_links_alloc(node, node->linkc) != 0) goto err; if(nlc[j] == node->linkc) goto err; node->links[nlc[j]++] = trace->links[i]; } for(i=0; inodec; i++) { if(nlc[i] != trace->nodes[i]->linkc) goto err; } free(nlc); nlc = NULL; } warts_addrtable_free(table); *trace_out = trace; return 0; err: if(table != NULL) warts_addrtable_free(table); if(buf != NULL) free(buf); if(nlc != NULL) free(nlc); if(trace != NULL) scamper_tracelb_free(trace); return -1; } int scamper_file_warts_tracelb_write(const scamper_file_t *sf, const scamper_tracelb_t *trace) { const scamper_tracelb_node_t *node; const scamper_tracelb_link_t *link; uint8_t *buf = NULL; uint32_t off = 0, len, len2; uint8_t trace_flags[tracelb_vars_mfb]; uint16_t trace_flags_len, trace_params_len; warts_tracelb_node_t *node_state = NULL; warts_tracelb_link_t *link_state = NULL; size_t size; int i; warts_addrtable_t *table = NULL; /* make sure the table is nulled out */ if((table = warts_addrtable_alloc_byaddr()) == NULL) goto err; /* figure out which tracelb data items we'll store in this record */ warts_tracelb_params(trace, table, trace_flags, &trace_flags_len, &trace_params_len); /* this represents the length of the trace's flags and parameters */ len = 8 + trace_flags_len + trace_params_len; if(trace_params_len != 0) len += 2; /* record the node records */ if(trace->nodec > 0) { size = trace->nodec * sizeof(warts_tracelb_node_t); if((node_state = (warts_tracelb_node_t *)malloc_zero(size)) == NULL) { goto err; } for(i=0; inodec; i++) { len2 = len; node = trace->nodes[i]; if(warts_tracelb_node_state(sf, node, table, &node_state[i], &len2) != 0) { goto err; } /* check for wrapping */ if(len2 < len) goto err; len = len2; } } /* record the link records */ if(trace->linkc > 0) { size = trace->linkc * sizeof(warts_tracelb_link_t); if((link_state = (warts_tracelb_link_t *)malloc_zero(size)) == NULL) { goto err; } for(i=0; ilinkc; i++) { len2 = len; link = trace->links[i]; if(warts_tracelb_link_state(sf, trace, link, &link_state[i], table, &len2) != 0) { goto err; } /* check for wrapping */ if(len2 < len) goto err; len = len2; } } if((buf = malloc_zero(len)) == NULL) { goto err; } insert_wartshdr(buf, &off, len, SCAMPER_FILE_OBJ_TRACELB); /* write trace params */ if(warts_tracelb_params_write(trace, sf, table, buf, &off, len, trace_flags, trace_flags_len, trace_params_len) != 0) { goto err; } /* write trace nodes */ for(i=0; inodec; i++) { warts_tracelb_node_write(trace->nodes[i], &node_state[i], table, buf, &off, len); } if(node_state != NULL) { free(node_state); node_state = NULL; } /* write trace links */ for(i=0; ilinkc; i++) { link = trace->links[i]; warts_tracelb_link_write(link, &link_state[i], table, buf, &off, len); warts_tracelb_link_free(&link_state[i]); } if(link_state != NULL) { free(link_state); link_state = NULL; } assert(off == len); if(warts_write(sf, buf, off) == -1) { goto err; } warts_addrtable_free(table); free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(node_state != NULL) free(node_state); if(link_state != NULL) free(link_state); if(buf != NULL) free(buf); return -1; } scamper-cvs-20171204/scamper/tracelb/scamper_tracelb_warts.h000644 001751 000000 00000002232 11452510530 023673 0ustar00mjlwheel000000 000000 /* * scamper_tracelb_warts.h * * Copyright (C) 2008-2010 The University of Waikato * Author: Matthew Luckie * * $Id: scamper_tracelb_warts.h,v 1.1 2010/10/05 02:45:44 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_TRACELB_WARTS_H #define __SCAMPER_TRACELB_WARTS_H int scamper_file_warts_tracelb_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_tracelb_t **trace_out); int scamper_file_warts_tracelb_write(const scamper_file_t *sf, const scamper_tracelb_t *trace); #endif /* __SCAMPER_TRACELB_WARTS_H */ scamper-cvs-20171204/scamper/trace/.cvsignore000644 001751 000000 00000000034 12415633115 020641 0ustar00mjlwheel000000 000000 .deps .dirstamp .libs *.lo scamper-cvs-20171204/scamper/trace/scamper_trace.c000644 001751 000000 00000027640 12554062460 021634 0ustar00mjlwheel000000 000000 /* * scamper_trace.c * * $Id: scamper_trace.c,v 1.95 2015/07/23 03:53:20 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2003-2011 The University of Waikato * Copyright (C) 2008 Alistair King * Copyright (C) 2012-2015 The Regents of the University of California * * Authors: Matthew Luckie * Doubletree implementation by Alistair King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_trace.c,v 1.95 2015/07/23 03:53:20 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_trace.h" #include "utils.h" int scamper_trace_pmtud_alloc(scamper_trace_t *trace) { if((trace->pmtud = malloc_zero(sizeof(scamper_trace_pmtud_t))) == NULL) return -1; return 0; } void scamper_trace_pmtud_free(scamper_trace_t *trace) { scamper_trace_hop_t *hop, *hop_next; uint8_t u8; if(trace->pmtud == NULL) return; hop = trace->pmtud->hops; while(hop != NULL) { hop_next = hop->hop_next; scamper_trace_hop_free(hop); hop = hop_next; } if(trace->pmtud->notes != NULL) { for(u8=0; u8pmtud->notec; u8++) scamper_trace_pmtud_n_free(trace->pmtud->notes[u8]); free(trace->pmtud->notes); } free(trace->pmtud); trace->pmtud = NULL; return; } int scamper_trace_pmtud_hop_count(const scamper_trace_t *trace) { scamper_trace_hop_t *hop; int count = 0; if(trace == NULL || trace->pmtud == NULL) return -1; for(hop = trace->pmtud->hops; hop != NULL; hop = hop->hop_next) count++; return count; } scamper_trace_pmtud_n_t *scamper_trace_pmtud_n_alloc(void) { return malloc_zero(sizeof(scamper_trace_pmtud_n_t)); } void scamper_trace_pmtud_n_free(scamper_trace_pmtud_n_t *n) { free(n); return; } int scamper_trace_pmtud_n_alloc_c(scamper_trace_pmtud_t *pmtud, uint8_t count) { size_t len = count * sizeof(scamper_trace_pmtud_n_t *); if((pmtud->notes = malloc_zero(len)) == NULL) return -1; return 0; } int scamper_trace_pmtud_n_add(scamper_trace_pmtud_t *pmtud, scamper_trace_pmtud_n_t *n) { size_t len = (pmtud->notec + 1) * sizeof(scamper_trace_pmtud_n_t *); if(realloc_wrap((void **)&pmtud->notes, len) != 0) return -1; pmtud->notes[pmtud->notec] = n; pmtud->notec++; return 0; } int scamper_trace_lastditch_hop_count(const scamper_trace_t *trace) { scamper_trace_hop_t *hop; int count = 0; if(trace == NULL || trace->lastditch == NULL) return -1; for(hop = trace->lastditch; hop != NULL; hop = hop->hop_next) count++; return count; } int scamper_trace_dtree_alloc(scamper_trace_t *trace) { if((trace->dtree = malloc_zero(sizeof(scamper_trace_dtree_t))) != NULL) return 0; return -1; } void scamper_trace_dtree_free(scamper_trace_t *trace) { uint16_t i; if(trace->dtree == NULL) return; if(trace->dtree->lss_stop != NULL) scamper_addr_free(trace->dtree->lss_stop); if(trace->dtree->gss_stop != NULL) scamper_addr_free(trace->dtree->gss_stop); if(trace->dtree->lss != NULL) free(trace->dtree->lss); if(trace->dtree->gss != NULL) { for(i=0; idtree->gssc; i++) if(trace->dtree->gss[i] != NULL) scamper_addr_free(trace->dtree->gss[i]); free(trace->dtree->gss); } free(trace->dtree); trace->dtree = NULL; return; } int scamper_trace_dtree_lss(scamper_trace_t *trace, const char *name) { if(trace->dtree == NULL || (trace->dtree->lss = strdup(name)) == NULL) return -1; return 0; } int scamper_trace_dtree_gss_alloc(scamper_trace_t *trace, uint16_t cnt) { if(trace->dtree == NULL || trace->dtree->gss != NULL) return -1; if((trace->dtree->gss = malloc_zero(sizeof(scamper_addr_t *) * cnt)) == NULL) return -1; return 0; } scamper_addr_t *scamper_trace_dtree_gss_find(const scamper_trace_t *trace, const scamper_addr_t *iface) { if(trace->dtree == NULL) return NULL; return array_find((void **)trace->dtree->gss, trace->dtree->gssc, iface, (array_cmp_t)scamper_addr_cmp); } void scamper_trace_dtree_gss_sort(const scamper_trace_t *trace) { array_qsort((void **)trace->dtree->gss, trace->dtree->gssc, (array_cmp_t)scamper_addr_cmp); return; } int scamper_trace_hops_alloc(scamper_trace_t *trace, const int hops) { size_t size = sizeof(scamper_trace_hop_t *) * hops; scamper_trace_hop_t **h; if(trace->hops == NULL) h = (scamper_trace_hop_t **)malloc_zero(size); else h = (scamper_trace_hop_t **)realloc(trace->hops, size); if(h == NULL) return -1; trace->hops = h; return 0; } void scamper_trace_hop_free(scamper_trace_hop_t *hop) { if(hop == NULL) return; scamper_icmpext_free(hop->hop_icmpext); scamper_addr_free(hop->hop_addr); free(hop); return; } scamper_trace_hop_t *scamper_trace_hop_alloc() { return malloc_zero(sizeof(struct scamper_trace_hop)); } int scamper_trace_hop_count(const scamper_trace_t *trace) { scamper_trace_hop_t *hop; int hops = 0; uint8_t i; for(i=0; ihop_count; i++) for(hop = trace->hops[i]; hop != NULL; hop = hop->hop_next) hops++; return hops; } int scamper_trace_hop_addr_cmp(const scamper_trace_hop_t *a, const scamper_trace_hop_t *b) { assert(a != NULL); assert(b != NULL); return scamper_addr_cmp(a->hop_addr, b->hop_addr); } /* * scamper_trace_addr * * return the target address of the traceroute. the caller doesn't know * that this is a trace structure, they merely get passed the address * of this function. */ scamper_addr_t *scamper_trace_addr(const void *va) { return ((const scamper_trace_t *)va)->dst; } const char *scamper_trace_type_tostr(const scamper_trace_t *t, char *b, size_t l) { static const char *m[] = { NULL, "icmp-echo", "udp", "tcp", "icmp-echo-paris", "udp-paris", "tcp-ack", }; if(t->type > sizeof(m) / sizeof(char *) || m[t->type] == NULL) { snprintf(b, l, "%d", t->type); return b; } return m[t->type]; } const char *scamper_trace_stop_tostr(const scamper_trace_t *t, char *b, size_t l) { static const char *r[] = { "NONE", "COMPLETED", "UNREACH", "ICMP", "LOOP", "GAPLIMIT", "ERROR", "HOPLIMIT", "GSS", "HALTED", }; if(t->stop_reason > sizeof(r) / sizeof(char *) || r[t->stop_reason] == NULL) { snprintf(b, l, "%d", t->stop_reason); return b; } return r[t->stop_reason]; } /* * scamper_trace_probe_headerlen * * return the length of headers sent on probe packets with this trace */ int scamper_trace_probe_headerlen(const scamper_trace_t *trace) { int len; switch(trace->dst->type) { case SCAMPER_ADDR_TYPE_IPV4: len = 20; break; case SCAMPER_ADDR_TYPE_IPV6: len = 40; break; default: return -1; } if(trace->offset > 0) return len; if(SCAMPER_TRACE_TYPE_IS_UDP(trace)) len += 8; else if(SCAMPER_TRACE_TYPE_IS_ICMP(trace)) len += (1 + 1 + 2 + 2 + 2); else if(SCAMPER_TRACE_TYPE_IS_TCP(trace)) len += 20; else return -1; return len; } uint16_t scamper_trace_pathlength(const scamper_trace_t *trace) { uint16_t i=0, max = 0; for(i=0; i != trace->hop_count; i++) { if(trace->hops[i] != NULL) max = i; } return max; } int scamper_trace_iscomplete(const scamper_trace_t *trace) { uint8_t i; if(trace->stop_reason != SCAMPER_TRACE_STOP_COMPLETED) return 0; for(i=trace->firsthop-1; ihop_count; i++) if(trace->hops[i] == NULL) return 0; return 1; } int scamper_trace_dst_cmp(const scamper_trace_t *a, const scamper_trace_t *b) { return scamper_addr_cmp(a->dst, b->dst); } /* * trace_hop_firstaddr * */ static int trace_hop_firstaddr(const scamper_trace_t *trace, const scamper_trace_hop_t *hop) { const scamper_trace_hop_t *tmp = trace->hops[hop->hop_probe_ttl-1]; while(tmp != hop) { if(scamper_trace_hop_addr_cmp(tmp, hop) == 0) return 0; tmp = tmp->hop_next; } return 1; } int scamper_trace_loop(const scamper_trace_t *trace, const int n, const scamper_trace_hop_t **a, const scamper_trace_hop_t **b) { const scamper_trace_hop_t *hop, *tmp; uint8_t i; int j, loopc = 0; assert(trace->firsthop != 0); if(b != NULL && *b != NULL) { /* to start with, make sure that the hop supplied is in the trace */ hop = *b; if(hop->hop_probe_ttl >= trace->hop_count) { return -1; } tmp = trace->hops[hop->hop_probe_ttl-1]; while(tmp != NULL) { if(tmp == hop) break; tmp = tmp->hop_next; } if(tmp == NULL) { return -1; } /* find the next place to consider new hop records */ i = hop->hop_probe_ttl-1; if((hop = hop->hop_next) == NULL) { i++; } } else { i = trace->firsthop; hop = NULL; } while(ihop_count) { if(hop == NULL) { /* find the next hop record to start with, if necessary */ while(ihop_count) { if((hop = trace->hops[i]) != NULL) break; i++; } if(i == trace->hop_count) { return 0; } } /* the next loop requires hop not be null */ assert(hop != NULL); do { /* * if this address was already checked for loops earlier, then * continue with the next hop record */ if(trace_hop_firstaddr(trace, hop) == 0) { hop = hop->hop_next; continue; } /* check prior hop records leading up to this hop */ for(j=i-1; j>=trace->firsthop-1; j--) { /* check all hop records in this hop */ for(tmp = trace->hops[j]; tmp != NULL; tmp = tmp->hop_next) { /* * if there's a loop (and this is the first instance of * this address in the list) then a new loop is found. */ if(scamper_trace_hop_addr_cmp(tmp, hop) == 0 && trace_hop_firstaddr(trace, tmp) != 0) { if(++loopc == n) { if(a != NULL) *a = tmp; if(b != NULL) *b = hop; return i-j; } } } } hop = hop->hop_next; } while(hop != NULL); i++; } return 0; } /* * scamper_trace_free * */ void scamper_trace_free(scamper_trace_t *trace) { scamper_trace_hop_t *hop, *hop_next; uint8_t i; if(trace == NULL) return; /* free hop records */ if(trace->hops != NULL) { for(i=0; ihop_count; i++) { hop = trace->hops[i]; while(hop != NULL) { hop_next = hop->hop_next; scamper_trace_hop_free(hop); hop = hop_next; } } free(trace->hops); } /* free lastditch hop records */ hop = trace->lastditch; while(hop != NULL) { hop_next = hop->hop_next; scamper_trace_hop_free(hop); hop = hop_next; } if(trace->payload != NULL) free(trace->payload); scamper_trace_pmtud_free(trace); scamper_trace_dtree_free(trace); if(trace->dst != NULL) scamper_addr_free(trace->dst); if(trace->src != NULL) scamper_addr_free(trace->src); if(trace->cycle != NULL) scamper_cycle_free(trace->cycle); if(trace->list != NULL) scamper_list_free(trace->list); free(trace); return; } /* * scamper_trace_alloc * * allocate the trace and all the possibly necessary data fields */ scamper_trace_t *scamper_trace_alloc() { return (struct scamper_trace *)malloc_zero(sizeof(struct scamper_trace)); } scamper-cvs-20171204/scamper/trace/scamper_trace.h000644 001751 000000 00000041467 12607354540 021646 0ustar00mjlwheel000000 000000 /* * scamper_trace.h * * $Id: scamper_trace.h,v 1.137 2015/10/14 04:26:08 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2008 Alistair King * Copyright (C) 2015 The Regents of the University of California * Copyright (C) 2015 The University of Waikato * Authors: Matthew Luckie * Doubletree implementation by Alistair King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_TRACE_H #define __SCAMPER_TRACE_H /* forward declare some important structures */ struct scamper_icmpext; struct scamper_list; struct scamper_cycle; struct scamper_addr; #define SCAMPER_TRACE_STOP_NONE 0x00 /* null reason */ #define SCAMPER_TRACE_STOP_COMPLETED 0x01 /* got an ICMP port unreach */ #define SCAMPER_TRACE_STOP_UNREACH 0x02 /* got an other ICMP unreach code */ #define SCAMPER_TRACE_STOP_ICMP 0x03 /* got an ICMP msg, not unreach */ #define SCAMPER_TRACE_STOP_LOOP 0x04 /* loop detected */ #define SCAMPER_TRACE_STOP_GAPLIMIT 0x05 /* gaplimit reached */ #define SCAMPER_TRACE_STOP_ERROR 0x06 /* sendto error */ #define SCAMPER_TRACE_STOP_HOPLIMIT 0x07 /* hoplimit reached */ #define SCAMPER_TRACE_STOP_GSS 0x08 /* found hop in global stop set */ #define SCAMPER_TRACE_STOP_HALTED 0x09 /* halted */ #define SCAMPER_TRACE_FLAG_ALLATTEMPTS 0x01 /* send all allotted attempts */ #define SCAMPER_TRACE_FLAG_PMTUD 0x02 /* conduct PMTU discovery */ #define SCAMPER_TRACE_FLAG_DL 0x04 /* datalink for TX timestamps */ #define SCAMPER_TRACE_FLAG_IGNORETTLDST 0x08 /* ignore ttl exp. rx f/ dst */ #define SCAMPER_TRACE_FLAG_DOUBLETREE 0x10 /* doubletree */ #define SCAMPER_TRACE_FLAG_ICMPCSUMDP 0x20 /* icmp csum found in dport */ #define SCAMPER_TRACE_FLAG_CONSTPAYLOAD 0x40 /* do not hack payload for csum */ #define SCAMPER_TRACE_TYPE_ICMP_ECHO 0x01 /* ICMP echo requests */ #define SCAMPER_TRACE_TYPE_UDP 0x02 /* UDP to unused ports */ #define SCAMPER_TRACE_TYPE_TCP 0x03 /* TCP SYN packets */ #define SCAMPER_TRACE_TYPE_ICMP_ECHO_PARIS 0x04 /* paris traceroute */ #define SCAMPER_TRACE_TYPE_UDP_PARIS 0x05 /* paris traceroute */ #define SCAMPER_TRACE_TYPE_TCP_ACK 0x06 /* TCP ACK packets */ #define SCAMPER_TRACE_GAPACTION_STOP 0x01 /* stop when gaplimit reached */ #define SCAMPER_TRACE_GAPACTION_LASTDITCH 0x02 /* send TTL-255 probes */ #define SCAMPER_TRACE_HOP_IS_TCP(hop) ( \ (hop->hop_flags & SCAMPER_TRACE_HOP_FLAG_TCP) != 0) #define SCAMPER_TRACE_HOP_IS_UDP(hop) ( \ (hop->hop_flags & SCAMPER_TRACE_HOP_FLAG_UDP) != 0) #define SCAMPER_TRACE_HOP_IS_ICMP(hop) ( \ (hop->hop_flags & (SCAMPER_TRACE_HOP_FLAG_TCP| \ SCAMPER_TRACE_HOP_FLAG_UDP)) == 0) #define SCAMPER_TRACE_HOP_IS_ICMP_TTL_EXP(hop) ( \ SCAMPER_TRACE_HOP_IS_ICMP(hop) && \ (((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (hop)->hop_icmp_type == 11) || \ ((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ (hop)->hop_icmp_type == 3))) #define SCAMPER_TRACE_HOP_IS_ICMP_TTL_EXP_TRANS(hop) ( \ SCAMPER_TRACE_HOP_IS_ICMP(hop) && \ (((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (hop)->hop_icmp_type == 11 && (hop)->hop_icmp_code == 0) || \ ((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ (hop)->hop_icmp_type == 3 && (hop)->hop_icmp_code == 0))) #define SCAMPER_TRACE_HOP_IS_ICMP_PTB(hop) ( \ SCAMPER_TRACE_HOP_IS_ICMP(hop) && \ (((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (hop)->hop_icmp_type == 3 && (hop)->hop_icmp_code == 4) || \ ((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ (hop)->hop_icmp_type == 2))) #define SCAMPER_TRACE_HOP_IS_ICMP_PTB_BADSUGG(hop) ( \ SCAMPER_TRACE_HOP_IS_ICMP_PTB((hop)) && \ (hop)->hop_probe_size <= (hop)->hop_icmp_nhmtu) #define SCAMPER_TRACE_HOP_IS_ICMP_UNREACH(hop) ( \ SCAMPER_TRACE_HOP_IS_ICMP(hop) && \ (((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (hop)->hop_icmp_type == 3) || \ ((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ (hop)->hop_icmp_type == 1))) #define SCAMPER_TRACE_HOP_IS_ICMP_UNREACH_PORT(hop) ( \ SCAMPER_TRACE_HOP_IS_ICMP(hop) && \ (((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (hop)->hop_icmp_type == 3 && (hop)->hop_icmp_code == 3) || \ ((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ (hop)->hop_icmp_type == 1 && (hop)->hop_icmp_code == 4))) #define SCAMPER_TRACE_HOP_IS_ICMP_ECHO_REPLY(hop) ( \ SCAMPER_TRACE_HOP_IS_ICMP(hop) && \ (((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (hop)->hop_icmp_type == 0) || \ ((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ (hop)->hop_icmp_type == 129))) #define SCAMPER_TRACE_HOP_IS_ICMP_Q(hop) ( \ SCAMPER_TRACE_HOP_IS_ICMP(hop) && \ (((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ ((hop)->hop_icmp_type == 3 || (hop)->hop_icmp_type == 11)) ||\ ((hop)->hop_addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ ((hop)->hop_icmp_type >= 1 && (hop)->hop_icmp_type <= 3)))) #define SCAMPER_TRACE_TYPE_IS_ICMP(trace) ( \ (trace)->type == SCAMPER_TRACE_TYPE_ICMP_ECHO || \ (trace)->type == SCAMPER_TRACE_TYPE_ICMP_ECHO_PARIS) #define SCAMPER_TRACE_TYPE_IS_UDP(trace) ( \ (trace)->type == SCAMPER_TRACE_TYPE_UDP || \ (trace)->type == SCAMPER_TRACE_TYPE_UDP_PARIS) #define SCAMPER_TRACE_TYPE_IS_TCP(trace) ( \ (trace)->type == SCAMPER_TRACE_TYPE_TCP || \ (trace)->type == SCAMPER_TRACE_TYPE_TCP_ACK) #define SCAMPER_TRACE_TYPE_IS_UDP_PARIS(trace) ( \ (trace)->type == SCAMPER_TRACE_TYPE_UDP_PARIS) /* * macros for dealing with scamper trace flags. */ #define SCAMPER_TRACE_IS_ICMPCSUMDP(trace) ( \ (trace)->flags & SCAMPER_TRACE_FLAG_ICMPCSUMDP) #define SCAMPER_TRACE_IS_PMTUD(trace) ( \ (trace)->flags & SCAMPER_TRACE_FLAG_PMTUD) #define SCAMPER_TRACE_IS_DOUBLETREE(trace) ( \ (trace)->flags & SCAMPER_TRACE_FLAG_DOUBLETREE) #define SCAMPER_TRACE_IS_DL(trace) ( \ (trace)->flags & SCAMPER_TRACE_FLAG_DL) #define SCAMPER_TRACE_IS_IGNORETTLDST(trace) ( \ (trace)->flags & SCAMPER_TRACE_FLAG_IGNORETTLDST) #define SCAMPER_TRACE_IS_ALLATTEMPTS(trace) ( \ (trace)->flags & SCAMPER_TRACE_FLAG_ALLATTEMPTS) #define SCAMPER_TRACE_IS_CONSTPAYLOAD(trace)( \ (trace)->flags & SCAMPER_TRACE_FLAG_CONSTPAYLOAD) /* * scamper hop flags: * these flags give extra meaning to fields found in the hop structure * by default. */ #define SCAMPER_TRACE_HOP_FLAG_TS_SOCK_RX 0x01 /* socket rx timestamp */ #define SCAMPER_TRACE_HOP_FLAG_TS_DL_TX 0x02 /* datalink tx timestamp */ #define SCAMPER_TRACE_HOP_FLAG_TS_DL_RX 0x04 /* datalink rx timestamp */ #define SCAMPER_TRACE_HOP_FLAG_TS_TSC 0x08 /* rtt computed w/ tsc clock */ #define SCAMPER_TRACE_HOP_FLAG_REPLY_TTL 0x10 /* reply ttl included */ #define SCAMPER_TRACE_HOP_FLAG_TCP 0x20 /* reply is TCP */ #define SCAMPER_TRACE_HOP_FLAG_UDP 0x40 /* reply is UDP */ /* * this macro is a more convenient way to check that the hop record * has both the tx and rx timestamps from the datalink for computing the * RTT */ #define SCAMPER_TRACE_HOP_FLAG_DL_RTT(hop) \ ((hop->hop_flags & SCAMPER_TRACE_HOP_FLAG_TS_DL_TX) && \ (hop->hop_flags & SCAMPER_TRACE_HOP_FLAG_TS_DL_RX)) /* * scamper_trace_hop: * * hold data on each response received as part of a traceroute. */ typedef struct scamper_trace_hop { /* the address of the hop that responded */ scamper_addr_t *hop_addr; /* flags defined by SCAMPER_TRACE_HOP_FLAG_* */ uint8_t hop_flags; /* * probe_id: the attempt # this probe is in response to [count from 0] * probe_ttl: the ttl that we sent to the trace->dst * probe_size: the size of the probe we sent * reply_ttl: the ttl of the reply packet * reply_tos: the TOS of the reply packet * reply_size: the size of the icmp response we received * reply_ipid: the IPID value in the response */ uint8_t hop_probe_id; uint8_t hop_probe_ttl; uint16_t hop_probe_size; uint8_t hop_reply_ttl; uint8_t hop_reply_tos; uint16_t hop_reply_size; uint16_t hop_reply_ipid; /* icmp type / code returned by this hop */ union { struct hop_icmp { uint8_t hop_icmp_type; uint8_t hop_icmp_code; uint8_t hop_icmp_q_ttl; uint8_t hop_icmp_q_tos; uint16_t hop_icmp_q_ipl; uint16_t hop_icmp_nhmtu; } icmp; struct hop_tcp { uint8_t hop_tcp_flags; } tcp; } hop_un; /* time elapsed between sending the probe and receiving this resp */ struct timeval hop_tx; struct timeval hop_rtt; /* ICMP extensions */ struct scamper_icmpext *hop_icmpext; struct scamper_trace_hop *hop_next; } scamper_trace_hop_t; #define hop_icmp_type hop_un.icmp.hop_icmp_type #define hop_icmp_code hop_un.icmp.hop_icmp_code #define hop_icmp_q_ttl hop_un.icmp.hop_icmp_q_ttl #define hop_icmp_q_ipl hop_un.icmp.hop_icmp_q_ipl #define hop_icmp_q_tos hop_un.icmp.hop_icmp_q_tos #define hop_icmp_nhmtu hop_un.icmp.hop_icmp_nhmtu #define hop_tcp_flags hop_un.tcp.hop_tcp_flags /* * scamper_trace_pmtud_n_t * * notes about PMTUD process; the record says the behaviour that was deduced, * what the next-hop MTU is, and which hop it corresponds to. The hop * record is one of those listed in the parent scamper_trace_pmtud_t * structure. */ typedef struct scamper_trace_pmtud_n { uint8_t type; uint16_t nhmtu; scamper_trace_hop_t *hop; } scamper_trace_pmtud_n_t; #define SCAMPER_TRACE_PMTUD_N_TYPE_PTB 1 #define SCAMPER_TRACE_PMTUD_N_TYPE_PTB_BAD 2 #define SCAMPER_TRACE_PMTUD_N_TYPE_SILENCE 3 /* * scamper_trace_pmtud_t * * container for data collected. * * version 1 has ifmtu, outmtu, pmtu, and a list of hops from which it must * be deduced what the behaviours observed are. * version 2 has ifmtu, outmtu, pmtu, all responses received during pmtud * process, and a set of annotations about what was inferred. */ typedef struct scamper_trace_pmtud { uint8_t ver; /* version of data-storing method */ uint16_t ifmtu; /* the outgoing interface's MTU */ uint16_t outmtu; /* MTU to first hop, if diff from ifmtu */ uint16_t pmtu; /* packet size that reached target */ scamper_trace_hop_t *hops; /* icmp messages */ scamper_trace_pmtud_n_t **notes; /* annotations about pmtud */ uint8_t notec; /* number of annotations */ } scamper_trace_pmtud_t; typedef struct scamper_trace_dtree { char *lss; uint8_t firsthop; uint8_t flags; uint16_t gssc; scamper_addr_t **gss; scamper_addr_t *gss_stop; scamper_addr_t *lss_stop; } scamper_trace_dtree_t; #define SCAMPER_TRACE_DTREE_FLAG_NOBACK 0x01 /* * scamper_trace: * a trace structure contains enough state for scamper to probe a series * of traces concurrently. */ typedef struct scamper_trace { /* the current list, cycle, and defaults */ struct scamper_list *list; struct scamper_cycle *cycle; uint32_t userid; /* source and destination addresses of the trace */ struct scamper_addr *src; struct scamper_addr *dst; /* when the trace commenced */ struct timeval start; /* hops array, number of valid hops specified by hop_count */ scamper_trace_hop_t **hops; uint16_t hop_count; /* number of probes sent for this traceroute */ uint16_t probec; /* why the trace finished */ uint8_t stop_reason; uint8_t stop_data; /* trace parameters */ uint8_t type; uint8_t flags; uint8_t attempts; uint8_t hoplimit; uint8_t gaplimit; uint8_t gapaction; uint8_t firsthop; uint8_t tos; uint8_t wait; uint8_t wait_probe; uint8_t loops; uint8_t loopaction; uint8_t confidence; uint16_t probe_size; uint16_t sport; uint16_t dport; uint16_t offset; /* payload */ uint8_t *payload; uint16_t payload_len; /* if we perform PMTU discovery on the trace, then record the data here */ scamper_trace_pmtud_t *pmtud; /* if we perform last ditch probing, then record any responses here */ scamper_trace_hop_t *lastditch; /* if we perform doubletree, record doubletree parameters and data here */ scamper_trace_dtree_t *dtree; } scamper_trace_t; /* * scamper_trace_alloc: * allocate a brand new scamper trace object, empty of any data * * scamper_trace_hops_alloc: * allocate an array of hop records to the trace object * * scamper_trace_free: * free the memory used by this trace object. * this function assumes that any memory that would be dynamically * allocated can be freed with free() * * scamper_trace_probe_headerlen: * return the size of headers sent with each probe for the trace * * scamper_trace_addr: * return the address of the trace -- caller doesn't know that it is a trace. */ scamper_trace_t *scamper_trace_alloc(void); int scamper_trace_hops_alloc(scamper_trace_t *trace, const int hops); void scamper_trace_free(scamper_trace_t *trace); uint16_t scamper_trace_pathlength(const scamper_trace_t *trace); int scamper_trace_probe_headerlen(const scamper_trace_t *trace); scamper_addr_t *scamper_trace_addr(const void *va); int scamper_trace_iscomplete(const scamper_trace_t *trace); int scamper_trace_dst_cmp(const scamper_trace_t *a, const scamper_trace_t *b); const char *scamper_trace_type_tostr(const scamper_trace_t *t, char *b, size_t l); const char *scamper_trace_stop_tostr(const scamper_trace_t *t, char *b, size_t l); /* * scamper_trace_loop: * * find the nth instance of a loop in the trace. if 'a' or 'b' are non-null, * on exit they hold the start and end of the loop. if '*b' is non-null on * entry, it specifies the hop at which to commence looking for the next * instance of a loop. */ int scamper_trace_loop(const scamper_trace_t *trace, const int n, const scamper_trace_hop_t **a, const scamper_trace_hop_t **b); /* * scamper_trace_hop_alloc: * allocate a blank hop record * * scamper_trace_hop_free: * free the memory used by a hop structure * * scamper_trace_hop_count: * return the total number of hops attached to the trace structure */ scamper_trace_hop_t *scamper_trace_hop_alloc(void); void scamper_trace_hop_free(scamper_trace_hop_t *hop); int scamper_trace_hop_count(const scamper_trace_t *trace); int scamper_trace_hop_addr_cmp(const scamper_trace_hop_t *a, const scamper_trace_hop_t *b); /* * scamper_trace_pmtud_alloc: * allocate a blank pmtud record for the trace structure * * scamper_trace_pmtud_free: * free the attached pmtud record from the trace structure * * scamper_trace_pmtud_hop_count: * return the total number of hops attached to the pmtud structure */ int scamper_trace_pmtud_alloc(scamper_trace_t *trace); void scamper_trace_pmtud_free(scamper_trace_t *trace); int scamper_trace_pmtud_hop_count(const scamper_trace_t *trace); scamper_trace_pmtud_n_t *scamper_trace_pmtud_n_alloc(void); void scamper_trace_pmtud_n_free(scamper_trace_pmtud_n_t *n); int scamper_trace_pmtud_n_alloc_c(scamper_trace_pmtud_t *pmtud, uint8_t c); int scamper_trace_pmtud_n_add(scamper_trace_pmtud_t *pmtud, scamper_trace_pmtud_n_t *n); int scamper_trace_lastditch_hop_count(const scamper_trace_t *trace); /* * functions for helping with doubletree */ int scamper_trace_dtree_alloc(scamper_trace_t *trace); void scamper_trace_dtree_free(scamper_trace_t *trace); int scamper_trace_dtree_lss(scamper_trace_t *trace, const char *lss); int scamper_trace_dtree_gss_alloc(scamper_trace_t *trace, uint16_t cnt); void scamper_trace_dtree_gss_sort(const scamper_trace_t *trace); scamper_addr_t *scamper_trace_dtree_gss_find(const scamper_trace_t *trace, const scamper_addr_t *iface); #endif /* __SCAMPER_TRACE_H */ scamper-cvs-20171204/scamper/trace/scamper_trace_do.c000644 001751 000000 00000354012 13210743023 022301 0ustar00mjlwheel000000 000000 /* * scamper_do_trace.c * * $Id: scamper_trace_do.c,v 1.304 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2008 Alistair King * Copyright (C) 2012-2015 The Regents of the University of California * Copyright (C) 2015 The University of Waikato * * Authors: Matthew Luckie * Doubletree implementation by Alistair King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_trace_do.c,v 1.304 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_trace.h" #include "scamper_task.h" #include "scamper_queue.h" #include "scamper_icmp_resp.h" #include "scamper_dl.h" #include "scamper_fds.h" #include "scamper_dlhdr.h" #include "scamper_probe.h" #include "scamper_rtsock.h" #include "scamper_getsrc.h" #include "scamper_file.h" #include "scamper_debug.h" #include "scamper_trace_do.h" #include "scamper_addr2mac.h" #include "scamper_options.h" #include "scamper_icmp4.h" #include "scamper_icmp6.h" #include "scamper_tcp4.h" #include "scamper_udp4.h" #include "scamper_udp6.h" #include "scamper_if.h" #include "scamper_osinfo.h" #include "mjl_splaytree.h" #include "mjl_list.h" #include "utils.h" #define SCAMPER_DO_TRACE_ATTEMPTS_MIN 1 #define SCAMPER_DO_TRACE_ATTEMPTS_DEF 2 #define SCAMPER_DO_TRACE_ATTEMPTS_MAX 20 #define SCAMPER_DO_TRACE_DPORT_MIN 1 #define SCAMPER_DO_TRACE_DPORT_DEF (32768+666+1) /* probe_id starts at 0 */ #define SCAMPER_DO_TRACE_DPORT_MAX 65535 #define SCAMPER_DO_TRACE_FIRSTHOP_MIN 1 #define SCAMPER_DO_TRACE_FIRSTHOP_DEF 1 #define SCAMPER_DO_TRACE_FIRSTHOP_MAX 255 #define SCAMPER_DO_TRACE_GAPLIMIT_MIN 1 #define SCAMPER_DO_TRACE_GAPLIMIT_DEF 5 #define SCAMPER_DO_TRACE_GAPLIMIT_MAX 255 #define SCAMPER_DO_TRACE_GAPACTION_MIN 1 #define SCAMPER_DO_TRACE_GAPACTION_DEF SCAMPER_TRACE_GAPACTION_STOP #define SCAMPER_DO_TRACE_GAPACTION_MAX 2 #define SCAMPER_DO_TRACE_HOLDTIME_MIN 0 #define SCAMPER_DO_TRACE_HOLDTIME_DEF 0 #define SCAMPER_DO_TRACE_HOLDTIME_MAX 255 #define SCAMPER_DO_TRACE_HOPLIMIT_MIN 0 #define SCAMPER_DO_TRACE_HOPLIMIT_DEF 0 #define SCAMPER_DO_TRACE_HOPLIMIT_MAX 255 #define SCAMPER_DO_TRACE_LOOPS_MIN 0 #define SCAMPER_DO_TRACE_LOOPS_DEF 1 /* stop on the first loop found */ #define SCAMPER_DO_TRACE_LOOPS_MAX 255 #define SCAMPER_DO_TRACE_OFFSET_MIN 0 #define SCAMPER_DO_TRACE_OFFSET_DEF 0 #define SCAMPER_DO_TRACE_OFFSET_MAX 8190 #define SCAMPER_DO_TRACE_PPS_MIN 1 #define SCAMPER_DO_TRACE_PPS_MAX 1000 #define SCAMPER_DO_TRACE_PPS_DEF 20 #define SCAMPER_DO_TRACE_SPORT_MIN 1 #define SCAMPER_DO_TRACE_SPORT_MAX 65535 #define SCAMPER_DO_TRACE_TOS_MIN 0 #define SCAMPER_DO_TRACE_TOS_DEF 0 #define SCAMPER_DO_TRACE_TOS_MAX 255 #define SCAMPER_DO_TRACE_WAIT_MIN 1 #define SCAMPER_DO_TRACE_WAIT_DEF 5 #define SCAMPER_DO_TRACE_WAIT_MAX 10 #define SCAMPER_DO_TRACE_WAITPROBE_MIN 0 #define SCAMPER_DO_TRACE_WAITPROBE_DEF 0 #define SCAMPER_DO_TRACE_WAITPROBE_MAX 200 /* 2 seconds */ /* * pmtud_L2_state * * this struct records state when inferring the MTU of the underlying media. * * when scamper has to discover the MTU of the link itself, it uses the L2 * table above to choose a suitable initial guess. it records the index * into the L2 table into L2_idx. */ typedef struct pmtud_L2_state { int idx; /* index into the L2 table */ int lower; /* lower bounds of the L2 search space */ int upper; /* upper bounds of the L2 search space */ int in; /* probe size not to get a suitable response */ int out; /* size of probe to infer the underlying MTU */ scamper_trace_hop_t *hop; /* the last probe to obtain a response */ } pmtud_L2_state_t; /* * pmtud_TTL_state * * this struct records state when inferring the TTL range of hops that * are responsible for not sending a fragmentation required message where * one is required. */ typedef struct pmtud_TTL_state { int lower; /* lower bounds of the TTL search space */ int upper; /* upper bounds of the TTL search space */ scamper_trace_hop_t *hop; /* the last TTL probe to obtain a response */ } pmtud_TTL_state_t; /* * pmtud_L2 * * this struct associates a known MTU with an index into an array. */ typedef struct pmtud_L2 { int idx; /* index into the L2 array where this node resides */ int mtu; /* the MTU of the link */ char *descr; /* some description of the L2 media */ } pmtud_L2_t; typedef struct trace_lss { char *name; splaytree_t *tree; splaytree_node_t *node; } trace_lss_t; /* * trace_probe * * this struct keeps state of each probe sent with the trace */ typedef struct trace_probe { struct timeval tx_tv; /* the time we transmitted the probe */ struct timeval rx_tv; /* the time we received the first answer */ uint16_t rx; /* how many responses scamper got to the probe */ uint16_t size; /* the size of the probe sent */ uint8_t ttl; /* the TTL that was set for the probe */ uint8_t id; /* the attempt number made with ttl/size params */ uint8_t mode; /* the mode scamper was in when probe was sent */ uint8_t flags; /* the probe's flags */ } trace_probe_t; #define TRACE_PROBE_FLAG_DL_TX 0x01 #define TRACE_PROBE_FLAG_DL_RX 0x02 #define TRACE_PROBE_FLAG_TIMEOUT 0x04 #define TRACE_ALLOC_HOPS 16 /* * trace_pmtud_state * * these fields are used in Path MTU discovery */ typedef struct trace_pmtud_state { pmtud_L2_state_t *L2; /* state kept for L2 MTU search */ pmtud_TTL_state_t *TTL; /* state kept for TTL search */ scamper_trace_hop_t *last_fragmsg; /* last fragmentation msg stored */ scamper_trace_hop_t *last_hop; /* last in the pmtud hop list */ scamper_trace_pmtud_n_t *note; /* note to fill out */ } trace_pmtud_state_t; /* * trace_state * * this is a fairly large struct that keeps state for the traceroute * process. it also deals with state in the PMTUD phase, if used. */ typedef struct trace_state { uint8_t mode; /* current trace mode scamper is in */ uint8_t ttl; /* ttl to set in the probe packet */ uint8_t attempt; /* attempt number at the current probe */ uint8_t loopc; /* count of loops so far */ uint16_t alloc_hops; /* number of trace->hops allocated */ uint16_t payload_size; /* how much payload to include */ uint16_t header_size; /* size of headers */ struct timeval next_tx; /* when the next probe should be tx */ #ifndef _WIN32 scamper_fd_t *rtsock; /* fd to query route socket with */ #endif scamper_fd_t *icmp; /* fd to listen to icmp packets with */ scamper_fd_t *probe; /* fd to probe with */ scamper_fd_t *dl; /* struct to use with datalink access */ scamper_fd_t *raw; /* raw socket to use with tcp probes */ scamper_dlhdr_t *dlhdr; /* header to use with datalink */ scamper_route_t *route; /* looking up a route */ trace_probe_t **probes; /* probes sent so far */ uint16_t id_next; /* next id to use in probes */ uint16_t id_max; /* maximum id available */ /* these fields are used when probing to enumerate all interfaces at a hop */ uint8_t confidence; /* index into k[] */ uint8_t n; /* index into k[] */ scamper_addr_t **interfaces; /* ifaces found so far at this ttl */ uint16_t interfacec; /* count of interfaces */ trace_pmtud_state_t *pmtud; /* pmtud state */ /* * these fields are used for doubletree. * the lss contains the list of addresses visited when probing backwards. * this is a subset of the global lss. * it is used to probe backwards through a loop, where otherwise probing * would be halted by the first address in the loop being added to the lss * the first time it is seen. */ scamper_addr_t **lss; int lssc; trace_lss_t *lsst; } trace_state_t; static const uint8_t MODE_RTSOCK = 0; static const uint8_t MODE_DLHDR = 1; static const uint8_t MODE_TRACE = 2; static const uint8_t MODE_LASTDITCH = 3; static const uint8_t MODE_PMTUD_DEFAULT = 4; static const uint8_t MODE_PMTUD_SILENT_L2 = 5; static const uint8_t MODE_PMTUD_SILENT_TTL = 6; static const uint8_t MODE_PMTUD_BADSUGG = 7; static const uint8_t MODE_DTREE_FIRST = 8; static const uint8_t MODE_DTREE_FWD = 9; static const uint8_t MODE_DTREE_BACK = 10; #define MODE_MIN MODE_TRACE #define MODE_MAX MODE_DTREE_BACK /* the callback functions registered with the trace task */ static scamper_task_funcs_t trace_funcs; /* address cache used to avoid reallocating the same address multiple times */ extern scamper_addrcache_t *addrcache; /* temporary buffer shared amongst traceroutes */ static uint8_t *pktbuf = NULL; static size_t pktbuf_len = 0; /* local stop sets */ static splaytree_t *lsses = NULL; /* is this running on sunos */ static int sunos = 0; /* * these MTUs were largely taken from the NetBSD version of traceroute, and * are used to choose a packet size to probe with in the absence of a * Fragmentation Needed message. * * they have been annotated with their corresponding Layer 2 type, largely * taken from RFC 1191 */ static const pmtud_L2_t L2[] = { { 0, 68, "RFC791 MTU"}, /* Official RFC 791 minimum MTU */ { 1, 296, "P2P low delay"}, /* Point-to-Point links, (low delay) */ { 2, 508, ""}, { 3, 512, "NetBIOS"}, /* NetBIOS */ { 4, 544, "DEC Portal"}, /* DEC IP Portal */ { 5, 552, ""}, { 6, 576, "v4 min MTU"}, /* X25 MTU, IPv4 Minimum MTU */ { 7, 1006, "SLIP"}, /* SLIP */ { 8, 1280, "v6 min MTU"}, /* IPv6 Minimum MTU */ { 9, 1454, "PPPoE ADSL"}, /* an optimally sized PPPoE frame in DSL */ {10, 1480, "v4tun Ether"}, /* Ethernet MTU with tunnel over IPv4 */ {11, 1492, "IEEE 802.3"}, /* IEEE 802.3 */ {12, 1500, "Ethernet"}, /* Ethernet MTU */ {13, 1514, "Ethernet Max"}, /* Ethernet Max MTU */ {14, 1536, "Exp. Ether"}, /* Exp. Ethernet Nets */ {15, 2002, "IEEE 802.5"}, /* IEEE 802.5, Recommended MTU */ {16, 2048, "Wideband"}, /* Wideband Network */ {17, 4352, "FDDI"}, /* FDDI */ {18, 4464, "IEEE 802.5"}, /* IEEE 802.5, Maximum MTU */ {19, 4470, "IP over ATM"}, /* ATM / T3 / SONET SDH */ {20, 8166, "IEEE 802.4"}, /* IEEE 802.4 */ {21, 9000, "Broadcom GigE"}, /* Broadcom GigE MTU */ {22, 9192, "OC-192"}, /* OC-192 and other really fast media */ {23, 16110, "Intel GigE"}, /* Intel Pro 1000 MTU */ {24, 17914, "Token Ring"}, /* 16Mb IBM Token Ring */ {25, 65535, "IPv[46] MTU"} /* The IPv[46] Maximum MTU */ }; static const pmtud_L2_t *L2_1454 = &L2[9]; static const pmtud_L2_t *L2_1500 = &L2[12]; static const int L2_cnt = sizeof(L2) / sizeof(pmtud_L2_t); #define TRACE_OPT_DPORT 1 #define TRACE_OPT_FIRSTHOP 2 #define TRACE_OPT_GAPLIMIT 3 #define TRACE_OPT_GAPACTION 4 #define TRACE_OPT_LOOPS 5 #define TRACE_OPT_MAXTTL 7 #define TRACE_OPT_PMTUD 8 #define TRACE_OPT_PAYLOAD 9 #define TRACE_OPT_PROTOCOL 10 #define TRACE_OPT_ATTEMPTS 11 #define TRACE_OPT_ALLATTEMPTS 12 #define TRACE_OPT_SPORT 13 #define TRACE_OPT_TOS 14 #define TRACE_OPT_TTLDST 15 #define TRACE_OPT_USERID 16 #define TRACE_OPT_WAIT 17 #define TRACE_OPT_SRCADDR 18 #define TRACE_OPT_CONFIDENCE 19 #define TRACE_OPT_WAITPROBE 20 #define TRACE_OPT_GSSENTRY 21 #define TRACE_OPT_LSSNAME 22 #define TRACE_OPT_OFFSET 23 #define TRACE_OPT_OPTION 24 static const scamper_option_in_t opts[] = { {'c', NULL, TRACE_OPT_CONFIDENCE, SCAMPER_OPTION_TYPE_NUM}, {'d', NULL, TRACE_OPT_DPORT, SCAMPER_OPTION_TYPE_STR}, {'f', NULL, TRACE_OPT_FIRSTHOP, SCAMPER_OPTION_TYPE_NUM}, {'g', NULL, TRACE_OPT_GAPLIMIT, SCAMPER_OPTION_TYPE_NUM}, {'G', NULL, TRACE_OPT_GAPACTION, SCAMPER_OPTION_TYPE_NUM}, {'l', NULL, TRACE_OPT_LOOPS, SCAMPER_OPTION_TYPE_NUM}, {'m', NULL, TRACE_OPT_MAXTTL, SCAMPER_OPTION_TYPE_NUM}, {'M', NULL, TRACE_OPT_PMTUD, SCAMPER_OPTION_TYPE_NULL}, {'o', NULL, TRACE_OPT_OFFSET, SCAMPER_OPTION_TYPE_NUM}, {'O', NULL, TRACE_OPT_OPTION, SCAMPER_OPTION_TYPE_STR}, {'p', NULL, TRACE_OPT_PAYLOAD, SCAMPER_OPTION_TYPE_STR}, {'P', NULL, TRACE_OPT_PROTOCOL, SCAMPER_OPTION_TYPE_STR}, {'q', NULL, TRACE_OPT_ATTEMPTS, SCAMPER_OPTION_TYPE_NUM}, {'Q', NULL, TRACE_OPT_ALLATTEMPTS, SCAMPER_OPTION_TYPE_NULL}, {'s', NULL, TRACE_OPT_SPORT, SCAMPER_OPTION_TYPE_NUM}, {'S', NULL, TRACE_OPT_SRCADDR, SCAMPER_OPTION_TYPE_STR}, {'t', NULL, TRACE_OPT_TOS, SCAMPER_OPTION_TYPE_NUM}, {'T', NULL, TRACE_OPT_TTLDST, SCAMPER_OPTION_TYPE_NULL}, {'U', NULL, TRACE_OPT_USERID, SCAMPER_OPTION_TYPE_NUM}, {'w', NULL, TRACE_OPT_WAIT, SCAMPER_OPTION_TYPE_NUM}, {'W', NULL, TRACE_OPT_WAITPROBE, SCAMPER_OPTION_TYPE_NUM}, {'z', NULL, TRACE_OPT_GSSENTRY, SCAMPER_OPTION_TYPE_STR}, {'Z', NULL, TRACE_OPT_LSSNAME, SCAMPER_OPTION_TYPE_STR}, }; static const int opts_cnt = SCAMPER_OPTION_COUNT(opts); const char *scamper_do_trace_usage(void) { return "trace [-MQT] [-c confidence] [-d dport] [-f firsthop]\n" " [-g gaplimit] [-G gapaction] [-l loops]\n" " [-m maxttl] [-o offset] [-O options] [-p payload] [-P method]\n" " [-q attempts] [-s sport] [-S srcaddr] [-t tos] [-U userid]\n" " [-w wait-timeout] [-W wait-probe] [-z gss-entry] [-Z lss-name]"; } static scamper_trace_t *trace_getdata(const scamper_task_t *task) { return scamper_task_getdata(task); } static trace_state_t *trace_getstate(const scamper_task_t *task) { return scamper_task_getstate(task); } static int k(trace_state_t *state) { /* * number of probes (k) to send to rule out a load-balancer having n hops; * 95% confidence level first from 823-augustin-e2emon.pdf, then extended * with gmp-based code. * 99% confidence derived with gmp-based code. */ static const int k[][2] = { { 0, 0 }, { 0, 0 }, { 6, 8 }, /* n=2 : +6, +8 */ { 11, 15 }, /* n=3 : +5, +7 */ { 16, 21 }, /* n=4 : +5, +6 */ { 21, 28 }, /* n=5 : +5, +7 */ { 27, 36 }, /* n=6 : +6, +8 */ { 33, 43 }, /* n=7 : +6, +7 */ { 38, 51 }, /* n=8 : +5, +8 */ { 44, 58 }, /* n=9 : +6, +7 */ { 51, 66 }, /* n=10 : +7, +8 */ { 57, 74 }, /* n=11 : +6, +8 */ { 63, 82 }, /* n=12 : +6, +8 */ { 70, 90 }, /* n=13 : +7, +8 */ { 76, 98 }, /* n=14 : +6, +8 */ { 83, 106 }, /* n=15 : +7, +8 */ { 90, 115 }, /* n=16 : +7, +9 */ { 96, 123 }, /* n=17 : +6, +8 */ { 103, 132 }, /* n=18 : +7, +9 */ { 110, 140 }, /* n=19 : +7, +8 */ { 117, 149 }, /* n=20 : +7, +9 */ { 124, 157 }, /* n=21 */ { 131, 166 }, /* n=22 */ { 138, 175 }, /* n=23 */ { 145, 183 }, /* n=24 */ { 152, 192 }, /* n=25 */ }; #define TRACE_CONFIDENCE_MAX_N 25 assert(state->confidence < 2); assert(state->n >= 2); assert(state->n <= TRACE_CONFIDENCE_MAX_N); return k[state->n][state->confidence]; } /* * trace_queue * * the task is ready to be probed again. put it in a queue to wait a little * longer, or put it into the queue to be probed asap. */ static int trace_queue(scamper_task_t *task) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); struct timeval tv; assert(state->attempt < trace->attempts || trace->confidence != 0); if(trace->wait_probe == 0) return scamper_task_queue_probe(task); gettimeofday_wrap(&tv); if(timeval_cmp(&state->next_tx, &tv) <= 0) return scamper_task_queue_probe(task); return scamper_task_queue_wait_tv(task, &state->next_tx); } static int trace_gss_add(scamper_trace_dtree_t *dtree, scamper_addr_t *addr) { dtree->gss[dtree->gssc++] = scamper_addr_use(addr); return 0; } static void trace_lss_free(trace_lss_t *lss) { if(lss == NULL) return; if(lss->name != NULL) free(lss->name); if(lss->tree != NULL) splaytree_free(lss->tree, (splaytree_free_t)scamper_addr_free); free(lss); return; } static int trace_lss_cmp(const trace_lss_t *a, const trace_lss_t *b) { return strcasecmp(a->name, b->name); } static trace_lss_t *trace_lss_get(char *name) { trace_lss_t findme, *lss; /* allocate a local stop set tree if necessary */ if(lsses == NULL && (lsses = splaytree_alloc((splaytree_cmp_t)trace_lss_cmp)) == NULL) { printerror(__func__, "could not allocate lss"); return NULL; } findme.name = name; if((lss = splaytree_find(lsses, &findme)) != NULL) return lss; if((lss = malloc_zero(sizeof(trace_lss_t))) == NULL || (lss->name = strdup(name)) == NULL || (lss->tree = splaytree_alloc((splaytree_cmp_t)scamper_addr_cmp))==NULL || (lss->node = splaytree_insert(lsses, lss)) == NULL) { trace_lss_free(lss); return NULL; } return lss; } /* * pmtud_L2_set_probesize * * given the lower and upper values of the PMTU search, suggest a packet * size to probe next. apply a few heuristics to the search to try and * find the PMTU to the next node faster. */ static void pmtud_L2_set_probesize(trace_state_t *state, int lower, int upper) { pmtud_L2_state_t *l2; int idx, size; /* callers should detect end of L2 search before calling this function */ assert(lower + 1 != upper); /* make sure there is a L2 structure there */ assert(state->pmtud != NULL); assert(state->pmtud->L2 != NULL); l2 = state->pmtud->L2; /* make sure the L2->idx parameter has been set (to something reasonable) */ idx = l2->idx; assert(idx >= 0); assert(idx < L2_cnt); /* make sure the suggested window size is within the current window */ assert(l2->lower == -1 || lower >= l2->lower); assert(l2->upper == -1 || upper <= l2->upper); /* * if we've narrowed it down to between two entries in the L2 table, * then try one byte higher than the lower, as there's a fair chance * the underlying mtu will be L2[idx].mtu. * * we make an exception if the lower bounds is Ethernet: there exists * a strong possibility the underlying MTU is Ethernet, and the cost * of guessing wrong [i.e. getting an unexpected response] is small. */ if(lower == 1500 || (lower == L2[idx].mtu && upper <= L2[idx+1].mtu)) { size = lower + 1; } /* * if there is a media MTU higher than the current lower bounds that * is smaller than the upper bounds, then try it */ else if(lower >= L2[idx].mtu && L2[idx+1].mtu < upper) { size = L2[++idx].mtu; } /* * if we did not get a response to the last media MTU probe, and there * is a smaller known media MTU to try, then try it now */ else if(upper == L2[idx].mtu && lower < L2[idx-1].mtu) { size = L2[--idx].mtu; } /* * scamper is operating between two known MTU types, do a binary chop */ else { size = (lower + upper) / 2; } state->attempt = 0; state->payload_size = size - state->header_size; l2->idx = idx; l2->lower = lower; l2->upper = upper; return; } /* * pmtud_L2_init * * utility to search the L2 table for a suitable initial probe size, based * on known [to scamper] L2 media MTUs in relation to the last probe sent that * went unacknowledged. */ static int pmtud_L2_init(trace_state_t *state) { pmtud_L2_state_t *l2; int size = state->header_size + state->payload_size; int idx; /* * if the probe that was not answered is > 1500 bytes and scamper has * not got a response to a packet 1500 bytes or larger yet, then * forcibly try the ethernet MTU next, as the chances are good that the * media will be plain old ethernet. */ if(size > 1500) { idx = L2_1500->idx; } /* * if the probe that was not answered is > 1454 bytes, then forcibly try * the lower bounds of X-over-ethernet types. */ else if(size > 1454) { idx = L2_1454->idx; } else { for(idx=0; idx L2[idx].mtu && size <= L2[idx+1].mtu) { break; } } } if((l2 = malloc_zero(sizeof(pmtud_L2_state_t))) == NULL) { printerror(__func__, "could not malloc L2"); return -1; } l2->idx = idx; l2->lower = -1; l2->upper = size; l2->in = size; l2->out = -1; state->pmtud->L2 = l2; state->payload_size = L2[idx].mtu - state->header_size; state->attempt = 0; return 0; } /* * pmtud_TTL_set_probettl * * return: 0 if there are no more TTLs to probe, 1 if probing should continue */ static int pmtud_TTL_set_probettl(scamper_task_t *task, const int lower, int upper) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); int cur; assert(state->pmtud->TTL != NULL); /* check to see if we have to do any more TTL searching */ while(lower + 1 < upper) { /* halve the TTL space */ cur = (lower + upper) / 2; /* * check to see if experience at soliciting a TTL expired message has * been good. skip TTLs that have been non-responsive */ while(cur < upper && trace->hops[cur-1] == NULL) { cur++; } /* scamper got a suitable TTL probe value, so we are done */ if(cur != upper) { state->pmtud->TTL->lower = lower; state->pmtud->TTL->upper = upper; state->ttl = cur; state->attempt = 0; return 1; } /* * there are no TTLs above the half-way point to probe for, so try for * ones lower */ upper = (lower + upper) / 2; } return 0; } /* * hop_find * * check to see if there is any other hop in the trace with the * same address */ static scamper_trace_hop_t *hop_find(const scamper_trace_t *trace, const scamper_addr_t *addr) { scamper_trace_hop_t *hop; uint16_t i; for(i=trace->firsthop-1; ihop_count; i++) { for(hop = trace->hops[i]; hop != NULL; hop = hop->hop_next) { if(scamper_addr_cmp(hop->hop_addr, addr) == 0) { return hop; } } } return NULL; } /* * pmtud_TTL_init * * initialise the bounds of a TTL search */ static int pmtud_TTL_init(scamper_task_t *task) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); scamper_trace_hop_t *hop; int lower, upper; if((state->pmtud->TTL = malloc_zero(sizeof(pmtud_TTL_state_t))) == NULL) { printerror(__func__, "could not malloc TTL"); return -1; } /* * the packet size that is dropped silently is the size we are * doing a TTL limited search with */ state->payload_size = state->pmtud->L2->in - state->header_size; /* * use the last ICMP fragmentation required message recorded in the * path MTU discovery phase to infer a suitable lower-bound for inferring * the range of TTLs that could be responsible for not sending an ICMP * fragmentation required message */ hop = state->pmtud->last_fragmsg; if(hop == NULL || (lower = hop->hop_probe_ttl - hop->hop_icmp_q_ttl) < 1) lower = 0; /* * the upper bound of TTLs to search is set by closest response past * the hop that sends nothing */ if((hop = hop_find(trace, state->pmtud->L2->hop->hop_addr)) != NULL) { upper = hop->hop_probe_ttl; } else { hop = state->pmtud->L2->hop; upper = hop->hop_probe_ttl - hop->hop_icmp_q_ttl + 1; } /* if the TTL limited search is a null operation, then say so */ if(pmtud_TTL_set_probettl(task, lower, upper) == 0) { return 0; } return 1; } /* * pmtud_hopins * * take the hop structure and put it into the list of hops at the end. */ static void pmtud_hopins(scamper_task_t *task, scamper_trace_hop_t *hop) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); assert(hop != NULL); assert(hop->hop_next == NULL); if(state->pmtud->last_hop == NULL) trace->pmtud->hops = hop; else state->pmtud->last_hop->hop_next = hop; state->pmtud->last_hop = hop; return; } /* * pmtu_L2_search_end * * scamper has had to infer the underlying next-hop MTU due to a pmtud * fault. given the hop used to infer the nhmtu, insert that into the * trace and tidy up. */ static int pmtud_L2_search_end(scamper_task_t *task) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); scamper_trace_pmtud_n_t *note; scamper_trace_hop_t *hop; uint16_t out; assert(state->pmtud->L2 != NULL); assert(state->pmtud->L2->out >= 0); assert(state->pmtud->L2->out <= 65535); out = state->pmtud->L2->out; hop = state->pmtud->L2->hop; /* don't need the L2 struct anymore */ free(state->pmtud->L2); state->pmtud->L2 = NULL; note = state->pmtud->note; note->nhmtu = out; scamper_trace_pmtud_n_add(trace->pmtud, note); state->pmtud->note = NULL; /* * copy details of the TTL-expired message furthest into the path * into the trace if there is one to copy */ if(state->pmtud->TTL != NULL) { if(state->pmtud->TTL->hop != NULL) { /* * if there is a TTL search, then the note wants to have the * farthest hop into the path to annotate where the silence begins. */ note->hop = state->pmtud->TTL->hop; } else if(state->pmtud->TTL->lower == 0) { /* * if there was no TTL response with the large packet from anywhere * in the path, and the lowest TTL tried was zero, then we infer * that the host itself has an MTU mismatch with the particular * router it is using for the destination */ trace->pmtud->outmtu = out; } free(state->pmtud->TTL); state->pmtud->TTL = NULL; } if(hop != NULL) { /* * copy details of the hop to terminate the largest probe into * the pmtu struct. hops between the TTL expired message (if we * have one) and the ICMP unreach message have their PMTU inferred */ state->pmtud->last_fragmsg = hop; /* * if the hop that we last recorded is a hop message that would * ordinarily have caused scamper to stop PMTU discovery, then * stop it now */ if(!SCAMPER_TRACE_HOP_IS_ICMP_PTB(hop)) { trace->pmtud->pmtu = hop->hop_probe_size; scamper_task_queue_done(task, 0); return 1; } } state->payload_size = out - state->header_size; state->mode = MODE_PMTUD_DEFAULT; state->attempt = 0; state->ttl = 255; return 0; } static int dtree_lss_add(trace_state_t *state, scamper_addr_t *iface) { assert(state != NULL && state->lsst != NULL); if(splaytree_insert(state->lsst->tree, iface) != NULL) { scamper_addr_use(iface); return 0; } return -1; } static int dtree_lss_in(trace_state_t *state, scamper_addr_t *iface) { assert(state != NULL && state->lsst != NULL); if(splaytree_find(state->lsst->tree, iface) != NULL) return 1; return 0; } static int state_lss_in(trace_state_t *state, scamper_addr_t *iface) { if(array_find((void **)state->lss, state->lssc, iface, (array_cmp_t)scamper_addr_cmp) != NULL) { return 1; } return 0; } static int state_lss_add(trace_state_t *state, scamper_addr_t *iface) { if(array_insert((void ***)&state->lss, &state->lssc, iface, (array_cmp_t)scamper_addr_cmp) == 0) { return 0; } return -1; } /* * trace_ipid_fudge * * play games with the embedded IP ID, which may come back with a different * IP ID than what was sent; return the ID of the corresponding probe in *id. * this code was inspired by information from David Malone. * * the IPID transmitted is assigned from a counter (state->id_next) which * starts from one -- *not* zero. this is so systems that zero the IPID * will not confuse this algorithm. * * the IPID is transmitted by scamper in network byte order. * */ static int trace_ipid_fudge(const trace_state_t *state, const uint16_t ipid, uint16_t *id) { /* ensure the IP ID is not zero */ if(ipid == 0) { return -1; } /* check if the IP ID is in range */ if(ipid <= state->id_next) { *id = ipid - 1; return 0; } /* check if the IP ID was incremented */ if(ipid == state->id_next + 1) { scamper_debug(__func__, "ip id one greater than sent"); *id = ipid - 2; return 0; } /* check if the IP ID was byte swapped. XXX: is this correct? */ if(byteswap16(ipid) <= state->id_next) { scamper_debug(__func__, "ip id byte swapped"); *id = byteswap16(ipid) - 1; return 0; } return -1; } /* * trace_stop * * set the trace's stop parameters to whatever it is passed */ static void trace_stop(scamper_trace_t *trace, const uint8_t reason, const uint8_t data) { /* if we've already set a stop reason, then don't clobber it */ if(trace->stop_reason != SCAMPER_TRACE_STOP_NONE) { scamper_debug(__func__, "reason %d/%d precedes %d/%d", trace->stop_reason, trace->stop_data, reason, data); return; } trace->stop_reason = reason; trace->stop_data = data; return; } static void trace_stop_completed(scamper_trace_t *trace) { trace_stop(trace, SCAMPER_TRACE_STOP_COMPLETED, 0); return; } static void trace_stop_gaplimit(scamper_trace_t *trace) { trace_stop(trace, SCAMPER_TRACE_STOP_GAPLIMIT, 0); return; } static void trace_stop_error(scamper_trace_t *trace, int error) { trace_stop(trace, SCAMPER_TRACE_STOP_ERROR, error); return; } static void trace_stop_hoplimit(scamper_trace_t *trace) { trace_stop(trace, SCAMPER_TRACE_STOP_HOPLIMIT, 0); return; } /* * trace_isloop * * given a trace and a hop record, determine if there is a loop. */ static int trace_isloop(const scamper_trace_t *trace, const scamper_trace_hop_t *hop, trace_state_t *state) { scamper_trace_hop_t *tmp; int i; /* need at least a couple of probes first */ if(hop->hop_probe_ttl <= trace->firsthop) return 0; /* * check to see if the address has already been seen this hop; if it is, * then we've already checked this address for loops so we don't need to * check it again. */ for(tmp = trace->hops[hop->hop_probe_ttl-1]; tmp != hop; tmp = tmp->hop_next) if(scamper_addr_cmp(hop->hop_addr, tmp->hop_addr) == 0) return 0; /* compare all hop records until the hop prior to this one */ for(i=trace->firsthop-1; ihop_count; i++) { /* skip over hops at the same distance as the one we are comparing to */ if(i == hop->hop_probe_ttl-1) continue; for(tmp = trace->hops[i]; tmp != NULL; tmp = tmp->hop_next) { assert(i+1 == tmp->hop_probe_ttl); /* if the addresses match, then there is a loop */ if(scamper_addr_cmp(hop->hop_addr, tmp->hop_addr) == 0) { /* * if the loop is between adjacent hops, continue probing. * scamper used to only allow zero-ttl forwarding * (tmp->hop_icmp_q_ttl == 0 && hop->hop_icmp_q_ttl == 1) * but in 2015 there are prevalent loops between * adjacent hops where that condition halts probing too soon */ if(tmp->hop_probe_ttl + 1 == hop->hop_probe_ttl || tmp->hop_probe_ttl - 1 == hop->hop_probe_ttl) return 0; /* check if the loop condition is met */ state->loopc++; if(state->loopc >= trace->loops) return 1; /* count the loop just once for this hop */ break; } } if(tmp != NULL) break; } return 0; } /* * trace_hopins * * insert the hop record into the hop list at the appropriate place */ static void trace_hopins(scamper_trace_hop_t **hops, scamper_trace_hop_t *hop) { scamper_trace_hop_t *pre, *cur; assert(hops != NULL); assert(hop != NULL); /* insert at head if no other hop recorded */ if((cur = *hops) == NULL) { *hops = hop; hop->hop_next = NULL; return; } /* search for the place to insert this hop record */ pre = NULL; while(cur != NULL && cur->hop_probe_id <= hop->hop_probe_id) { pre = cur; cur = cur->hop_next; } /* the place to insert is at the head of the list */ if(pre == NULL) { assert(hop->hop_probe_id < cur->hop_probe_id); *hops = hop; } else { pre->hop_next = hop; } hop->hop_next = cur; return; } /* * trace_handlerror * * the code encountered some error when doing the traceroute, so stop the * trace now. */ static int trace_handleerror(scamper_task_t *task, const int error) { trace_stop_error(trace_getdata(task), error); scamper_task_queue_done(task, 0); return 0; } /* * trace_hop * * this function creates a generic hop record with the basic details from * the probe structure copied in, as well as an address based on the details * passed in */ static scamper_trace_hop_t *trace_hop(const trace_probe_t *probe, const int af, const void *addr) { scamper_trace_hop_t *hop = NULL; int type; /* determine the scamper address type to use from the address family */ if(af == AF_INET) type = SCAMPER_ADDR_TYPE_IPV4; else if(af == AF_INET6) type = SCAMPER_ADDR_TYPE_IPV6; else goto err; if((hop = scamper_trace_hop_alloc()) == NULL) { printerror(__func__, "could not alloc hop"); goto err; } if((hop->hop_addr = scamper_addrcache_get(addrcache, type, addr)) == NULL) { printerror(__func__, "could not get addr"); goto err; } hop->hop_probe_ttl = probe->ttl; hop->hop_probe_id = probe->id + 1; hop->hop_probe_size = probe->size; /* * if the probe's datalink tx timestamp flag is set, scamper has a tx * timestamp recorded */ if(probe->flags & TRACE_PROBE_FLAG_DL_TX) hop->hop_flags |= SCAMPER_TRACE_HOP_FLAG_TS_DL_TX; return hop; err: if(hop != NULL) scamper_trace_hop_free(hop); return NULL; } /* * trace_icmp_hop * * given a trace probe and an ICMP response, allocate and initialise a * scamper_trace_hop record. */ static scamper_trace_hop_t *trace_icmp_hop(scamper_trace_t *trace, trace_probe_t *probe, scamper_icmp_resp_t *ir) { scamper_trace_hop_t *hop = NULL; scamper_addr_t addr; /* get a pointer to the source address of the ICMP response */ if(scamper_icmp_resp_src(ir, &addr) != 0) goto err; /* create a generic hop record without any special bits filled out */ if((hop = trace_hop(probe, ir->ir_af, addr.addr)) == NULL) goto err; /* fill out the basic bits of the hop structure */ hop->hop_reply_size = ir->ir_ip_size; hop->hop_icmp_type = ir->ir_icmp_type; hop->hop_icmp_code = ir->ir_icmp_code; /* * we cannot depend on the TTL field of the IP packet being made available, * so we signal explicitly when the reply ttl is valid */ if(ir->ir_ip_ttl != -1) { hop->hop_reply_ttl = (uint8_t)ir->ir_ip_ttl; hop->hop_flags |= SCAMPER_TRACE_HOP_FLAG_REPLY_TTL; } /* * if the probe's datalink rx timestamp flag is set, scamper has a rx * timestamp recorded */ if(probe->flags & TRACE_PROBE_FLAG_DL_RX) { hop->hop_flags |= SCAMPER_TRACE_HOP_FLAG_TS_DL_RX; timeval_diff_tv(&hop->hop_rtt, &probe->tx_tv, &probe->rx_tv); } else { timeval_diff_tv(&hop->hop_rtt, &probe->tx_tv, &ir->ir_rx); if(ir->ir_flags & SCAMPER_ICMP_RESP_FLAG_KERNRX) { hop->hop_flags |= SCAMPER_TRACE_HOP_FLAG_TS_SOCK_RX; } } /* copy the probe timestamp over */ timeval_cpy(&hop->hop_tx, &probe->tx_tv); if(SCAMPER_ICMP_RESP_IS_PACKET_TOO_BIG(ir)) hop->hop_icmp_nhmtu = ir->ir_icmp_nhmtu; if(ir->ir_af == AF_INET) { hop->hop_reply_ipid = ir->ir_ip_id; hop->hop_reply_tos = ir->ir_ip_tos; } if(SCAMPER_ICMP_RESP_INNER_IS_SET(ir)) { hop->hop_icmp_q_ttl = ir->ir_inner_ip_ttl; hop->hop_icmp_q_ipl = ir->ir_inner_ip_size; /* * IPv4: record ToS byte * IPv6: might pay to record traffic class byte here. */ if(ir->ir_af == AF_INET) hop->hop_icmp_q_tos = ir->ir_inner_ip_tos; } /* if ICMP extensions are included, then parse and include them. */ if(ir->ir_ext != NULL && scamper_icmpext_parse(&hop->hop_icmpext,ir->ir_ext,ir->ir_extlen) != 0) { goto err; } /* record the fact that we have a hop record thanks to this probe */ if(probe->rx != 65535) probe->rx++; return hop; err: if(hop != NULL) scamper_trace_hop_free(hop); return NULL; } static scamper_trace_hop_t *trace_dl_hop(trace_probe_t *pr,scamper_dl_rec_t *dl) { scamper_trace_hop_t *hop = NULL; /* create a generic hop record without any special bits filled out */ if((hop = trace_hop(pr, dl->dl_af, dl->dl_ip_src)) == NULL) goto err; /* fill out the basic bits of the hop structure */ hop->hop_reply_size = dl->dl_ip_size; hop->hop_reply_ttl = dl->dl_ip_ttl; hop->hop_flags |= (SCAMPER_TRACE_HOP_FLAG_REPLY_TTL | SCAMPER_TRACE_HOP_FLAG_TS_DL_RX); timeval_cpy(&hop->hop_tx, &pr->tx_tv); timeval_diff_tv(&hop->hop_rtt, &pr->tx_tv, &dl->dl_tv); if(dl->dl_af == AF_INET) { hop->hop_reply_ipid = dl->dl_ip_id; hop->hop_reply_tos = dl->dl_ip_tos; } if(dl->dl_ip_proto == IPPROTO_TCP) { hop->hop_tcp_flags = dl->dl_tcp_flags; hop->hop_flags |= SCAMPER_TRACE_HOP_FLAG_TCP; } else if(dl->dl_ip_proto == IPPROTO_UDP) { hop->hop_flags |= SCAMPER_TRACE_HOP_FLAG_UDP; } return hop; err: if(hop != NULL) scamper_trace_hop_free(hop); return NULL; } /* * trace_next_mode * * if the trace is going into another mode, this function figures out * which mode to put it into */ static void trace_next_mode(scamper_task_t *task) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); uint16_t ifmtu; int ifindex; if(SCAMPER_TRACE_IS_DOUBLETREE(trace)) { if(state->mode == MODE_DTREE_FWD) { if(trace->firsthop > 1 && (trace->dtree->flags & SCAMPER_TRACE_DTREE_FLAG_NOBACK) == 0) { state->mode = MODE_DTREE_BACK; state->ttl = trace->firsthop - 1; state->attempt = 0; trace_queue(task); } else goto done; } else if(state->mode == MODE_DTREE_BACK) goto done; return; } /* XXX clean up the rest of this function */ if(SCAMPER_TRACE_IS_PMTUD(trace) == 0 || trace->stop_reason == SCAMPER_TRACE_STOP_HOPLIMIT || trace->stop_reason == SCAMPER_TRACE_STOP_GAPLIMIT || trace->stop_reason == SCAMPER_TRACE_STOP_LOOP || trace->stop_reason == SCAMPER_TRACE_STOP_NONE) goto done; /* if the interface's MTU is useless, then we can't do PMTUD */ scamper_fd_ifindex(state->dl, &ifindex); if(scamper_if_getmtu(ifindex, &ifmtu) == -1 || ifmtu <= state->header_size) goto done; if(scamper_trace_pmtud_alloc(trace) != 0) goto done; if((state->pmtud = malloc_zero(sizeof(trace_pmtud_state_t))) == NULL) goto done; trace->pmtud->ifmtu = ifmtu; trace->pmtud->ver = 2; state->attempt = 0; state->mode = MODE_PMTUD_DEFAULT; state->payload_size = ifmtu - state->header_size; state->ttl = 255; trace_queue(task); return; done: scamper_task_queue_done(task, 0); return; } /* * trace_stop_reason * * check to see if we have a stop condition based on the hop record */ static void trace_stop_reason(scamper_trace_t *trace, scamper_trace_hop_t *hop, trace_state_t *state, uint8_t *stop_reason, uint8_t *stop_data) { int rc; /* * the message received is an ICMP port unreachable -- something that * the destination should have sent. make sure the port unreachable * message makes sense based on the traceroute type. */ if(SCAMPER_TRACE_HOP_IS_ICMP_UNREACH_PORT(hop) && (SCAMPER_TRACE_TYPE_IS_UDP(trace) || SCAMPER_TRACE_TYPE_IS_TCP(trace))) { *stop_reason = SCAMPER_TRACE_STOP_COMPLETED; *stop_data = 0; } else if(SCAMPER_TRACE_HOP_IS_ICMP_UNREACH(hop)) { *stop_reason = SCAMPER_TRACE_STOP_UNREACH; *stop_data = hop->hop_icmp_code; } else if(SCAMPER_TRACE_HOP_IS_ICMP_ECHO_REPLY(hop)) { /* * the message received is an ICMP echo reply -- something that only * makes sense to include as part of the traceroute if the traceroute * is using echo requests. */ if(trace->type == SCAMPER_TRACE_TYPE_ICMP_ECHO || trace->type == SCAMPER_TRACE_TYPE_ICMP_ECHO_PARIS) { *stop_reason = SCAMPER_TRACE_STOP_COMPLETED; *stop_data = 0; } else { *stop_reason = SCAMPER_TRACE_STOP_NONE; *stop_data = 0; } } else if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV6 && hop->hop_icmp_type == ICMP6_PACKET_TOO_BIG) { /* * IPv6 uses a different ICMP type for packet too big messages, so * check this. */ *stop_reason = SCAMPER_TRACE_STOP_ICMP; *stop_data = hop->hop_icmp_type; } else if(trace->loops != 0 && (rc = trace_isloop(trace, hop, state)) != 0) { /* check for a loop condition */ *stop_reason = SCAMPER_TRACE_STOP_LOOP; *stop_data = 0; } else if(SCAMPER_TRACE_HOP_IS_ICMP_TTL_EXP(hop) && SCAMPER_TRACE_IS_IGNORETTLDST(trace) == 0 && scamper_addr_cmp(trace->dst, hop->hop_addr) == 0) { /* * if an ICMP TTL expired message is received from an IP address * matching the destination being probed, and the traceroute is * to stop when this occurs, then stop. */ *stop_reason = SCAMPER_TRACE_STOP_COMPLETED; *stop_data = 0; } else if(SCAMPER_TRACE_TYPE_IS_TCP(trace) && SCAMPER_TRACE_HOP_IS_TCP(hop)) { *stop_reason = SCAMPER_TRACE_STOP_COMPLETED; *stop_data = 0; } else if(SCAMPER_TRACE_IS_DOUBLETREE(trace) && scamper_trace_dtree_gss_find(trace, hop->hop_addr) != NULL) { *stop_reason = SCAMPER_TRACE_STOP_GSS; *stop_data = 0; trace->dtree->gss_stop = scamper_addr_use(hop->hop_addr); } else { *stop_reason = SCAMPER_TRACE_STOP_NONE; *stop_data = 0; } return; } /* * handleicmp_trace * * we received an ICMP response in the traceroute state. check to see * if the probe is in sequence, and adjust the trace accordingly. */ static int handleicmp_trace(scamper_task_t *task, scamper_icmp_resp_t *ir, trace_probe_t *probe) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); scamper_trace_hop_t *hop; uint8_t stop_reason; uint8_t stop_data; size_t len; assert(state->mode == MODE_TRACE || state->mode == MODE_DTREE_FWD || state->mode == MODE_DTREE_BACK); /* we should only have to deal with probes sent while in the trace state */ if(probe->mode != MODE_TRACE && probe->mode != MODE_DTREE_FWD && probe->mode != MODE_DTREE_BACK) { return 0; } /* create a hop record and insert it into the trace */ if((hop = trace_icmp_hop(trace, probe, ir)) == NULL) { return -1; } trace_hopins(&trace->hops[hop->hop_probe_ttl-1], hop); /* * if the response is not for the current working hop (i.e. a late reply) * check if probing should now halt. otherwise keep waiting. */ if(hop->hop_probe_ttl != state->ttl) { /* XXX: handle doubletree */ trace_stop_reason(trace, hop, state, &stop_reason, &stop_data); if(stop_reason != SCAMPER_TRACE_STOP_NONE) { trace_stop(trace, stop_reason, stop_data); trace_next_mode(task); } return 0; } /* * the rest of the code in this function deals with the fact this is a * reply for the current working hop. * * check if we are to send all allotted probes to the target */ if(SCAMPER_TRACE_IS_ALLATTEMPTS(trace)) { assert(trace->confidence == 0); /* * if we get an out of order reply, then we go back to waiting for * the one we just probed for */ if(probe->id+1 != state->attempt) { return 0; } /* * this response is for the last probe sent. if there are still * probes to send for this hop, then send the next one */ if(state->attempt < trace->attempts) { trace_queue(task); return 0; } } else if(trace->confidence != 0) { /* * record details of the interface, if its details are not * currently held */ if(array_find((void **)state->interfaces, state->interfacec, hop->hop_addr, (array_cmp_t)scamper_addr_cmp) == NULL) { len = (state->interfacec + 1) * sizeof(scamper_addr_t *); if(realloc_wrap((void **)&state->interfaces, len) != 0) { printerror(__func__, "could not realloc interfaces"); trace_handleerror(task, errno); return -1; } state->interfaces[state->interfacec++] = hop->hop_addr; if(state->interfacec > 1) { array_qsort((void **)state->interfaces, state->interfacec, (array_cmp_t)scamper_addr_cmp); state->n++; } } /* * make sure we know the required number of probes to send to reach * a particular confidence level */ if(state->n <= TRACE_CONFIDENCE_MAX_N) { /* * if we get an out of order reply, then we go back to waiting for * the one we just probed for */ if(probe->id+1 != state->attempt) { return 0; } /* * this response is for the last probe sent. if there are still * probes to send for this hop, then send the next one */ if(state->attempt < k(state)) { trace_queue(task); return 0; } } free(state->interfaces); state->interfaces = NULL; state->interfacec = 0; state->n = 2; } state->attempt = 0; if(state->mode == MODE_DTREE_BACK) { if(state->ttl == 1) { trace_next_mode(task); return 0; } /* * consult the local stop set to see if we should stop backwards * probing yet. */ if(state->lsst != NULL && dtree_lss_in(state, hop->hop_addr) == 0) { dtree_lss_add(state, hop->hop_addr); state_lss_add(state, hop->hop_addr); state->ttl--; trace->firsthop--; trace_queue(task); return 0; } /* * if it is in the local stop set because there is forwarding loop * in this trace, handle that. */ if(state_lss_in(state, hop->hop_addr) != 0) { state->ttl--; trace->firsthop--; trace_queue(task); return 0; } trace->dtree->lss_stop = scamper_addr_use(hop->hop_addr); trace_next_mode(task); return 0; } trace->hop_count++; state->ttl++; /* * if we're in a mode where we only care about the first response to * a probe, then check it now. the else block below handles the case * where we want a larger number of responses from a hop. */ if(trace->confidence == 0 && SCAMPER_TRACE_IS_ALLATTEMPTS(trace) == 0) { /* check to see if we have a stop reason from the ICMP response */ trace_stop_reason(trace, hop, state, &stop_reason, &stop_data); if(stop_reason != SCAMPER_TRACE_STOP_NONE) { /* did we get a stop condition out of all that? */ trace_stop(trace, stop_reason, stop_data); trace_next_mode(task); return 0; } } else { /* check all hop records for a reason to halt the trace */ hop = trace->hops[trace->hop_count-1]; assert(hop != NULL); while(hop != NULL) { trace_stop_reason(trace, hop, state, &stop_reason, &stop_data); if(stop_reason != SCAMPER_TRACE_STOP_NONE) { /* did we get a stop condition out of all that? */ trace_stop(trace, stop_reason, stop_data); trace_next_mode(task); return 0; } hop = hop->hop_next; } } /* check if we've reached the hoplimit */ if(trace->hop_count == 255 || trace->hop_count == trace->hoplimit) { /* if not, has the hop limit now reached? */ trace_stop_hoplimit(trace); trace_next_mode(task); return 0; } /* keep probing */ trace_queue(task); return 0; } /* * handleicmp_dtree_first * * handle receiving an ICMP response to the first series of doubletree * probes which aims to find the place at which to commence probing */ static int handleicmp_dtree_first(scamper_task_t *task,scamper_icmp_resp_t *ir, trace_probe_t *probe) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); scamper_trace_hop_t *hop; scamper_addr_t src; uint8_t stop_reason, stop_data; int done = 0; /* make sure the corresponding probe is one that was sent in this mode */ if(probe->mode != MODE_DTREE_FIRST) return 0; /* ignore late replies if the firsthop has been shifted back */ if(probe->ttl > trace->firsthop) return 0; assert(probe->ttl == trace->firsthop); /* get the source address of the reply */ if(scamper_icmp_resp_src(ir, &src) != 0) return -1; /* the next probe we sent will be the first attempt at it */ state->attempt = 0; /* check to see if the distance should be reduced */ if(SCAMPER_ICMP_RESP_IS_UNREACH(ir) || SCAMPER_ICMP_RESP_IS_PACKET_TOO_BIG(ir) || SCAMPER_ICMP_RESP_IS_ECHO_REPLY(ir) || scamper_addr_cmp(trace->dst, &src) == 0) { /* halve the probe ttl if that can be done */ if(probe->ttl > 1) { trace->firsthop /= 2; state->ttl = trace->firsthop; trace_queue(task); return 0; } assert(probe->ttl == 1); /* got response which can't be probed past at first hop. we're done */ done = 1; } /* create a hop record and insert it into the trace */ if((hop = trace_icmp_hop(trace, probe, ir)) == NULL) { return -1; } trace_hopins(&trace->hops[hop->hop_probe_ttl-1], hop); /* this many hops */ trace->hop_count = hop->hop_probe_ttl; /* if we are done (can't probe beyond first hop) then finish */ if(done != 0) { trace->firsthop = 1; trace_stop_reason(trace, hop, state, &stop_reason, &stop_data); assert(stop_reason != SCAMPER_TRACE_STOP_NONE); trace_stop(trace, stop_reason, stop_data); scamper_task_queue_done(task, 0); return 0; } /* * if the response comes from an address not in the global stop set, * then probe forward */ if(scamper_trace_dtree_gss_find(trace, hop->hop_addr) == NULL) { state->ttl = hop->hop_probe_ttl + 1; state->mode = MODE_DTREE_FWD; trace_queue(task); return 0; } /* hit something in the global stop set. probe backwards */ trace->stop_reason = SCAMPER_TRACE_STOP_GSS; trace->stop_data = 0; trace->dtree->gss_stop = scamper_addr_use(hop->hop_addr); /* can't probe backwards, so we're done */ if(trace->firsthop == 1 || (trace->dtree->flags & SCAMPER_TRACE_DTREE_FLAG_NOBACK) != 0) { scamper_task_queue_done(task, 0); return 0; } /* backwards probing */ state->ttl = trace->firsthop - 1; state->mode = MODE_DTREE_BACK; trace_queue(task); return 0; } /* * handleicmp_lastditch * * we received an ICMP response while checking if the end-host is * responsive. */ static int handleicmp_lastditch(scamper_task_t *task, scamper_icmp_resp_t *ir, trace_probe_t *probe) { scamper_trace_t *trace = trace_getdata(task); scamper_trace_hop_t *hop; if(probe->mode == MODE_TRACE) { /* record the response in the trace */ if((hop = trace_icmp_hop(trace, probe, ir)) == NULL) { return -1; } trace_hopins(&trace->hops[hop->hop_probe_ttl-1], hop); } else if(probe->mode == MODE_LASTDITCH) { if((hop = trace_icmp_hop(trace, probe, ir)) == NULL) { return -1; } trace_hopins(&trace->lastditch, hop); trace_stop_gaplimit(trace); scamper_task_queue_done(task, 0); } return 0; } static int handleicmp_pmtud_default(scamper_task_t *task, scamper_icmp_resp_t *ir, trace_probe_t *probe) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); scamper_trace_hop_t *hop; scamper_trace_pmtud_n_t *note; /* * if the response is for a probe that fits with the current * probing details, then record it */ if(probe->mode != MODE_PMTUD_DEFAULT) return 0; if(probe->size != state->header_size + state->payload_size) return 0; if((hop = trace_icmp_hop(trace, probe, ir)) == NULL) return -1; pmtud_hopins(task, hop); state->pmtud->last_fragmsg = hop; if(SCAMPER_ICMP_RESP_IS_PACKET_TOO_BIG(ir)) { if((note = scamper_trace_pmtud_n_alloc()) == NULL) { printerror(__func__, "could not alloc note"); return -1; } note->hop = hop; /* PTB has no useful NHMTU */ if(ir->ir_icmp_nhmtu == 0 || ir->ir_icmp_nhmtu >= probe->size) { note->type = SCAMPER_TRACE_PMTUD_N_TYPE_PTB_BAD; state->pmtud->note = note; state->mode = MODE_PMTUD_BADSUGG; pmtud_L2_init(state); trace_queue(task); return 0; } scamper_trace_pmtud_n_add(trace->pmtud, note); if(ir->ir_icmp_nhmtu < state->header_size) { /* stop if the PTB has an MTU that is too small to be probed */ note->type = SCAMPER_TRACE_PMTUD_N_TYPE_PTB_BAD; scamper_task_queue_done(task, 0); } else { note->type = SCAMPER_TRACE_PMTUD_N_TYPE_PTB; note->nhmtu = ir->ir_icmp_nhmtu; state->attempt = 0; state->payload_size = ir->ir_icmp_nhmtu - state->header_size; trace_queue(task); } } else if(SCAMPER_ICMP_RESP_IS_TTL_EXP(ir) || SCAMPER_ICMP_RESP_IS_UNREACH(ir) || SCAMPER_ICMP_RESP_IS_ECHO_REPLY(ir)) { trace->pmtud->pmtu = probe->size; scamper_task_queue_done(task, 0); } return 0; } static int handleicmp_pmtud_silent_L2(scamper_task_t *task, scamper_icmp_resp_t *ir, trace_probe_t *probe) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); pmtud_L2_state_t *l2; scamper_trace_hop_t *hop; assert(state->pmtud->L2 != NULL); l2 = state->pmtud->L2; /* * if we get a response that is out of the bounds we are searching, it * could be a delayed message. at the moment, we just ignore the response. */ if(probe->size < l2->lower || l2->upper <= probe->size) { scamper_debug(__func__, "L2 search %d < %d || %d <= %d", probe->size, l2->lower, l2->upper, probe->size); return 0; } /* record the hop details */ if((hop = trace_icmp_hop(trace, probe, ir)) == NULL) return -1; pmtud_hopins(task, hop); l2->hop = hop; /* * if there is still space to search, reduce the search space and send * another probe */ if(probe->size + 1 != l2->upper) { /* * raise the lower bounds of our search based on successfully * receiving a response for a given packet size. */ pmtud_L2_set_probesize(state, probe->size, l2->upper); } else { l2->lower = l2->out = probe->size; if(pmtud_TTL_init(task) == 1) { state->mode = MODE_PMTUD_SILENT_TTL; } else { scamper_task_queue_done(task, 0); return 0; } } trace_queue(task); return 0; } static int handleicmp_pmtud_silent_TTL(scamper_task_t *task, scamper_icmp_resp_t *ir, trace_probe_t *probe) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); scamper_trace_hop_t *hop; /* we got a TTL expired message */ if(SCAMPER_ICMP_RESP_IS_TTL_EXP(ir)) { /* record the hop details */ if((hop = trace_icmp_hop(trace, probe, ir)) == NULL) return -1; pmtud_hopins(task, hop); assert(state->pmtud->TTL != NULL); state->pmtud->TTL->hop = hop; /* if there is no more TTL space to search, then we are done */ if(pmtud_TTL_set_probettl(task,probe->ttl,state->pmtud->TTL->upper) == 0) { /* * if we are not finished with PMTU yet, put the trace back in * the queue */ if(pmtud_L2_search_end(task) == 1) return 0; } /* put the trace back into the probe queue */ trace_queue(task); } /* * if we get a fragmentation required message during a TTL limited * search for the MTU inferred, then record the message and stop * the TTL limited search */ else if(SCAMPER_ICMP_RESP_IS_PACKET_TOO_BIG(ir) && ir->ir_icmp_nhmtu == state->pmtud->L2->out) { /* record the hop details */ if((hop = trace_icmp_hop(trace, probe, ir)) == NULL) return -1; pmtud_hopins(task, hop); state->attempt = 0; state->payload_size = ir->ir_icmp_nhmtu - state->header_size; state->ttl = 255; state->mode = MODE_PMTUD_DEFAULT; free(state->pmtud->L2); state->pmtud->L2 = NULL; free(state->pmtud->TTL); state->pmtud->TTL = NULL; /* put the trace back into the probe queue */ trace_queue(task); } return 0; } /* * handleicmp_pmtud_badsugg * * we are in the badsugg state, which is used to infer a 'correct' next-hop * mtu size when the suggested packet size is no help. */ static int handleicmp_pmtud_badsugg(scamper_task_t *task, scamper_icmp_resp_t *ir, trace_probe_t *probe) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); scamper_trace_hop_t *hop; scamper_addr_t addr; int upper, lower; if(scamper_icmp_resp_src(ir, &addr) != 0) return -1; if((hop = trace_icmp_hop(trace, probe, ir)) == NULL) return -1; pmtud_hopins(task, hop); /* * adjust the window we are searching based on where the response came * from and the size of the probe that caused the response */ if(scamper_addr_cmp(state->pmtud->last_fragmsg->hop_addr, &addr) == 0) { lower = state->pmtud->L2->lower; upper = probe->size; } else { lower = probe->size; upper = state->pmtud->L2->upper; /* replace the layer-2 hop we get a response for with this hop */ assert(state->pmtud->L2 != NULL); state->pmtud->L2->hop = hop; } if(lower + 1 != upper) { pmtud_L2_set_probesize(state, lower, upper); } else { /* terminate the search now */ state->pmtud->L2->lower = state->pmtud->L2->out = lower; state->pmtud->L2->upper = upper; /* if the pmtud is completed, then move on */ if(pmtud_L2_search_end(task) == 1) return 0; } /* put the trace back into the probe queue */ trace_queue(task); return 0; } static void do_trace_handle_icmp(scamper_task_t *task, scamper_icmp_resp_t *ir) { static int (*const func[])(scamper_task_t *, scamper_icmp_resp_t *, trace_probe_t *) = { NULL, /* MODE_RTSOCK */ NULL, /* MODE_DLHDR */ handleicmp_trace, /* MODE_TRACE */ handleicmp_lastditch, /* MODE_LASTDITCH */ handleicmp_pmtud_default, /* MODE_PMTUD_DEFAULT */ handleicmp_pmtud_silent_L2, /* MODE_PMTUD_SILENT_L2 */ handleicmp_pmtud_silent_TTL, /* MODE_PMTUD_SILENT_TTL */ handleicmp_pmtud_badsugg, /* MODE_PMTUD_BADSUGG */ handleicmp_dtree_first, /* MODE_DTREE_FIRST */ handleicmp_trace, /* MODE_DTREE_FWD */ handleicmp_trace, /* MODE_DTREE_BACK */ }; scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); uint16_t id; uint8_t proto; assert(state->mode <= MODE_MAX); /* * ignore the message if it is received on an fd that we didn't use to send * it. this is to avoid recording duplicate replies if an unbound socket * is in use. */ if(ir->ir_fd != scamper_fd_fd_get(state->icmp)) { return; } scamper_icmp_resp_print(ir); /* * if the trace is in a mode that does not handle ICMP responses, then * stop now */ if(func[state->mode] == NULL) { return; } /* if the ICMP type is not something that we care for, then drop it */ if(!((SCAMPER_ICMP_RESP_IS_TTL_EXP(ir) || SCAMPER_ICMP_RESP_IS_UNREACH(ir) || SCAMPER_ICMP_RESP_IS_PACKET_TOO_BIG(ir)) && SCAMPER_ICMP_RESP_INNER_IS_SET(ir) && trace->offset == ir->ir_inner_ip_off) && !(SCAMPER_TRACE_TYPE_IS_ICMP(trace) && SCAMPER_ICMP_RESP_IS_ECHO_REPLY(ir))) { return; } if(trace->offset != 0) { if(ir->ir_inner_data == NULL) return; if((SCAMPER_TRACE_TYPE_IS_UDP(trace) && ir->ir_inner_ip_proto != IPPROTO_UDP) || (SCAMPER_TRACE_TYPE_IS_TCP(trace) && ir->ir_inner_ip_proto != IPPROTO_TCP)) return; if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) { if(SCAMPER_TRACE_TYPE_IS_ICMP(trace) && ir->ir_inner_ip_proto != IPPROTO_ICMP) return; if(ir->ir_inner_datalen < 8) return; if(bytes_ntohs(ir->ir_inner_data+0) != trace->sport || bytes_ntohs(ir->ir_inner_data+2) != trace->dport) return; id = bytes_ntohl(ir->ir_inner_data+4); } else { if(SCAMPER_TRACE_TYPE_IS_ICMP(trace) && ir->ir_inner_ip_proto != IPPROTO_ICMPV6) return; if((ir->ir_inner_ip_id >> 16) != trace->sport) return; if(ir->ir_inner_datalen < 4) return; id = bytes_ntohl(ir->ir_inner_data); } } else if(SCAMPER_TRACE_TYPE_IS_UDP(trace)) { /* * if the ICMP response does not reference a UDP probe sent from our * source port to a destination probe we're likely to have probed, then * ignore the packet */ if(ir->ir_inner_ip_proto != IPPROTO_UDP || ir->ir_inner_udp_sport != trace->sport) { return; } if(trace->type == SCAMPER_TRACE_TYPE_UDP) { if(ir->ir_inner_udp_dport < trace->dport || ir->ir_inner_udp_dport >= trace->dport+state->id_next) { return; } /* XXX: handle wrap-around */ id = ir->ir_inner_udp_dport - trace->dport; } else if(trace->type == SCAMPER_TRACE_TYPE_UDP_PARIS) { if(ir->ir_inner_udp_dport != trace->dport) return; if(ir->ir_af == AF_INET) { if(ntohs(ir->ir_inner_udp_sum) == ir->ir_inner_ip_id && ir->ir_inner_udp_sum != 0) { id = ntohs(ir->ir_inner_udp_sum) - 1; } else if(trace_ipid_fudge(state, ir->ir_inner_ip_id, &id) != 0) { return; } } else if((trace->flags & SCAMPER_TRACE_FLAG_CONSTPAYLOAD) == 0) { if(ir->ir_inner_udp_sum == 0) return; id = ntohs(ir->ir_inner_udp_sum) - 1; } else { if(ir->ir_inner_ip_flow == 0) return; id = ir->ir_inner_ip_flow - 1; } } else return; } else if(SCAMPER_TRACE_TYPE_IS_ICMP(trace)) { if(SCAMPER_ICMP_RESP_IS_ECHO_REPLY(ir) == 0) { if(ir->ir_af == AF_INET) proto = IPPROTO_ICMP; else if(ir->ir_af == AF_INET6) proto = IPPROTO_ICMPV6; else return; if(ir->ir_inner_ip_proto != proto || ir->ir_inner_icmp_id != trace->sport || ir->ir_inner_icmp_seq >= state->id_next) { return; } id = ir->ir_inner_icmp_seq; } else { if(ir->ir_icmp_id != trace->sport || ir->ir_icmp_seq >= state->id_next) { return; } id = ir->ir_icmp_seq; } } else if(SCAMPER_TRACE_TYPE_IS_TCP(trace)) { /* * if the ICMP response does not reference a TCP probe sent from our * source port to the destination port specified then ignore the * ICMP packet */ if(SCAMPER_ICMP_RESP_INNER_IS_SET(ir) == 0 || ir->ir_inner_ip_proto != IPPROTO_TCP || ir->ir_inner_tcp_sport != trace->sport || ir->ir_inner_tcp_dport != trace->dport) { return; } if(ir->ir_af == AF_INET) { /* determine which probe id the ip id corresponds to */ if(trace_ipid_fudge(state, ir->ir_inner_ip_id, &id) != 0) return; } else { if(ir->ir_inner_ip_flow == 0) return; id = ir->ir_inner_ip_flow - 1; } } else { return; } if(id < state->id_next) { func[state->mode](task, ir, state->probes[id]); } return; } /* * timeout_trace * * this function is called if the trace timed out on the wait queue, and * all allotted attempts have been sent. */ static void timeout_trace(scamper_task_t *task) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); scamper_trace_hop_t *hop; int i, deadpath; uint8_t stop_reason, stop_data; /* we tried this hop, so move onto the next */ trace->hop_count++; state->ttl++; /* tidy up after any confidence probing */ if(state->interfaces != NULL) { free(state->interfaces); state->interfaces = NULL; state->interfacec = 0; } assert(state->interfaces == NULL); assert(state->interfacec == 0); state->n = 2; /* * if we probed for all attempts on the hop, then check to see if we * got any responses on this hop, and if we did, check to see if we * should stop probing this target yet */ if(SCAMPER_TRACE_IS_ALLATTEMPTS(trace) || trace->confidence != 0) { for(hop = trace->hops[trace->hop_count-1];hop != NULL; hop=hop->hop_next) { /* * first, check to see if there is a reason to stop probing with * this particular hop record */ trace_stop_reason(trace, hop, state, &stop_reason, &stop_data); if(stop_reason != SCAMPER_TRACE_STOP_NONE) { trace_stop(trace, stop_reason, stop_data); trace_next_mode(task); return; } } } if(trace->hop_count == 255 || trace->hop_count == trace->hoplimit) { trace_stop_hoplimit(trace); trace_next_mode(task); return; } /* * if we haven't checked to see if the path is dead yet, check to see * if we should do so at this time. a dead path is defined as a path * that has an unresponsive target host, which we stop tracing after * the gaplimit is reached. */ if(trace->hop_count - (trace->firsthop - 1) >= trace->gaplimit) { deadpath = 1; for(i=0; igaplimit; i++) { if(trace->hops[trace->hop_count-1-i] != NULL) { deadpath = 0; break; } } if(deadpath != 0) { if(trace->gapaction == SCAMPER_TRACE_GAPACTION_LASTDITCH) { state->mode = MODE_LASTDITCH; state->ttl = 255; } else { trace_stop_gaplimit(trace); trace_next_mode(task); } } } return; } static void timeout_dtree_back(scamper_task_t *task) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); scamper_trace_hop_t *hop; /* tidy up after any confidence probing */ if(state->interfaces != NULL) { free(state->interfaces); state->interfaces = NULL; state->interfacec = 0; } if(state->ttl == 1) { trace_next_mode(task); return; } if(state->lsst != NULL && (SCAMPER_TRACE_IS_ALLATTEMPTS(trace) || trace->confidence != 0)) { for(hop = trace->hops[state->ttl-1]; hop != NULL; hop = hop->hop_next) { if(dtree_lss_in(state, hop->hop_addr) != 0) { trace_next_mode(task); return; } } } state->attempt = 0; state->ttl--; trace->firsthop--; trace_queue(task); return; } static void timeout_dtree_first(scamper_task_t *task) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); /* * go into forwards probing mode if we've made it all the way back to * ttl one */ if(state->ttl == 1) { state->mode = MODE_DTREE_FWD; state->ttl++; trace->hop_count++; return; } /* halve ttl and try again */ state->ttl /= 2; trace->firsthop /= 2; return; } static void timeout_lastditch(scamper_task_t *task) { /* we received no responses to any of the last-ditch probes */ trace_stop_gaplimit(trace_getdata(task)); scamper_task_queue_done(task, 0); return; } static void timeout_pmtud_default(scamper_task_t *task) { trace_state_t *state = trace_getstate(task); scamper_trace_pmtud_n_t *note; if((note = scamper_trace_pmtud_n_alloc()) == NULL) { printerror(__func__, "could not alloc note"); trace_handleerror(task, errno); return; } note->type = SCAMPER_TRACE_PMTUD_N_TYPE_SILENCE; state->pmtud->note = note; pmtud_L2_init(state); state->mode = MODE_PMTUD_SILENT_L2; return; } static void timeout_pmtud_silent_L2(scamper_task_t *task) { trace_state_t *state = trace_getstate(task); int size = state->header_size + state->payload_size; assert(state->pmtud->L2 != NULL); /* * have we scanned the L2 table to the official minimum MTU? * if we have, then PMTU fails and we abort. */ if(state->pmtud->L2->idx == 0) { scamper_task_queue_done(task, 0); return; } /* * we did not get a response for this probe size * if we can halve the search space again, then do that */ if(state->pmtud->L2->lower + 1 != size) { pmtud_L2_set_probesize(state, state->pmtud->L2->lower, size); } else { state->pmtud->L2->out = state->pmtud->L2->lower; /* set the bounds of the TTL search */ if(pmtud_TTL_init(task) == 1) state->mode = MODE_PMTUD_SILENT_TTL; else scamper_task_queue_done(task, 0); } return; } static void timeout_pmtud_silent_TTL(scamper_task_t *task) { trace_state_t *state = trace_getstate(task); assert(state->pmtud->TTL != NULL); /* * select another TTL to probe with, if possible. if not, then * the search halts and we move on */ if(pmtud_TTL_set_probettl(task, state->pmtud->TTL->lower, state->ttl) == 0) { pmtud_L2_search_end(task); } return; } /* * timeout_pmtud_badsugg * * if we timeout while trying to determine the underlying MTU on a path * where a router gives a bad suggestion, chances are that an ICMP blackhole * exists later in the path. try sending a larger packet, if we can. */ static void timeout_pmtud_badsugg(scamper_task_t *task) { trace_state_t *state = trace_getstate(task); int lower, upper; assert(state->pmtud->L2 != NULL); lower = state->header_size + state->payload_size; upper = state->pmtud->L2->upper; state->pmtud->L2->hop = NULL; if(lower + 1 != upper) { pmtud_L2_set_probesize(state, lower, upper); } else { /* terminate the search now */ state->pmtud->L2->lower = state->pmtud->L2->out = lower; pmtud_L2_search_end(task); } return; } /* * do_trace_handle_timeout * * the trace has expired while sitting on the wait queue. * handle this event appropriately. */ static void do_trace_handle_timeout(scamper_task_t *task) { static void (* const func[])(scamper_task_t *) = { NULL, /* MODE_RTSOCK */ NULL, /* MODE_DLHDR */ timeout_trace, /* MODE_TRACE */ timeout_lastditch, /* MODE_LASTDITCH */ timeout_pmtud_default, /* MODE_PMTUD_DEFAULT */ timeout_pmtud_silent_L2, /* MODE_PMTUD_SILENT_L2 */ timeout_pmtud_silent_TTL, /* MODE_PMTUD_SILENT_TTL */ timeout_pmtud_badsugg, /* MODE_PMTUD_BADSUGG */ timeout_dtree_first, /* MODE_DTREE_FIRST */ timeout_trace, /* MODE_DTREE_FWD */ timeout_dtree_back, /* MODE_DTREE_BACK */ }; scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); trace_probe_t *probe; assert(state->mode <= MODE_MAX); /* XXX: not sure that this timeout should be handled here */ if(state->mode == MODE_RTSOCK || state->mode == MODE_DLHDR) { trace_handleerror(task, 0); return; } probe = state->probes[state->id_next-1]; if(probe->rx == 0) { probe->flags |= TRACE_PROBE_FLAG_TIMEOUT; } else { assert(trace->wait_probe != 0); return; } /* * if we have sent all allotted attempts for this probe type, then * handle this particular probe failing */ if((trace->confidence == 0 && state->attempt == trace->attempts) || (trace->confidence != 0 && state->attempt == k(state))) { /* we're probably going to send another probe, so reset the attempt # */ state->attempt = 0; /* call the function that handles a timeout in this particular mode */ func[state->mode](task); } return; } static int handletp_trace(scamper_task_t *task, scamper_dl_rec_t *dl, trace_probe_t *probe) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); scamper_trace_hop_t *hop; size_t len; /* we should only have to deal with probes sent while in the trace state */ if(probe->mode != MODE_TRACE) return 0; /* create a hop record based off the TCP data */ if((hop = trace_dl_hop(probe, dl)) == NULL) return -1; trace_hopins(&trace->hops[hop->hop_probe_ttl-1], hop); /* make sure we don't wrap */ if(probe->rx != 65535) probe->rx++; /* if we are sending all allotted probes to the target */ if(SCAMPER_TRACE_IS_ALLATTEMPTS(trace)) { if(probe->id + 1 != trace->attempts) { trace_queue(task); return 0; } trace->hop_count++; } else if(trace->confidence != 0) { /* record details of the interface */ if(array_find((void **)state->interfaces, state->interfacec, hop->hop_addr, (array_cmp_t)scamper_addr_cmp) == NULL) { len = (state->interfacec + 1) * sizeof(scamper_addr_t *); if(realloc_wrap((void **)&state->interfaces, len) != 0) { printerror(__func__, "could not realloc interfaces"); trace_handleerror(task, errno); return -1; } state->interfaces[state->interfacec++] = hop->hop_addr; if(state->interfacec > 1) { array_qsort((void **)state->interfaces, state->interfacec, (array_cmp_t)scamper_addr_cmp); state->n++; } } /* if there are still probes to send for this hop, send the next one */ if(state->n <= TRACE_CONFIDENCE_MAX_N && state->attempt < k(state)) { trace_queue(task); return 0; } trace->hop_count++; } else { if(probe->rx == 1 && (probe->flags & TRACE_PROBE_FLAG_TIMEOUT) == 0) trace->hop_count++; } trace_stop_completed(trace); scamper_task_queue_done(task, 0); return 0; } static int handletp_lastditch(scamper_task_t *task, scamper_dl_rec_t *dl, trace_probe_t *probe) { scamper_trace_t *trace = trace_getdata(task); scamper_trace_hop_t *hop; /* only handle TCP responses in these two states */ if(probe->mode != MODE_TRACE && probe->mode != MODE_LASTDITCH) return 0; if(probe->rx != 65535) probe->rx++; /* create a hop record based off the TCP data */ if((hop = trace_dl_hop(probe, dl)) == NULL) return -1; if(probe->mode == MODE_LASTDITCH) { trace_hopins(&trace->lastditch, hop); trace_stop_gaplimit(trace); } else { trace_hopins(&trace->hops[hop->hop_probe_ttl-1], hop); trace_stop_completed(trace); } scamper_task_queue_done(task, 0); return 0; } /* * dlin_trace * * handle a datalink record for an inbound packet which was sent * for a probe in the trace state. * * in this case, we use the timestamp to update the hop record. */ static void dlin_trace(scamper_trace_t *trace, scamper_dl_rec_t *dl, trace_probe_t *probe) { scamper_trace_hop_t *hop; struct timeval tv; /* adjust the rtt based on the timestamp included in the datalink record */ timeval_diff_tv(&tv, &probe->tx_tv, &probe->rx_tv); for(hop=trace->hops[probe->ttl-1]; hop != NULL; hop = hop->hop_next) { if(probe->id + 1 < hop->hop_probe_id) continue; if(probe->id + 1 > hop->hop_probe_id) break; scamper_debug(__func__, "hop %d.%06d dl_rec %d.%06d diff %d", hop->hop_rtt.tv_sec, hop->hop_rtt.tv_usec, tv.tv_sec, tv.tv_usec, timeval_diff_us(&hop->hop_rtt, &tv)); hop->hop_flags &= ~(SCAMPER_TRACE_HOP_FLAG_TS_SOCK_RX); hop->hop_flags |= SCAMPER_TRACE_HOP_FLAG_TS_DL_RX; timeval_cpy(&hop->hop_rtt, &tv); } return; } static void dlout_apply(scamper_trace_hop_t *hop, trace_probe_t *probe, struct timeval *diff) { while(hop != NULL) { if(probe->id + 1 > hop->hop_probe_id) { break; } if(probe->id + 1 == hop->hop_probe_id) { hop->hop_flags |= SCAMPER_TRACE_HOP_FLAG_TS_DL_TX; timeval_add_tv(&hop->hop_tx, diff); timeval_add_tv(&hop->hop_rtt, diff); } hop = hop->hop_next; } return; } /* * dlout_trace * * adjust the RTT recorded for a probe/reply sequence based on an updated * transmit timestamp corresponding to when the packet was queued at the * network interface. */ static void dlout_trace(scamper_trace_t *trace, trace_probe_t *probe, struct timeval *diff) { dlout_apply(trace->hops[probe->ttl-1], probe, diff); return; } /* * dlout_lastditch * */ static void dlout_lastditch(scamper_trace_t *trace, trace_probe_t *probe, struct timeval *diff) { dlout_apply(trace->lastditch, probe, diff); return; } /* * do_trace_handle_dl * * handle a datalink record that may have something useful for the * traceroute, such as a more accurate timestamp. */ static void do_trace_handle_dl(scamper_task_t *task, scamper_dl_rec_t *dl) { static void (* const dlout_func[])(scamper_trace_t *, trace_probe_t *, struct timeval *) = { NULL, /* MODE_RTSOCK */ NULL, /* MODE_DLHDR */ dlout_trace, /* MODE_TRACE */ dlout_lastditch, /* MODE_LASTDITCH */ NULL, /* MODE_PMTUD_DEFAULT */ NULL, /* MODE_PMTUD_SILENT_L2 */ NULL, /* MODE_PMTUD_SILENT_TTL */ NULL, /* MODE_PMTUD_BADSUGG */ NULL, /* MODE_DTREE_FIRST */ NULL, /* MODE_DTREE_FWD */ NULL, /* MODE_DTREE_BACK */ }; static void (* const dlin_func[])(scamper_trace_t *, scamper_dl_rec_t *, trace_probe_t *) = { NULL, /* MODE_RTSOCK */ NULL, /* MODE_DLHDR */ dlin_trace, /* MODE_TRACE */ NULL, /* MODE_LASTDITCH */ NULL, /* MODE_PMTUD_DEFAULT */ NULL, /* MODE_PMTUD_SILENT_L2 */ NULL, /* MODE_PMTUD_SILENT_TTL */ NULL, /* MODE_PMTUD_BADSUGG */ NULL, /* MODE_DTREE_FIRST */ NULL, /* MODE_DTREE_FWD */ NULL, /* MODE_DTREE_BACK */ }; static int (* const handletp_func[])(scamper_task_t *, scamper_dl_rec_t *, trace_probe_t *) = { NULL, /* MODE_RTSOCK */ NULL, /* MODE_DLHDR */ handletp_trace, /* MODE_TRACE */ handletp_lastditch, /* MODE_LASTDITCH */ NULL, /* MODE_PMTUD_DEFAULT */ NULL, /* MODE_PMTUD_SILENT_L2 */ NULL, /* MODE_PMTUD_SILENT_TTL */ NULL, /* MODE_PMTUD_BADSUGG */ NULL, /* MODE_DTREE_FIRST */ NULL, /* MODE_DTREE_FWD */ NULL, /* MODE_DTREE_BACK */ }; scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); trace_probe_t *probe; uint16_t probe_id; int direction; struct timeval diff; assert(dl->dl_af == AF_INET || dl->dl_af == AF_INET6); /* if this record has no timestamp, go no further */ if((dl->dl_flags & SCAMPER_DL_REC_FLAG_TIMESTAMP) == 0) return; if(SCAMPER_DL_IS_IP(dl) == 0) return; /* * try and determine the direction of the packet and the associated probe * for this datalink record */ if(trace->type == SCAMPER_TRACE_TYPE_UDP || trace->type == SCAMPER_TRACE_TYPE_UDP_PARIS) { if(dl->dl_ip_proto == IPPROTO_UDP) { if(dl->dl_udp_sport == trace->sport && scamper_addr_raw_cmp(trace->dst, dl->dl_ip_dst) == 0) { direction = 1; if(trace->type == SCAMPER_TRACE_TYPE_UDP) probe_id = dl->dl_udp_dport - trace->dport; else probe_id = ntohs(dl->dl_udp_sum) - 1; } else if(dl->dl_udp_dport == trace->sport && scamper_addr_raw_cmp(trace->dst, dl->dl_ip_src) == 0) { direction = 0; if(trace->type == SCAMPER_TRACE_TYPE_UDP) probe_id = dl->dl_udp_sport - trace->dport; else if((trace->flags & SCAMPER_TRACE_FLAG_CONSTPAYLOAD) == 0) probe_id = ntohs(dl->dl_udp_sum) - 1; else probe_id = state->id_next - 1; } else return; } else if(SCAMPER_DL_IS_ICMP(dl)) { if(SCAMPER_DL_IS_ICMP_TTL_EXP(dl) == 0 && SCAMPER_DL_IS_ICMP_UNREACH(dl) == 0 && SCAMPER_DL_IS_ICMP_PACKET_TOO_BIG(dl) == 0) { return; } if(dl->dl_icmp_ip_proto != IPPROTO_UDP) return; if(dl->dl_icmp_udp_sport != trace->sport) return; direction = 0; if(trace->type == SCAMPER_TRACE_TYPE_UDP) { probe_id = dl->dl_icmp_udp_dport - trace->dport; } else { if(dl->dl_icmp_udp_dport != trace->dport) return; if(dl->dl_af == AF_INET) { if(ntohs(dl->dl_icmp_udp_sum) == dl->dl_icmp_ip_id && dl->dl_icmp_udp_sum != 0) { probe_id = ntohs(dl->dl_icmp_udp_sum) - 1; } else if(trace_ipid_fudge(state,dl->dl_icmp_ip_id, &probe_id) != 0) { return; } } else if((trace->flags & SCAMPER_TRACE_FLAG_CONSTPAYLOAD) == 0) { if(dl->dl_icmp_udp_sum == 0) return; probe_id = ntohs(dl->dl_icmp_udp_sum) - 1; } else { probe_id = dl->dl_ip_flow - 1; } } } else return; } else if(trace->type == SCAMPER_TRACE_TYPE_ICMP_ECHO || trace->type == SCAMPER_TRACE_TYPE_ICMP_ECHO_PARIS) { if(SCAMPER_DL_IS_ICMP(dl) == 0) return; if(SCAMPER_DL_IS_ICMP_ECHO_REQUEST(dl)) { if(dl->dl_icmp_id != trace->sport) return; probe_id = dl->dl_icmp_seq; direction = 1; } else if(SCAMPER_DL_IS_ICMP_ECHO_REPLY(dl)) { if(dl->dl_icmp_id != trace->sport) return; probe_id = dl->dl_icmp_seq; direction = 0; } else if((SCAMPER_DL_IS_ICMP_TTL_EXP(dl) || SCAMPER_DL_IS_ICMP_UNREACH(dl) || SCAMPER_DL_IS_ICMP_PACKET_TOO_BIG(dl)) && SCAMPER_DL_IS_ICMP_Q_ICMP_ECHO_REQ(dl)) { if(dl->dl_icmp_icmp_id != trace->sport) return; probe_id = dl->dl_icmp_icmp_seq; direction = 0; } else return; } else if(SCAMPER_TRACE_TYPE_IS_TCP(trace)) { if(dl->dl_ip_proto == IPPROTO_TCP) { /* * if the syn flag (and only the syn flag is set) and the sport * and dport match what we probe with, then the probe is probably * an outgoing one. */ if((dl->dl_tcp_flags & TH_SYN) == TH_SYN && (dl->dl_tcp_flags & ~TH_SYN) == 0 && dl->dl_tcp_sport == trace->sport) { if(dl->dl_af == AF_INET) probe_id = dl->dl_ip_id - 1; else probe_id = dl->dl_ip_flow - 1; direction = 1; } else if(dl->dl_tcp_sport == trace->dport && dl->dl_tcp_dport == trace->sport) { /* * there is no easy way to determine which probe the reply is * for, so assume it was for the last one */ probe_id = state->id_next - 1; direction = 0; } else return; } else if(SCAMPER_DL_IS_ICMP(dl)) { if(SCAMPER_DL_IS_ICMP_TTL_EXP(dl) == 0 && SCAMPER_DL_IS_ICMP_UNREACH(dl) == 0 && SCAMPER_DL_IS_ICMP_PACKET_TOO_BIG(dl) == 0) { return; } if(dl->dl_icmp_ip_proto != IPPROTO_TCP || dl->dl_icmp_tcp_sport != trace->sport || dl->dl_icmp_tcp_dport != trace->dport) { return; } /* determine which probe the ICMP response corresponds to */ if(dl->dl_af == AF_INET) { if(trace_ipid_fudge(state, dl->dl_icmp_ip_id, &probe_id) != 0) { return; } } else { if(dl->dl_icmp_ip_flow == 0) return; probe_id = dl->dl_icmp_ip_flow - 1; } direction = 0; } else return; } else return; /* find the probe that corresponds to this datalink record */ if(probe_id >= state->id_next) { return; } probe = state->probes[probe_id]; /* make sure the probe structure makes sense */ assert(probe->mode <= MODE_MAX); /* if this is an inbound packet with a timestamp attached */ if(direction == 0) { /* inbound TCP packets result in a hop record being created */ if(dl->dl_ip_proto == IPPROTO_TCP || dl->dl_ip_proto == IPPROTO_UDP) { /* * record the receive timestamp with the probe structure if it hasn't * been previously recorded */ if((probe->flags & TRACE_PROBE_FLAG_DL_RX) != 0) { timeval_cpy(&probe->rx_tv, &dl->dl_tv); probe->flags |= TRACE_PROBE_FLAG_DL_RX; } if(handletp_func[probe->mode] != NULL) { if(dl->dl_ip_proto == IPPROTO_TCP) scamper_dl_rec_tcp_print(dl); else scamper_dl_rec_udp_print(dl); handletp_func[probe->mode](task, dl, probe); } } /* other datalink records result in timestamps being adjusted */ else if((probe->flags & TRACE_PROBE_FLAG_DL_RX) == 0) { /* update the receive timestamp stored with the probe */ probe->flags |= TRACE_PROBE_FLAG_DL_RX; timeval_cpy(&probe->rx_tv, &dl->dl_tv); /* if at least one hop record is present then adjust */ if(probe->rx > 0 && dlin_func[probe->mode] != NULL) { dlin_func[probe->mode](trace, dl, probe); } } } else { scamper_debug(__func__, "probe %d.%06d dl %d.%06d diff %d", probe->tx_tv.tv_sec, probe->tx_tv.tv_usec, dl->dl_tv.tv_sec, dl->dl_tv.tv_usec, timeval_diff_us(&probe->tx_tv, &dl->dl_tv)); /* if at least one hop record is present then adjust */ if(probe->rx > 0 && dlout_func[probe->mode] != NULL && timeval_cmp(&probe->tx_tv, &dl->dl_tv) < 0) { timeval_diff_tv(&diff, &probe->tx_tv, &dl->dl_tv); dlout_func[probe->mode](trace, probe, &diff); } /* update the TX timestamp of the probe */ probe->flags |= TRACE_PROBE_FLAG_DL_TX; timeval_cpy(&probe->tx_tv, &dl->dl_tv); } return; } /* * trace_handle_dlhdr: * * this callback function takes an incoming datalink header and deals with * it. */ static void trace_handle_dlhdr(scamper_dlhdr_t *dlhdr) { scamper_task_t *task = dlhdr->param; scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); if(dlhdr->error != 0) { scamper_task_queue_done(task, 0); return; } state->attempt = 0; if(SCAMPER_TRACE_IS_DOUBLETREE(trace)) state->mode = MODE_DTREE_FIRST; else state->mode = MODE_TRACE; scamper_task_queue_probe(task); return; } static void trace_handle_rt(scamper_route_t *rt) { scamper_task_t *task = rt->param; scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); scamper_dl_t *dl; if(state->mode != MODE_RTSOCK || state->route != rt) goto done; #ifndef _WIN32 if(state->rtsock != NULL) { scamper_fd_free(state->rtsock); state->rtsock = NULL; } #endif if(rt->error != 0 || rt->ifindex < 0) { printerror(__func__, "could not get ifindex"); trace_handleerror(task, errno); goto done; } /* * if scamper is supposed to get tx timestamps from the datalink, or * scamper needs the datalink to transmit packets, then try and get a * datalink on the ifindex specified. */ if((state->dl = scamper_fd_dl(rt->ifindex)) == NULL) { scamper_debug(__func__, "could not get dl for %d", rt->ifindex); trace_handleerror(task, errno); goto done; } dl = scamper_fd_dl_get(state->dl); /* * when doing tcp traceroute to an IPv4 destination, it isn't the end * of the world if we can't probe using a datalink socket, as we can * fall back to a raw socket. */ if(SCAMPER_TRACE_TYPE_IS_TCP(trace) && state->raw == NULL && scamper_dl_tx_type(dl) == SCAMPER_DL_TX_UNSUPPORTED && SCAMPER_ADDR_TYPE_IS_IPV4(trace->dst)) { state->raw = scamper_fd_ip4(); } /* * if we're doing path MTU discovery, or doing tcp traceroute, * or doing udp paris traceroute, determine the underlying framing to use * with each probe packet that will be sent on the datalink. */ if(SCAMPER_TRACE_IS_PMTUD(trace) || (SCAMPER_TRACE_TYPE_IS_TCP(trace) && state->raw == NULL) || trace->offset != 0 || (trace->flags & SCAMPER_TRACE_FLAG_DL) != 0 || (SCAMPER_TRACE_TYPE_IS_UDP_PARIS(trace) && sunos != 0)) { state->mode = MODE_DLHDR; if((state->dlhdr = scamper_dlhdr_alloc()) == NULL) { trace_handleerror(task, errno); goto done; } state->dlhdr->dst = scamper_addr_use(trace->dst); state->dlhdr->gw = rt->gw != NULL ? scamper_addr_use(rt->gw) : NULL; state->dlhdr->ifindex = rt->ifindex; state->dlhdr->txtype = scamper_dl_tx_type(dl); state->dlhdr->param = task; state->dlhdr->cb = trace_handle_dlhdr; if(scamper_dlhdr_get(state->dlhdr) != 0) { trace_handleerror(task, errno); goto done; } } /* if we're using a raw socket to do tcp traceroute, then start probing */ if(SCAMPER_TRACE_TYPE_IS_TCP(trace) && state->raw != NULL) { state->attempt = 0; if(SCAMPER_TRACE_IS_DOUBLETREE(trace)) state->mode = MODE_DTREE_FIRST; else state->mode = MODE_TRACE; scamper_task_queue_probe(task); return; } if(state->mode == MODE_DLHDR && scamper_task_queue_isdone(task) == 0) scamper_task_queue_wait(task, trace->wait * 1000); assert(state->mode != MODE_RTSOCK); done: scamper_route_free(rt); if(state->route == rt) state->route = NULL; return; } static void do_trace_write(scamper_file_t *sf, scamper_task_t *task) { scamper_file_write_trace(sf, trace_getdata(task)); return; } static void trace_pmtud_state_free(trace_pmtud_state_t *state) { if(state->L2 != NULL) free(state->L2); if(state->TTL != NULL) free(state->TTL); if(state->note != NULL) scamper_trace_pmtud_n_free(state->note); free(state); return; } static void trace_state_free(trace_state_t *state) { trace_probe_t *probe; int i; /* free the probe records scamper kept */ if(state->probes != NULL) { for(i=0; iid_next; i++) { probe = state->probes[i]; free(probe); } free(state->probes); } #ifndef _WIN32 if(state->rtsock != NULL) scamper_fd_free(state->rtsock); #endif if(state->dl != NULL) scamper_fd_free(state->dl); if(state->icmp != NULL) scamper_fd_free(state->icmp); if(state->probe != NULL) scamper_fd_free(state->probe); if(state->raw != NULL) scamper_fd_free(state->raw); if(state->route != NULL) scamper_route_free(state->route); if(state->dlhdr != NULL) scamper_dlhdr_free(state->dlhdr); if(state->interfaces != NULL) free(state->interfaces); if(state->lss != NULL) free(state->lss); if(state->pmtud != NULL) trace_pmtud_state_free(state->pmtud); free(state); return; } static int trace_state_alloc(scamper_task_t *task) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state; int id_max; assert(trace != NULL); /* allocate struct to keep state while processing the trace */ if((state = malloc_zero(sizeof(trace_state_t))) == NULL) { printerror(__func__, "could not malloc state"); goto err; } state->n = 2; if(trace->confidence == 99) state->confidence = 1; /* allocate memory to record hops */ state->alloc_hops = TRACE_ALLOC_HOPS; if(trace->firsthop >= state->alloc_hops) { if(state->alloc_hops + (uint16_t)trace->firsthop > 256) { state->alloc_hops = 256; } else { state->alloc_hops += trace->firsthop; } } if(trace->dtree != NULL && trace->dtree->lss != NULL) { if((state->lsst = trace_lss_get(trace->dtree->lss)) == NULL) goto err; } if(scamper_trace_hops_alloc(trace, state->alloc_hops) == -1) { printerror(__func__, "could not malloc hops"); goto err; } /* allocate enough ids to probe each hop with max number of attempts */ id_max = (state->alloc_hops - trace->firsthop + 2) * trace->attempts; /* allocate enough space to store state for each probe */ if((state->probes = malloc_zero(sizeof(trace_probe_t *) * id_max)) == NULL) { printerror(__func__, "could not malloc probes"); goto err; } state->dl = NULL; state->dlhdr = NULL; state->ttl = trace->firsthop; state->attempt = 0; state->header_size = scamper_trace_probe_headerlen(trace); state->payload_size = trace->probe_size - state->header_size; state->id_next = 0; state->id_max = id_max; /* if scamper has to get the ifindex, then start in the rtsock mode */ if(SCAMPER_TRACE_IS_PMTUD(trace) || SCAMPER_TRACE_IS_DL(trace) || SCAMPER_TRACE_TYPE_IS_TCP(trace) || trace->offset != 0 || (SCAMPER_TRACE_TYPE_IS_UDP_PARIS(trace) && sunos != 0)) { state->mode = MODE_RTSOCK; #ifndef _WIN32 if((state->rtsock = scamper_fd_rtsock()) == NULL) { goto err; } #endif } else { if(SCAMPER_TRACE_IS_DOUBLETREE(trace)) state->mode = MODE_DTREE_FIRST; else state->mode = MODE_TRACE; } if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) state->icmp = scamper_fd_icmp4(trace->src->addr); else if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV6) state->icmp = scamper_fd_icmp6(trace->src->addr); else goto err; if(state->icmp == NULL) goto err; if(SCAMPER_TRACE_TYPE_IS_TCP(trace)) { if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) { state->probe = scamper_fd_tcp4(NULL, trace->sport); if(scamper_option_rawtcp() != 0 && (state->raw = scamper_fd_ip4()) == NULL) goto err; } else { state->probe = scamper_fd_tcp6(NULL, trace->sport); } } else if(SCAMPER_TRACE_TYPE_IS_ICMP(trace)) { if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) state->probe = scamper_fd_icmp4(trace->src->addr); else state->probe = scamper_fd_icmp6(trace->src->addr); } else if(SCAMPER_TRACE_TYPE_IS_UDP(trace)) { if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) state->probe = scamper_fd_udp4(trace->src->addr, trace->sport); else state->probe = scamper_fd_udp6(trace->src->addr, trace->sport); } if(state->probe == NULL) goto err; scamper_task_setstate(task, state); return 0; err: if(state != NULL) trace_state_free(state); return -1; } static void do_trace_halt(scamper_task_t *task) { scamper_trace_t *trace = trace_getdata(task); trace->stop_reason = SCAMPER_TRACE_STOP_HALTED; scamper_task_queue_done(task, 0); return; } static void do_trace_free(scamper_task_t *task) { scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); if(state != NULL) trace_state_free(state); if(trace != NULL) scamper_trace_free(trace); return; } /* * do_trace_probe * * time to probe, so send the packet. */ static void do_trace_probe(scamper_task_t *task) { scamper_probe_ipopt_t opt; scamper_trace_t *trace = trace_getdata(task); trace_state_t *state = trace_getstate(task); trace_probe_t *tp = NULL; scamper_probe_t probe; uint16_t u16, i; size_t size; assert(trace != NULL); assert(trace->dst != NULL); assert(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4 || trace->dst->type == SCAMPER_ADDR_TYPE_IPV6); if(state != NULL) { assert(state->attempt < trace->attempts || trace->confidence != 0); assert(state->id_next <= state->id_max); assert(state->alloc_hops > 0); assert(state->alloc_hops <= 256); assert(state->ttl != 0); } else { /* timestamp when the trace began */ gettimeofday_wrap(&trace->start); /* allocate state and store it with the task */ if(trace_state_alloc(task) != 0) { goto err; } state = trace_getstate(task); } if(state->mode == MODE_RTSOCK) { state->route = scamper_route_alloc(trace->dst, task, trace_handle_rt); if(state->route == NULL) goto err; #ifndef _WIN32 if(scamper_rtsock_getroute(state->rtsock, state->route) != 0) goto err; state->attempt++; #else if(scamper_rtsock_getroute(state->route) != 0) goto err; #endif if(scamper_task_queue_isdone(task)) return; if(state->mode == MODE_RTSOCK || state->mode == MODE_DLHDR) { scamper_task_queue_wait(task, trace->wait * 1000); return; } } /* allocate some more space in the trace to store replies, if necessary */ if(trace->hop_count == state->alloc_hops) { /* * figure out exactly how many hops should be allocated in the * trace structure */ if(256 - state->alloc_hops <= TRACE_ALLOC_HOPS) u16 = state->alloc_hops + TRACE_ALLOC_HOPS; else u16 = 256; /* allocate the new hops */ if(scamper_trace_hops_alloc(trace, u16) != 0) { printerror(__func__, "could not realloc hops"); goto err; } /* initialise the new hops to have null pointers */ for(i=state->alloc_hops; ihops[i] = NULL; state->alloc_hops = u16; } /* allocate some more space to store probes, if necessary */ if(state->id_next == state->id_max) { u16 = state->id_max + TRACE_ALLOC_HOPS; size = sizeof(trace_probe_t *) * u16; if(realloc_wrap((void **)&state->probes, size) != 0) { printerror(__func__, "could not realloc"); goto err; } state->id_max = u16; } /* allocate a larger global pktbuf if needed */ if(pktbuf_len < state->payload_size) { if(realloc_wrap((void **)&pktbuf, state->payload_size) != 0) { printerror(__func__, "could not realloc"); goto err; } pktbuf_len = state->payload_size; } memset(&probe, 0, sizeof(probe)); probe.pr_ip_src = trace->src; probe.pr_ip_dst = trace->dst; probe.pr_ip_tos = trace->tos; probe.pr_ip_ttl = state->ttl; probe.pr_data = pktbuf; probe.pr_len = state->payload_size; probe.pr_fd = scamper_fd_fd_get(state->probe); if(SCAMPER_TRACE_TYPE_IS_UDP(trace)) probe.pr_ip_proto = IPPROTO_UDP; else if(SCAMPER_TRACE_TYPE_IS_TCP(trace)) probe.pr_ip_proto = IPPROTO_TCP; else if(SCAMPER_TRACE_TYPE_IS_ICMP(trace)) if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) probe.pr_ip_proto = IPPROTO_ICMP; else probe.pr_ip_proto = IPPROTO_ICMPV6; else goto err; /* * while the paris traceroute paper says that the payload of the * packet is set so that the checksum field can be used to * identify a returned probe, the paris traceroute code uses the * IP ID field. * this is presumably because FreeBSD systems seem to reset the * UDP checksum quoted in ICMP destination unreachable messages. * scamper's paris traceroute implementation used both IP ID and * UDP checksum. */ probe.pr_ip_id = state->id_next + 1; if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) probe.pr_ip_off = IP_DF; if(state->dl != NULL && (state->mode == MODE_PMTUD_DEFAULT || state->mode == MODE_PMTUD_SILENT_L2 || state->mode == MODE_PMTUD_SILENT_TTL || state->mode == MODE_PMTUD_BADSUGG || trace->offset != 0 || (SCAMPER_TRACE_TYPE_IS_UDP_PARIS(trace) && sunos != 0) || (SCAMPER_TRACE_TYPE_IS_UDP_PARIS(trace) && (trace->flags & SCAMPER_TRACE_FLAG_CONSTPAYLOAD) != 0 && trace->dst->type == SCAMPER_ADDR_TYPE_IPV6) || (SCAMPER_TRACE_TYPE_IS_TCP(trace) && state->raw == NULL))) { probe.pr_dl = scamper_fd_dl_get(state->dl); probe.pr_dl_buf = state->dlhdr->buf; probe.pr_dl_len = state->dlhdr->len; } if(trace->payload_len == 0 || (state->mode != MODE_TRACE && state->mode != MODE_LASTDITCH)) { if(probe.pr_len > 0) memset(probe.pr_data, 0, probe.pr_len); } else { memcpy(probe.pr_data, trace->payload, trace->payload_len); } if(trace->offset != 0) { assert(SCAMPER_ADDR_TYPE_IS_IPV6(trace->dst)); probe.pr_ip_off = trace->offset; probe.pr_ipopts = &opt; probe.pr_ipoptc = 1; opt.type = SCAMPER_PROBE_IPOPTS_V6FRAG; opt.opt_v6frag_off = trace->offset << 3; opt.opt_v6frag_id = (trace->sport << 16) | trace->probec; /* use the first 4 bytes of the payload for packet matching */ bytes_htonl(probe.pr_data, trace->probec); } else if(SCAMPER_TRACE_TYPE_IS_UDP(trace)) { probe.pr_udp_sport = trace->sport; probe.pr_udp_dport = trace->dport; /* * traditional traceroute identifies probes by varying the UDP * destination port number. UDP-based paris traceroute identifies * probes by varying the UDP checksum -- accomplished by manipulating * the payload of the packet to get sequential values for the checksum */ if(trace->type == SCAMPER_TRACE_TYPE_UDP) { probe.pr_udp_dport += state->id_next; } else if((trace->flags & SCAMPER_TRACE_FLAG_CONSTPAYLOAD) == 0) { /* * hack the checksum to be our id field by setting the checksum * id we want into the packet's body, then calculate the checksum * across the packet, and then set the packet's body to be the * value returned for the checksum. this effectively swaps two * 16 bit quantities in the packet */ bytes_htons(probe.pr_data, state->id_next + 1); if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) u16 = scamper_udp4_cksum(&probe); else u16 = scamper_udp6_cksum(&probe); memcpy(probe.pr_data, &u16, 2); } else if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV6) probe.pr_ip_flow = state->id_next + 1; } else if(SCAMPER_TRACE_TYPE_IS_ICMP(trace)) { SCAMPER_PROBE_ICMP_ECHO(&probe, trace->sport, state->id_next); /* * ICMP-based paris traceroute tries to ensure the same path is taken * through a load balancer by sending all probes with a constant value * for the checksum. manipulate the payload so this happens. */ if(trace->type == SCAMPER_TRACE_TYPE_ICMP_ECHO_PARIS) { probe.pr_icmp_sum = htons(trace->dport); u16 = htons(trace->dport); memcpy(probe.pr_data, &u16, 2); if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) u16 = scamper_icmp4_cksum(&probe); else u16 = scamper_icmp6_cksum(&probe); memcpy(probe.pr_data, &u16, 2); } } else { assert(SCAMPER_TRACE_TYPE_IS_TCP(trace)); if(state->raw != NULL) probe.pr_fd = scamper_fd_fd_get(state->raw); else probe.pr_fd = -1; probe.pr_tcp_sport = trace->sport; probe.pr_tcp_dport = trace->dport; probe.pr_tcp_seq = 0; probe.pr_tcp_ack = 0; probe.pr_tcp_win = 0; if(trace->type == SCAMPER_TRACE_TYPE_TCP) probe.pr_tcp_flags = TH_SYN; else probe.pr_tcp_flags = TH_ACK; if(trace->dst->type == SCAMPER_ADDR_TYPE_IPV6) probe.pr_ip_flow = state->id_next + 1; } /* * allocate a trace probe state record before we try and send the probe * as there is no point sending something into the wild that we can't * record */ if((tp = malloc_zero(sizeof(trace_probe_t))) == NULL) { printerror(__func__, "could not malloc trace_probe_t"); goto err; } /* send the probe */ if(scamper_probe(&probe) == -1) { errno = probe.pr_errno; goto err; } /* another probe sent */ trace->probec++; timeval_cpy(&tp->tx_tv, &probe.pr_tx); tp->ttl = probe.pr_ip_ttl; tp->size = probe.pr_len + state->header_size; tp->mode = state->mode; tp->id = state->attempt; state->probes[state->id_next] = tp; state->id_next++; state->attempt++; /* define the lower bounds on when the next probe will be transmitted */ if(trace->wait_probe > 0) timeval_add_cs(&state->next_tx, &probe.pr_tx, trace->wait_probe); /* queue the traceroute to wait for any response */ probe.pr_tx.tv_sec += trace->wait; scamper_task_queue_wait_tv(task, &probe.pr_tx); return; err: if(tp != NULL) free(tp); trace_handleerror(task, errno); return; } static int trace_arg_param_validate(int optid, char *param, long *out) { long tmp = 0; switch(optid) { case TRACE_OPT_DPORT: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_DPORT_MIN || tmp > SCAMPER_DO_TRACE_DPORT_MAX) { goto err; } break; case TRACE_OPT_FIRSTHOP: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_FIRSTHOP_MIN || tmp > SCAMPER_DO_TRACE_FIRSTHOP_MAX) { goto err; } break; case TRACE_OPT_GAPLIMIT: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_GAPLIMIT_MIN || tmp > SCAMPER_DO_TRACE_GAPLIMIT_MAX) { goto err; } break; case TRACE_OPT_GAPACTION: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_GAPACTION_MIN || tmp > SCAMPER_DO_TRACE_GAPACTION_MAX) { goto err; } break; case TRACE_OPT_LOOPS: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_LOOPS_MIN || tmp > SCAMPER_DO_TRACE_LOOPS_MAX) { goto err; } break; case TRACE_OPT_OFFSET: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_OFFSET_MIN || tmp > SCAMPER_DO_TRACE_OFFSET_MAX) { goto err; } break; case TRACE_OPT_OPTION: if(strcasecmp(param, "dl") != 0 && strcasecmp(param, "const-payload") != 0 && strcasecmp(param, "dtree-noback") != 0) goto err; break; case TRACE_OPT_MAXTTL: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_HOPLIMIT_MIN || tmp > SCAMPER_DO_TRACE_HOPLIMIT_MAX) { goto err; } break; case TRACE_OPT_PAYLOAD: if((strlen(param) % 2) != 0) { goto err; } break; case TRACE_OPT_PROTOCOL: if(strcasecmp(param, "UDP") == 0) tmp = SCAMPER_TRACE_TYPE_UDP; else if(strcasecmp(param, "TCP") == 0) tmp = SCAMPER_TRACE_TYPE_TCP; else if(strcasecmp(param, "ICMP") == 0) tmp = SCAMPER_TRACE_TYPE_ICMP_ECHO; else if(strcasecmp(param, "ICMP-paris") == 0) tmp = SCAMPER_TRACE_TYPE_ICMP_ECHO_PARIS; else if(strcasecmp(param, "UDP-paris") == 0) tmp = SCAMPER_TRACE_TYPE_UDP_PARIS; else if(strcasecmp(param, "TCP-ack") == 0) tmp = SCAMPER_TRACE_TYPE_TCP_ACK; else goto err; break; case TRACE_OPT_ATTEMPTS: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_ATTEMPTS_MIN || tmp > SCAMPER_DO_TRACE_ATTEMPTS_MAX) { goto err; } break; case TRACE_OPT_SPORT: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_SPORT_MIN || tmp > SCAMPER_DO_TRACE_SPORT_MAX) { goto err; } break; case TRACE_OPT_TOS: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_TOS_MIN || tmp > SCAMPER_DO_TRACE_TOS_MAX) { goto err; } break; case TRACE_OPT_WAIT: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_WAIT_MIN || tmp > SCAMPER_DO_TRACE_WAIT_MAX) { goto err; } break; case TRACE_OPT_CONFIDENCE: if(string_tolong(param, &tmp) != 0 || (tmp != 95 && tmp != 99)) { goto err; } break; case TRACE_OPT_WAITPROBE: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_TRACE_WAITPROBE_MIN || tmp > SCAMPER_DO_TRACE_WAITPROBE_MAX) { goto err; } break; case TRACE_OPT_USERID: if(string_tolong(param, &tmp) != 0 || tmp < 0) goto err; break; case TRACE_OPT_SRCADDR: case TRACE_OPT_GSSENTRY: case TRACE_OPT_LSSNAME: /* these parameters are validated at execution time */ break; case TRACE_OPT_PMTUD: case TRACE_OPT_ALLATTEMPTS: case TRACE_OPT_TTLDST: /* these options don't have parameters */ break; default: return -1; } /* valid parameter */ if(out != NULL) *out = tmp; return 0; err: return -1; } /* * scamper_do_trace_alloc * * given a string representing a traceroute task, parse the parameters and * assemble a trace. return the trace structure so that it is all ready to * go. */ void *scamper_do_trace_alloc(char *str) { /* default values of various trace parameters */ uint8_t type = SCAMPER_TRACE_TYPE_UDP_PARIS; uint8_t flags = 0; uint8_t attempts = SCAMPER_DO_TRACE_ATTEMPTS_DEF; uint8_t firsthop = SCAMPER_DO_TRACE_FIRSTHOP_DEF; uint8_t gaplimit = SCAMPER_DO_TRACE_GAPLIMIT_DEF; uint8_t gapaction = SCAMPER_DO_TRACE_GAPACTION_DEF; uint8_t hoplimit = SCAMPER_DO_TRACE_HOPLIMIT_DEF; uint8_t tos = SCAMPER_DO_TRACE_TOS_DEF; uint8_t wait = SCAMPER_DO_TRACE_WAIT_DEF; uint8_t wait_probe = SCAMPER_DO_TRACE_WAITPROBE_DEF; uint8_t loops = SCAMPER_DO_TRACE_LOOPS_DEF; uint8_t confidence = 0; uint8_t dtree_flags = 0; uint16_t sport = scamper_sport_default(); uint16_t dport = SCAMPER_DO_TRACE_DPORT_DEF; uint16_t offset = SCAMPER_DO_TRACE_OFFSET_DEF; uint8_t *payload = NULL; uint16_t payload_len = 0; uint32_t userid = 0; char *lss = NULL; slist_t *gss = NULL; size_t i, len; scamper_option_out_t *opts_out = NULL, *opt; scamper_trace_t *trace = NULL; splaytree_t *gss_tree = NULL; scamper_addr_t *sa; char *addr; long tmp = 0; char *src = NULL; int af, x; uint32_t optids = 0; /* try and parse the string passed in */ if(scamper_options_parse(str, opts, opts_cnt, &opts_out, &addr) != 0) { goto err; } /* if there is no IP address after the options string, then stop now */ if(addr == NULL) { goto err; } /* parse the options, do preliminary sanity checks */ for(opt = opts_out; opt != NULL; opt = opt->next) { if(opt->type != SCAMPER_OPTION_TYPE_NULL && trace_arg_param_validate(opt->id, opt->str, &tmp) != 0) { scamper_debug(__func__, "validation of optid %d failed", opt->id); goto err; } optids |= (0x1 << opt->id); switch(opt->id) { case TRACE_OPT_DPORT: dport = (uint16_t)tmp; break; case TRACE_OPT_FIRSTHOP: firsthop = (uint8_t)tmp; break; case TRACE_OPT_GAPLIMIT: gaplimit = (uint8_t)tmp; break; case TRACE_OPT_GAPACTION: gapaction = (uint8_t)tmp; break; case TRACE_OPT_LOOPS: loops = (uint8_t)tmp; break; case TRACE_OPT_MAXTTL: hoplimit = (uint8_t)tmp; break; case TRACE_OPT_OFFSET: offset = (uint16_t)tmp; break; case TRACE_OPT_OPTION: if(strcasecmp(opt->str, "dl") == 0) flags |= SCAMPER_TRACE_FLAG_DL; else if(strcasecmp(opt->str, "const-payload") == 0) flags |= SCAMPER_TRACE_FLAG_CONSTPAYLOAD; else if(strcasecmp(opt->str, "dtree-noback") == 0) dtree_flags |= SCAMPER_TRACE_DTREE_FLAG_NOBACK; break; case TRACE_OPT_PAYLOAD: len = strlen(opt->str); payload_len = len/2; if((payload = malloc_zero(payload_len)) == NULL) { printerror(__func__, "could not malloc payload"); goto err; } for(i=0; istr[i], opt->str[i+1]); break; case TRACE_OPT_PMTUD: flags |= SCAMPER_TRACE_FLAG_PMTUD; break; case TRACE_OPT_PROTOCOL: type = (uint8_t)tmp; break; case TRACE_OPT_ATTEMPTS: attempts = (uint8_t)tmp; break; case TRACE_OPT_ALLATTEMPTS: flags |= SCAMPER_TRACE_FLAG_ALLATTEMPTS; break; case TRACE_OPT_SPORT: sport = (uint16_t)tmp; break; case TRACE_OPT_TOS: tos = (uint8_t)tmp; break; case TRACE_OPT_TTLDST: flags |= SCAMPER_TRACE_FLAG_IGNORETTLDST; break; case TRACE_OPT_WAIT: wait = (uint8_t)tmp; break; case TRACE_OPT_SRCADDR: if(src != NULL) goto err; src = opt->str; break; case TRACE_OPT_CONFIDENCE: confidence = (uint8_t)tmp; break; case TRACE_OPT_USERID: userid = (uint32_t)tmp; break; case TRACE_OPT_WAITPROBE: wait_probe = (uint8_t)tmp; break; case TRACE_OPT_LSSNAME: lss = opt->str; break; case TRACE_OPT_GSSENTRY: if((gss == NULL && (gss = slist_alloc()) == NULL) || slist_tail_push(gss, opt->str) == NULL) { goto err; } break; } } scamper_options_free(opts_out); opts_out = NULL; /* sanity check that we don't begin beyond our probe hoplimit */ if(firsthop > hoplimit && hoplimit != 0) { goto err; } /* can't really do pmtud properly without all of the path */ if((flags & SCAMPER_TRACE_FLAG_PMTUD) != 0 && (firsthop > 1 || gss != NULL || lss != NULL)) { goto err; } /* cannot specify both a confidence value and tell it to send all attempts */ if(confidence != 0 && (flags & SCAMPER_TRACE_FLAG_ALLATTEMPTS)) { goto err; } /* can't really do pmtud properly without a UDP traceroute method */ if((flags & SCAMPER_TRACE_FLAG_PMTUD) != 0 && type != SCAMPER_TRACE_TYPE_UDP && type != SCAMPER_TRACE_TYPE_UDP_PARIS) { goto err; } if((trace = scamper_trace_alloc()) == NULL) { printerror(__func__, "could not alloc trace"); goto err; } if((trace->dst= scamper_addrcache_resolve(addrcache,AF_UNSPEC,addr)) == NULL) { goto err; } trace->type = type; trace->flags = flags; trace->attempts = attempts; trace->hoplimit = hoplimit; trace->gaplimit = gaplimit; trace->gapaction = gapaction; trace->firsthop = firsthop; trace->tos = tos; trace->wait = wait; trace->loops = loops; trace->sport = sport; trace->dport = dport; trace->payload = payload; payload = NULL; trace->payload_len = payload_len; trace->confidence = confidence; trace->wait_probe = wait_probe; trace->offset = offset; trace->userid = userid; /* to start with, we are this far into the path */ trace->hop_count = firsthop - 1; /* don't allow tcptraceroute to have a payload */ if(SCAMPER_TRACE_TYPE_IS_TCP(trace) && trace->payload_len > 0) { goto err; } /* don't allow fragment traceroute with IPv4 for now */ if(trace->offset != 0 && trace->dst->type == SCAMPER_ADDR_TYPE_IPV4) { goto err; } switch(trace->dst->type) { case SCAMPER_ADDR_TYPE_IPV4: if(SCAMPER_TRACE_TYPE_IS_TCP(trace)) trace->probe_size = 40; else if(trace->payload_len == 0) trace->probe_size = 44; else trace->probe_size = 20 + 8 + trace->payload_len; break; case SCAMPER_ADDR_TYPE_IPV6: if(trace->offset != 0) trace->probe_size = 40 + 8 + 4 + trace->payload_len; else if(trace->payload_len == 0 || SCAMPER_TRACE_TYPE_IS_TCP(trace)) trace->probe_size = 60; else trace->probe_size = 40 + 8 + trace->payload_len; break; default: goto err; } af = scamper_addr_af(trace->dst); if(af != AF_INET && af != AF_INET6) goto err; if(src != NULL) { if((trace->src = scamper_addrcache_resolve(addrcache, af, src)) == NULL) goto err; } /* * if icmp paris traceroute is being used, say that the csum used can be * found in the trace->dport value. */ if(trace->type == SCAMPER_TRACE_TYPE_ICMP_ECHO_PARIS) { trace->flags |= SCAMPER_TRACE_FLAG_ICMPCSUMDP; if((optids & (0x1 << TRACE_OPT_DPORT)) == 0) trace->dport = scamper_sport_default(); } /* add the nodes to the global stop set for this trace */ if(gss != NULL || lss != NULL) { if(scamper_trace_dtree_alloc(trace) != 0) goto err; trace->flags |= SCAMPER_TRACE_FLAG_DOUBLETREE; trace->dtree->firsthop = trace->firsthop; trace->dtree->flags = dtree_flags; } if(lss != NULL) { if(scamper_trace_dtree_lss(trace, lss) != 0) goto err; } if(gss != NULL) { if((gss_tree=splaytree_alloc((splaytree_cmp_t)scamper_addr_cmp)) == NULL) goto err; while((addr = slist_head_pop(gss)) != NULL) { if((sa = scamper_addrcache_resolve(addrcache, af, addr)) == NULL || (splaytree_find(gss_tree, sa) == NULL && splaytree_insert(gss_tree, sa) == NULL)) goto err; } slist_free(gss); gss = NULL; if((x = splaytree_count(gss_tree)) >= 65535 || scamper_trace_dtree_gss_alloc(trace, x) != 0) goto err; splaytree_inorder(gss_tree,(splaytree_inorder_t)trace_gss_add,trace->dtree); splaytree_free(gss_tree, (splaytree_free_t)scamper_addr_free); gss_tree = NULL; scamper_trace_dtree_gss_sort(trace); } return trace; err: if(payload != NULL) free(payload); if(gss != NULL) slist_free(gss); if(gss_tree != NULL) splaytree_free(gss_tree, (splaytree_free_t)scamper_addr_free); if(trace != NULL) scamper_trace_free(trace); if(opts_out != NULL) scamper_options_free(opts_out); return NULL; } int scamper_do_trace_arg_validate(int argc, char *argv[], int *stop) { return scamper_options_validate(opts, opts_cnt, argc, argv, stop, trace_arg_param_validate); } void scamper_do_trace_free(void *data) { scamper_trace_free((scamper_trace_t *)data); return; } int scamper_do_trace_dtree_lss_clear(char *name) { trace_lss_t *lss, findme; findme.name = name; if((lss = splaytree_find(lsses, &findme)) == NULL) return -1; splaytree_empty(lss->tree, (splaytree_free_t)scamper_addr_free); return 0; } /* * scamper_do_trace_alloctask * */ scamper_task_t *scamper_do_trace_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle) { scamper_trace_t *trace = (scamper_trace_t *)data; scamper_task_t *task = NULL; scamper_task_sig_t *sig = NULL; /* allocate a task structure and store the trace with it */ if((task = scamper_task_alloc(trace, &trace_funcs)) == NULL) goto err; /* declare the signature of the task's probes */ if((sig = scamper_task_sig_alloc(SCAMPER_TASK_SIG_TYPE_TX_IP)) == NULL) goto err; sig->sig_tx_ip_dst = scamper_addr_use(trace->dst); if(trace->src == NULL && (trace->src = scamper_getsrc(trace->dst,0)) == NULL) goto err; sig->sig_tx_ip_src = scamper_addr_use(trace->src); if(scamper_task_sig_add(task, sig) != 0) goto err; sig = NULL; /* associate the list and cycle with the trace */ trace->list = scamper_list_use(list); trace->cycle = scamper_cycle_use(cycle); return task; err: if(sig != NULL) scamper_task_sig_free(sig); if(task != NULL) { scamper_task_setdatanull(task); scamper_task_free(task); } return NULL; } void scamper_do_trace_cleanup(void) { if(pktbuf != NULL) { free(pktbuf); pktbuf = NULL; } if(lsses != NULL) { splaytree_free(lsses, (splaytree_free_t)trace_lss_free); lsses = NULL; } return; } int scamper_do_trace_init(void) { const scamper_osinfo_t *osinfo; trace_funcs.probe = do_trace_probe; trace_funcs.handle_icmp = do_trace_handle_icmp; trace_funcs.handle_dl = do_trace_handle_dl; trace_funcs.handle_timeout = do_trace_handle_timeout; trace_funcs.write = do_trace_write; trace_funcs.task_free = do_trace_free; trace_funcs.halt = do_trace_halt; osinfo = scamper_osinfo_get(); if(SCAMPER_OSINFO_IS_SUNOS(osinfo)) sunos = 1; return 0; } scamper-cvs-20171204/scamper/trace/scamper_trace_do.h000644 001751 000000 00000002576 11737356726 022341 0ustar00mjlwheel000000 000000 /* * scamper_do_trace.h * * $Id: scamper_trace_do.h,v 1.16 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DO_TRACE_H #define __SCAMPER_DO_TRACE_H void *scamper_do_trace_alloc(char *str); scamper_task_t *scamper_do_trace_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle); int scamper_do_trace_arg_validate(int argc, char *argv[], int *stop); void scamper_do_trace_free(void *data); const char *scamper_do_trace_usage(void); int scamper_do_trace_dtree_lss_clear(char *name); void scamper_do_trace_cleanup(void); int scamper_do_trace_init(void); #endif /*__SCAMPER_DO_TRACE_H */ scamper-cvs-20171204/scamper/trace/scamper_trace_json.c000644 001751 000000 00000017123 13131350352 022650 0ustar00mjlwheel000000 000000 /* * scamper_trace_json.c * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2011-2013 Internap Network Services Corporation * Copyright (C) 2013-2014 The Regents of the University of California * Copyright (C) 2015 The University of Waikato * Copyright (C) 2016 Matthew Luckie * * Authors: Brian Hammond, Matthew Luckie * * $Id: scamper_trace_json.c,v 1.14 2017/07/12 07:34:02 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_trace_json.c,v 1.14 2017/07/12 07:34:02 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_trace.h" #include "scamper_icmpext.h" #include "scamper_file.h" #include "scamper_file_json.h" #include "scamper_trace_json.h" #include "utils.h" static char *hop_tostr(scamper_trace_hop_t *hop) { char buf[512], tmp[128]; scamper_icmpext_t *ie; size_t off = 0; uint32_t u32; int i; string_concat(buf, sizeof(buf), &off, "{\"addr\":\"%s\"", scamper_addr_tostr(hop->hop_addr, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"probe_ttl\":%u, \"probe_id\":%u, \"probe_size\":%u", hop->hop_probe_ttl, hop->hop_probe_id, hop->hop_probe_size); if(hop->hop_tx.tv_sec != 0) string_concat(buf, sizeof(buf), &off, ", \"tx\":{\"sec\":%u, \"usec\":%u}", hop->hop_tx.tv_sec, hop->hop_tx.tv_usec); string_concat(buf, sizeof(buf), &off, ", \"rtt\":%s", timeval_tostr_us(&hop->hop_rtt, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"reply_ttl\":%u, \"reply_tos\":%u, \"reply_size\":%u", hop->hop_reply_ttl, hop->hop_reply_tos, hop->hop_reply_size); string_concat(buf, sizeof(buf), &off, ", \"reply_ipid\":%u", hop->hop_reply_ipid); if(SCAMPER_TRACE_HOP_IS_ICMP(hop)) { string_concat(buf, sizeof(buf), &off, ", \"icmp_type\":%u, \"icmp_code\":%u", hop->hop_icmp_type, hop->hop_icmp_code); if(SCAMPER_TRACE_HOP_IS_ICMP_Q(hop)) { string_concat(buf, sizeof(buf), &off, ", \"icmp_q_ttl\":%u, \"icmp_q_ipl\":%u", hop->hop_icmp_q_ttl, hop->hop_icmp_q_ipl); if(SCAMPER_ADDR_TYPE_IS_IPV4(hop->hop_addr)) string_concat(buf, sizeof(buf), &off, ", \"icmp_q_tos\":%u", hop->hop_icmp_q_tos); } if(SCAMPER_TRACE_HOP_IS_ICMP_PTB(hop)) string_concat(buf, sizeof(buf), &off, ", \"icmp_nhmtu:\":%u", hop->hop_icmp_nhmtu); } else if(SCAMPER_TRACE_HOP_IS_TCP(hop)) { string_concat(buf, sizeof(buf), &off, ", \"tcp_flags\":%u", hop->hop_tcp_flags); } if(hop->hop_icmpext != NULL) { string_concat(buf, sizeof(buf), &off, ", \"icmpext\":["); for(ie=hop->hop_icmpext; ie != NULL; ie=ie->ie_next) { if(ie != hop->hop_icmpext) string_concat(buf, sizeof(buf), &off, ","); string_concat(buf, sizeof(buf), &off, "{\"ie_cn\":%u,\"ie_ct\":%u,\"ie_dl\":%u", ie->ie_cn, ie->ie_ct, ie->ie_dl); if(SCAMPER_ICMPEXT_IS_MPLS(ie)) { string_concat(buf, sizeof(buf), &off, ",\"mpls_labels\":["); for(i=0; i 0) string_concat(buf, sizeof(buf), &off, ","); string_concat(buf, sizeof(buf), &off, "{\"mpls_ttl\":%u,\"mpls_s\":%u," "\"mpls_exp\":%u,\"mpls_label\":%u}", SCAMPER_ICMPEXT_MPLS_TTL(ie, i), SCAMPER_ICMPEXT_MPLS_S(ie, i), SCAMPER_ICMPEXT_MPLS_EXP(ie, i), u32); } string_concat(buf, sizeof(buf), &off, "]"); } string_concat(buf, sizeof(buf), &off, "}"); } string_concat(buf, sizeof(buf), &off, "]"); } string_concat(buf, sizeof(buf), &off, "}"); return strdup(buf); } static char *header_tostr(const scamper_trace_t *trace) { char buf[512], tmp[64]; size_t off = 0; time_t tt = trace->start.tv_sec; string_concat(buf,sizeof(buf),&off,"\"type\":\"trace\",\"version\":\"0.1\""); string_concat(buf, sizeof(buf), &off, ", \"userid\":%u", trace->userid); string_concat(buf, sizeof(buf), &off, ", \"method\":\"%s\"", scamper_trace_type_tostr(trace, tmp, sizeof(tmp))); if(trace->src != NULL) string_concat(buf, sizeof(buf), &off, ", \"src\":\"%s\"", scamper_addr_tostr(trace->src, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"dst\":\"%s\"", scamper_addr_tostr(trace->dst, tmp, sizeof(tmp))); if(SCAMPER_TRACE_TYPE_IS_UDP(trace) || SCAMPER_TRACE_TYPE_IS_TCP(trace)) string_concat(buf, sizeof(buf), &off, ", \"sport\":%u, \"dport\":%u", trace->sport, trace->dport); else if(trace->flags & SCAMPER_TRACE_FLAG_ICMPCSUMDP) string_concat(buf, sizeof(buf), &off, ", \"icmp_sum\":%u", trace->dport); string_concat(buf, sizeof(buf), &off, ", \"stop_reason\":\"%s\", \"stop_data\":%u", scamper_trace_stop_tostr(trace, tmp, sizeof(tmp)), trace->stop_data); strftime(tmp, sizeof(tmp), "%Y-%m-%d %H:%M:%S", localtime(&tt)); string_concat(buf, sizeof(buf), &off, ", \"start\":{\"sec\":%u, \"usec\":%u, \"ftime\":\"%s\"}", trace->start.tv_sec, trace->start.tv_usec, tmp); string_concat(buf, sizeof(buf), &off, ", \"hop_count\":%u, \"attempts\":%u, \"hoplimit\":%u", trace->hop_count, trace->attempts, trace->hoplimit); string_concat(buf, sizeof(buf), &off, ", \"firsthop\":%u, \"wait\":%u, \"wait_probe\":%u", trace->firsthop, trace->wait, trace->wait_probe); string_concat(buf, sizeof(buf), &off, ", \"tos\":%u, \"probe_size\":%u", trace->tos, trace->probe_size); return strdup(buf); } int scamper_file_json_trace_write(const scamper_file_t *sf, const scamper_trace_t *trace) { scamper_trace_hop_t *hop; size_t len, off = 0; char *str = NULL, *header = NULL, **hops = NULL; int i, j, hopc = 0, rc = -1; if((header = header_tostr(trace)) == NULL) goto cleanup; len = strlen(header); for(i=trace->firsthop-1; ihop_count; i++) for(hop = trace->hops[i]; hop != NULL; hop = hop->hop_next) hopc++; if(hopc > 0) { len += 11; /* , "hops":[] */ if((hops = malloc_zero(sizeof(char *) * hopc)) == NULL) goto cleanup; for(i=trace->firsthop-1, j=0; ihop_count; i++) { for(hop = trace->hops[i]; hop != NULL; hop = hop->hop_next) { if(j > 0) len++; /* , */ if((hops[j] = hop_tostr(hop)) == NULL) goto cleanup; len += strlen(hops[j]); j++; } } } len += 4; /* {}\n\0 */ if((str = malloc_zero(len)) == NULL) goto cleanup; string_concat(str, len, &off, "{%s", header); if(hopc > 0) { string_concat(str, len, &off, ", \"hops\":["); for(j=0; j 0) string_concat(str, len, &off, ","); string_concat(str, len, &off, "%s", hops[j]); } string_concat(str, len, &off, "]"); } string_concat(str, len, &off, "}\n"); assert(off+1 == len); rc = json_write(sf, str, off); cleanup: if(hops != NULL) { for(i=0; ihop_flags & SCAMPER_TRACE_HOP_FLAG_TCP) != 0) { if((hop->hop_tcp_flags & TH_RST) != 0) { snprintf(str, len, " [closed]"); } else if((hop->hop_tcp_flags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK)) { if((hop->hop_tcp_flags & TH_ECE) != 0) snprintf(str, len, " [open, ecn]"); else snprintf(str, len, " [open]"); } else { if(hop->hop_tcp_flags == 0) snprintf(str, len, " [unknown, no flags]"); else snprintf(str, len, " [unknown,%s%s%s%s%s%s%s%s]", (hop->hop_tcp_flags & TH_RST) ? " RST" : "", (hop->hop_tcp_flags & TH_SYN) ? " SYN" : "", (hop->hop_tcp_flags & TH_ACK) ? " ACK" : "", (hop->hop_tcp_flags & TH_PUSH) ? " PSH" : "", (hop->hop_tcp_flags & TH_FIN) ? " FIN" : "", (hop->hop_tcp_flags & TH_URG) ? " URG" : "", (hop->hop_tcp_flags & TH_CWR) ? " CWR" : "", (hop->hop_tcp_flags & TH_ECE) ? " ECE" : ""); } } else if(SCAMPER_TRACE_HOP_IS_ICMP_TTL_EXP(hop) || SCAMPER_TRACE_HOP_IS_ICMP_ECHO_REPLY(hop)) { str[0] = '\0'; } else if(SCAMPER_TRACE_HOP_IS_ICMP(hop) && hop->hop_addr->type == SCAMPER_ADDR_TYPE_IPV4) { if(hop->hop_icmp_type == ICMP_UNREACH) { switch(hop->hop_icmp_code) { case ICMP_UNREACH_FILTER_PROHIB: snprintf(str, len, " !X"); break; case ICMP_UNREACH_HOST: snprintf(str, len, " !H"); break; case ICMP_UNREACH_NEEDFRAG: snprintf(str, len, " !F"); break; case ICMP_UNREACH_SRCFAIL: snprintf(str, len, " !S"); break; case ICMP_UNREACH_PROTOCOL: snprintf(str, len, " !P"); break; case ICMP_UNREACH_NET: snprintf(str, len, " !N"); break; case ICMP_UNREACH_PORT: str[0] = '\0'; break; default: snprintf(str, len, " !<%d>", hop->hop_icmp_code); break; } } else { snprintf(str,len," !<%d,%d>",hop->hop_icmp_type,hop->hop_icmp_code); } } else if(SCAMPER_TRACE_HOP_IS_ICMP(hop) && hop->hop_addr->type == SCAMPER_ADDR_TYPE_IPV6) { if(hop->hop_icmp_type == ICMP6_DST_UNREACH) { switch(hop->hop_icmp_code) { case ICMP6_DST_UNREACH_ADDR: snprintf(str, len," !A"); break; case ICMP6_DST_UNREACH_BEYONDSCOPE: snprintf(str, len," !S"); break; case ICMP6_DST_UNREACH_ADMIN: snprintf(str, len," !P"); break; case ICMP6_DST_UNREACH_NOROUTE: snprintf(str, len," !N"); break; case ICMP6_DST_UNREACH_NOPORT: str[0] = '\0'; break; default: snprintf(str, len, " !<%d>", hop->hop_icmp_code); break; } } else if(hop->hop_icmp_type == ICMP6_PACKET_TOO_BIG) { snprintf(str,len," !F"); } else { snprintf(str,len," !<%d,%d>",hop->hop_icmp_type,hop->hop_icmp_code); } } return str; } /* * header_tostr * */ static char *header_tostr(const scamper_trace_t *trace) { char src[64], dst[64], header[192]; if(trace->dst == NULL) return NULL; scamper_addr_tostr(trace->dst, dst, sizeof(dst)); if(trace->src != NULL) { scamper_addr_tostr(trace->src, src, sizeof(src)); snprintf(header, sizeof(header), "traceroute from %s to %s", src, dst); } else { snprintf(header, sizeof(header), "traceroute to %s", dst); } return strdup(header); } /* * hop_to_str * * given a hop (with other hops possibly linked to it) create a string that * holds the hop. */ static char *hop_tostr(const scamper_trace_t *trace, const int h) { scamper_trace_hop_t *hop; char *str = NULL; char **str_addrs = NULL; size_t *len_addrs = NULL; char **str_rtts = NULL; size_t *len_rtts = NULL; size_t len; int i; char str_hop[128]; char str_addr[64]; char str_rtt[24]; char str_icmp[48]; int spare; int replyc; replyc = 0; for(hop=trace->hops[h]; hop != NULL; hop = hop->hop_next) replyc++; /* if we got no responses at all for this hop */ if(replyc == 0) { if((trace->flags & SCAMPER_TRACE_FLAG_ALLATTEMPTS) == 0) { snprintf(str_hop, sizeof(str_hop), "%2d *", h+1); str = strdup(str_hop); } else if((str = malloc_zero((len = 4 + (2 * trace->attempts)))) != NULL) { snprintf(str, len, "%2d ", h+1); for(i=0; iattempts; i++) { str[4+(i*2)] = '*'; str[4+(i*2)+1] = ' '; } str[4+((i-1)*2)+1] = '\0'; } return str; } if(replyc == 1) { hop = trace->hops[h]; scamper_addr_tostr(hop->hop_addr, str_addr, sizeof(str_addr)); timeval_tostr_us(&hop->hop_rtt, str_rtt, sizeof(str_rtt)); icmp_tostr(hop, str_icmp, sizeof(str_icmp)); snprintf(str_hop, sizeof(str_hop), "%2d %s %s ms%s", h+1, str_addr, str_rtt, str_icmp); return strdup(str_hop); } /* we have to print out all of the replies */ len = sizeof(char *) * replyc; if((str_addrs = malloc_zero(len)) == NULL) goto out; if((str_rtts = malloc_zero(len)) == NULL) goto out; /* keep track of the length of each string in the arrays */ len = sizeof(size_t) * replyc; if((len_addrs = malloc_zero(len)) == NULL) goto out; if((len_rtts = malloc_zero(len)) == NULL) goto out; /* for each response we have, record an entry in the array */ i = 0; for(hop = trace->hops[h]; hop != NULL; hop = hop->hop_next) { /* * calculate the length of the address to record for this hop probe, * and then generate and store the string */ addr_str(hop->hop_addr, str_addr, sizeof(str_addr)); len = strlen(str_addr); if((str_addrs[i] = malloc_zero(len+1)) == NULL) goto out; memcpy(str_addrs[i], str_addr, len+1); len_addrs[i] = len; /* * calculate the length of the rtt and icmp data for this hop probe, * and then generate and store the string */ timeval_tostr_us(&hop->hop_rtt, str_rtt, sizeof(str_rtt)); icmp_tostr(hop, str_icmp, sizeof(str_icmp)); len = strlen(str_rtt) + 3 + strlen(str_icmp); if((str_rtts[i] = malloc_zero(len+1)) == NULL) goto out; snprintf(str_rtts[i],len+1,"%s ms%s",str_rtt,str_icmp); len_rtts[i] = len; i++; } /* * go through and figure how long our string should be * we reserve 5 characters to start with so that we can print 3 digits * hop number + 2 digits space ahead of the hop information. */ len = 5; spare = -1; for(i=0; ipmtud->hops) == NULL) { mtu = size = trace->pmtud->pmtu; } else { mtu = size = trace->pmtud->ifmtu; if(trace->pmtud->outmtu != 0) size = trace->pmtud->outmtu; } for(i=0; ihop_count; i++) { /* no response for this hop */ if(trace->hops[i] == NULL) { if(mtus[i] != NULL) free(mtus[i]); mtus[i] = NULL; continue; } /* if there is no pmtud data then skip this bit */ if(hop == NULL) continue; /* * if this hop has the same address as an ICMP message, then * change the MTU to reach the next hop after recording the size * of the packet that reached this hop successfully */ if(scamper_addr_cmp(hop->hop_addr, trace->hops[i]->hop_addr) == 0) { if((mtus[i] = mtu_tostr(mtu, size)) == NULL) return -1; if(SCAMPER_TRACE_HOP_IS_ICMP_PTB(hop)) mtu = hop->hop_icmp_nhmtu; hop = hop->hop_next; if(hop == NULL) size = trace->pmtud->pmtu; else size = hop->hop_probe_size; continue; } /* * if this hop has the same ttl as the probe packet, then the * egress interface returned the frag required message. record * the MTU for the current working hop */ if(i >= hop->hop_probe_ttl - hop->hop_icmp_q_ttl) { if(SCAMPER_TRACE_HOP_IS_ICMP_PTB(hop)) size = mtu = hop->hop_icmp_nhmtu; if((mtus[i] = mtu_tostr(mtu, size)) == NULL) return -1; hop = hop->hop_next; if(hop == NULL) size = trace->pmtud->pmtu; else size = hop->hop_probe_size; continue; } if((mtus[i] = mtu_tostr(mtu, size)) == NULL) return -1; } return 0; } static int pmtud_ver2(const scamper_trace_t *trace, char **mtus) { const scamper_trace_pmtud_t *pmtud = trace->pmtud; const scamper_trace_pmtud_n_t *note; const scamper_trace_hop_t *hop; const scamper_addr_t *ha; char buf[256], addr[128]; size_t off; uint16_t mtu, size; uint8_t n = 0; uint8_t h = 0; int i; mtu = size = pmtud->ifmtu; if(pmtud->outmtu != 0) { /* the first note should be for a silent first hop */ assert(pmtud->notec > 0); assert(pmtud->notes[0]->hop == NULL); assert(pmtud->notes[0]->type == SCAMPER_TRACE_PMTUD_N_TYPE_SILENCE); size = pmtud->outmtu; n++; } if(n == pmtud->notec) { for(h=0; hhop_count; h++) if(trace->hops[h] != NULL && (mtus[h] = mtu_tostr(mtu,size)) == NULL) return -1; return 0; } while(n < pmtud->notec) { note = pmtud->notes[n]; n++; if((hop = note->hop) == NULL) { size = note->nhmtu; continue; } if(note->type == SCAMPER_TRACE_PMTUD_N_TYPE_SILENCE) { i = hop->hop_probe_ttl - 1; } else { ha = hop->hop_addr; for(i=h; ihop_count; i++) { if(trace->hops[i] == NULL) continue; if(scamper_addr_cmp(trace->hops[i]->hop_addr, ha) == 0) break; } /* kludge to try and figure out which hop to put the PTB on */ if(i == trace->hop_count) { i = hop->hop_probe_ttl - hop->hop_icmp_q_ttl; /* * shift the predicted hop back one if the alignment is * analytically unlikely. */ if(trace->hops[i] != NULL && ((ha->type == SCAMPER_ADDR_TYPE_IPV4 && scamper_addr_prefix(trace->hops[i]->hop_addr,ha) >= 30) || (ha->type == SCAMPER_ADDR_TYPE_IPV6 && scamper_addr_prefix(trace->hops[i]->hop_addr,ha) >= 126))) i--; /* handle wrap */ if(i >= (trace->hop_count-1)) i = trace->hop_count-2; if(i < 0) i = 0; } } while(h <= i) { if(trace->hops[h] != NULL && (mtus[h] = mtu_tostr(mtu,size)) == NULL) return -1; h++; } if(SCAMPER_TRACE_HOP_IS_ICMP_PTB(hop)) { if(trace->hops[i] == NULL && (mtus[i] = mtu_tostr(mtu,size)) == NULL) return -1; if(trace->hops[i] == NULL || scamper_addr_cmp(trace->hops[i]->hop_addr, hop->hop_addr) != 0) scamper_addr_tostr(hop->hop_addr, addr, sizeof(addr)); else addr[0] = '\0'; if(addr[0] != '\0' || note->nhmtu != hop->hop_icmp_nhmtu) { off = 0; string_concat(buf, sizeof(buf), &off, "%s", mtus[i]); if(addr[0] != '\0') string_concat(buf, sizeof(buf), &off, " ptb %s", addr); if(note->nhmtu != hop->hop_icmp_nhmtu) string_concat(buf, sizeof(buf), &off, " nhmtu %d!", hop->hop_icmp_nhmtu); free(mtus[i]); if((mtus[i] = strdup(buf)) == NULL) return -1; } mtu = hop->hop_icmp_nhmtu; } size = note->nhmtu; } while(h < trace->hop_count) { if(trace->hops[h] != NULL && (mtus[h] = mtu_tostr(mtu,size)) == NULL) return -1; h++; } return 0; } /* * scamper_file_text_trace_write * * return 0 on successful write, -1 otherwise. */ int scamper_file_text_trace_write(const scamper_file_t *sf, const scamper_trace_t *trace) { static int (*const pmtud_tostr[])(const scamper_trace_t *, char **) = { NULL, pmtud_ver1, pmtud_ver2, }; /* current return code */ int rc = -1; /* variables for creating the string representing the trace */ int i; size_t off, len; char *str = NULL; char *header = NULL; char **hops = NULL; char **mtus = NULL; /* variables for writing to the file */ off_t foff = 0; int fd; size_t wc; /* * get the current offset into the file, incase the write fails and a * truncation is required */ fd = scamper_file_getfd(sf); if(fd != STDOUT_FILENO && (foff = lseek(fd, 0, SEEK_CUR)) == -1) goto cleanup; /* get a string that specifies the source and destination of the trace */ header = header_tostr(trace); len = strlen(header) + 2; if(trace->hop_count > 0) { if((hops = malloc_zero(sizeof(char *) * trace->hop_count)) == NULL) goto cleanup; for(i=0; i < trace->hop_count; i++) { if((hops[i] = hop_tostr(trace, i)) == NULL) goto cleanup; len += strlen(hops[i]); } /* if we have PMTU data to print for the trace, then write it too */ if(trace->pmtud != NULL && trace->pmtud->ver >= 1 && trace->pmtud->ver <= 2) { if((mtus = malloc_zero(sizeof(char *) * trace->hop_count)) == NULL) goto cleanup; if(pmtud_tostr[trace->pmtud->ver](trace, mtus) != 0) goto cleanup; for(i=0; ihop_count; i++) if(mtus[i] != NULL) len += strlen(mtus[i]); } len += trace->hop_count; /* \n on each line */ } len += 1; /* final \0 */ if((str = malloc_zero(len)) == NULL) goto cleanup; off = 0; string_concat(str, len, &off, "%s\n", header); if(hops != NULL) { for(i=0; i < trace->hop_count; i++) { string_concat(str, len, &off, "%s", hops[i]); if(mtus != NULL && mtus[i] != NULL) string_concat(str, len, &off, "%s", mtus[i]); string_concat(str, len, &off, "\n"); } } /* * try and write the string to disk. if it fails, then truncate the * write and fail */ if(write_wrap(fd, str, &wc, off) != 0) { if(fd != STDOUT_FILENO) { if(ftruncate(fd, foff) != 0) goto cleanup; } goto cleanup; } rc = 0; /* we succeeded */ cleanup: if(hops != NULL) { for(i=0; ihop_count; i++) if(hops[i] != NULL) free(hops[i]); free(hops); } if(mtus != NULL) { for(i=0; ihop_count; i++) if(mtus[i] != NULL) free(mtus[i]); free(mtus); } if(header != NULL) free(header); if(str != NULL) free(str); return rc; } scamper-cvs-20171204/scamper/trace/scamper_trace_text.h000644 001751 000000 00000002002 11634537540 022672 0ustar00mjlwheel000000 000000 /* * scamper_trace_text.h * * $Id: scamper_trace_text.h,v 1.2 2011/09/16 03:15:44 mjl Exp $ * * Copyright (C) 2003-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_TRACE_TEXT_H #define __SCAMPER_TRACE_TEXT_H int scamper_file_text_trace_write(const scamper_file_t *sf, const struct scamper_trace *trace); #endif scamper-cvs-20171204/scamper/trace/scamper_trace_warts.c000644 001751 000000 00000132367 13020235506 023047 0ustar00mjlwheel000000 000000 /* * scamper_trace_warts.c * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2014 The Regents of the University of California * Copyright (C) 2015 The University of Waikato * Copyright (C) 2015-2016 Matthew Luckie * Author: Matthew Luckie * * $Id: scamper_trace_warts.c,v 1.22 2016/12/02 09:13:42 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_trace_warts.c,v 1.22 2016/12/02 09:13:42 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_trace.h" #include "scamper_file.h" #include "scamper_file_warts.h" #include "scamper_trace_warts.h" #include "mjl_splaytree.h" #include "utils.h" /* * trace attributes: 2 bytes each. * the first 4 bits are the type, the second 12 bits are the length */ #define WARTS_TRACE_ATTR_HDR(type, len) ((type << 12) | len) #define WARTS_TRACE_ATTR_HDR_TYPE(hdr) ((hdr >> 12) & 0xf) #define WARTS_TRACE_ATTR_HDR_LEN(hdr) (hdr & 0x0fff) #define WARTS_TRACE_ATTR_EOF 0x0000 #define WARTS_TRACE_ATTR_PMTUD 0x1 #define WARTS_TRACE_ATTR_LASTDITCH 0x2 #define WARTS_TRACE_ATTR_DTREE 0x3 /* * the optional bits of a trace structure */ #define WARTS_TRACE_LIST_ID 1 /* list id assigned by warts */ #define WARTS_TRACE_CYCLE_ID 2 /* cycle id assigned by warts */ #define WARTS_TRACE_ADDR_SRC_GID 3 /* src address key, deprecated */ #define WARTS_TRACE_ADDR_DST_GID 4 /* dst address key, deprecated */ #define WARTS_TRACE_START 5 /* start timestamp */ #define WARTS_TRACE_STOP_R 6 /* stop reason */ #define WARTS_TRACE_STOP_D 7 /* stop data */ #define WARTS_TRACE_FLAGS 8 /* flags */ #define WARTS_TRACE_ATTEMPTS 9 /* attempts */ #define WARTS_TRACE_HOPLIMIT 10 /* hoplimit */ #define WARTS_TRACE_TYPE 11 /* type */ #define WARTS_TRACE_PROBE_S 12 /* probe size */ #define WARTS_TRACE_PORT_SRC 13 /* source port */ #define WARTS_TRACE_PORT_DST 14 /* destination port */ #define WARTS_TRACE_FIRSTHOP 15 /* first hop */ #define WARTS_TRACE_TOS 16 /* type of service bits */ #define WARTS_TRACE_WAIT 17 /* how long to wait per probe */ #define WARTS_TRACE_LOOPS 18 /* max loops before stopping */ #define WARTS_TRACE_HOPCOUNT 19 /* hop count */ #define WARTS_TRACE_GAPLIMIT 20 /* gap limit */ #define WARTS_TRACE_GAPACTION 21 /* gap action */ #define WARTS_TRACE_LOOPACTION 22 /* loop action */ #define WARTS_TRACE_PROBEC 23 /* probe count */ #define WARTS_TRACE_WAITPROBE 24 /* min wait between probes */ #define WARTS_TRACE_CONFIDENCE 25 /* confidence level to attain */ #define WARTS_TRACE_ADDR_SRC 26 /* source address key */ #define WARTS_TRACE_ADDR_DST 27 /* destination address key */ #define WARTS_TRACE_USERID 28 /* user id */ #define WARTS_TRACE_OFFSET 29 /* IP offset to use in fragments */ static const warts_var_t trace_vars[] = { {WARTS_TRACE_LIST_ID, 4, -1}, {WARTS_TRACE_CYCLE_ID, 4, -1}, {WARTS_TRACE_ADDR_SRC_GID, 4, -1}, {WARTS_TRACE_ADDR_DST_GID, 4, -1}, {WARTS_TRACE_START, 8, -1}, {WARTS_TRACE_STOP_R, 1, -1}, {WARTS_TRACE_STOP_D, 1, -1}, {WARTS_TRACE_FLAGS, 1, -1}, {WARTS_TRACE_ATTEMPTS, 1, -1}, {WARTS_TRACE_HOPLIMIT, 1, -1}, {WARTS_TRACE_TYPE, 1, -1}, {WARTS_TRACE_PROBE_S, 2, -1}, {WARTS_TRACE_PORT_SRC, 2, -1}, {WARTS_TRACE_PORT_DST, 2, -1}, {WARTS_TRACE_FIRSTHOP, 1, -1}, {WARTS_TRACE_TOS, 1, -1}, {WARTS_TRACE_WAIT, 1, -1}, {WARTS_TRACE_LOOPS, 1, -1}, {WARTS_TRACE_HOPCOUNT, 2, -1}, {WARTS_TRACE_GAPLIMIT, 1, -1}, {WARTS_TRACE_GAPACTION, 1, -1}, {WARTS_TRACE_LOOPACTION, 1, -1}, {WARTS_TRACE_PROBEC, 2, -1}, {WARTS_TRACE_WAITPROBE, 1, -1}, {WARTS_TRACE_CONFIDENCE, 1, -1}, {WARTS_TRACE_ADDR_SRC, -1, -1}, {WARTS_TRACE_ADDR_DST, -1, -1}, {WARTS_TRACE_USERID, 4, -1}, {WARTS_TRACE_OFFSET, 2, -1}, }; #define trace_vars_mfb WARTS_VAR_MFB(trace_vars) /* * the optional bits of a trace pmtud structure */ #define WARTS_TRACE_PMTUD_IFMTU 1 /* interface mtu */ #define WARTS_TRACE_PMTUD_PMTU 2 /* path mtu */ #define WARTS_TRACE_PMTUD_OUTMTU 3 /* mtu to gateway */ #define WARTS_TRACE_PMTUD_VER 4 /* version of data collection */ #define WARTS_TRACE_PMTUD_NOTEC 5 /* number of notes attached */ static const warts_var_t pmtud_vars[] = { {WARTS_TRACE_PMTUD_IFMTU, 2, -1}, {WARTS_TRACE_PMTUD_PMTU, 2, -1}, {WARTS_TRACE_PMTUD_OUTMTU, 2, -1}, {WARTS_TRACE_PMTUD_VER, 1, -1}, {WARTS_TRACE_PMTUD_NOTEC, 1, -1}, }; #define pmtud_vars_mfb WARTS_VAR_MFB(pmtud_vars) #define WARTS_TRACE_PMTUD_N_TYPE 1 /* type of note */ #define WARTS_TRACE_PMTUD_N_NHMTU 2 /* nhmtu measured */ #define WARTS_TRACE_PMTUD_N_HOP 3 /* hop record; index into hops */ static const warts_var_t pmtud_n_vars[] = { {WARTS_TRACE_PMTUD_N_TYPE, 1, -1}, {WARTS_TRACE_PMTUD_N_NHMTU, 2, -1}, {WARTS_TRACE_PMTUD_N_HOP, 2, -1}, }; #define pmtud_n_vars_mfb WARTS_VAR_MFB(pmtud_n_vars) /* * the optional bits of a trace dtree structure */ #define WARTS_TRACE_DTREE_LSS_STOP_GID 1 /* deprecated */ #define WARTS_TRACE_DTREE_GSS_STOP_GID 2 /* deprecated */ #define WARTS_TRACE_DTREE_FIRSTHOP 3 /* firsthop */ #define WARTS_TRACE_DTREE_LSS_STOP 4 /* lss stop address */ #define WARTS_TRACE_DTREE_GSS_STOP 5 /* gss stop address */ #define WARTS_TRACE_DTREE_LSS_NAME 6 /* lss name */ #define WARTS_TRACE_DTREE_FLAGS 7 /* flags */ static const warts_var_t trace_dtree_vars[] = { {WARTS_TRACE_DTREE_LSS_STOP_GID, 4, -1}, {WARTS_TRACE_DTREE_GSS_STOP_GID, 4, -1}, {WARTS_TRACE_DTREE_FIRSTHOP, 1, -1}, {WARTS_TRACE_DTREE_LSS_STOP, -1, -1}, {WARTS_TRACE_DTREE_GSS_STOP, -1, -1}, {WARTS_TRACE_DTREE_LSS_NAME, -1, -1}, {WARTS_TRACE_DTREE_FLAGS, 1, -1}, }; #define trace_dtree_vars_mfb WARTS_VAR_MFB(trace_dtree_vars) /* * the optional bits of a trace hop structure */ #define WARTS_TRACE_HOP_ADDR_GID 1 /* address id, deprecated */ #define WARTS_TRACE_HOP_PROBE_TTL 2 /* probe ttl */ #define WARTS_TRACE_HOP_REPLY_TTL 3 /* reply ttl */ #define WARTS_TRACE_HOP_FLAGS 4 /* flags */ #define WARTS_TRACE_HOP_PROBE_ID 5 /* probe id */ #define WARTS_TRACE_HOP_RTT 6 /* round trip time */ #define WARTS_TRACE_HOP_ICMP_TC 7 /* icmp type / code */ #define WARTS_TRACE_HOP_PROBE_SIZE 8 /* probe size */ #define WARTS_TRACE_HOP_REPLY_SIZE 9 /* reply size */ #define WARTS_TRACE_HOP_REPLY_IPID 10 /* ipid of reply packet */ #define WARTS_TRACE_HOP_REPLY_IPTOS 11 /* tos bits of reply packet */ #define WARTS_TRACE_HOP_NHMTU 12 /* next hop mtu in ptb message */ #define WARTS_TRACE_HOP_Q_IPLEN 13 /* ip->len from inside icmp */ #define WARTS_TRACE_HOP_Q_IPTTL 14 /* ip->ttl from inside icmp */ #define WARTS_TRACE_HOP_TCP_FLAGS 15 /* tcp->flags of reply packet */ #define WARTS_TRACE_HOP_Q_IPTOS 16 /* ip->tos byte inside icmp */ #define WARTS_TRACE_HOP_ICMPEXT 17 /* RFC 4884 icmp extension data */ #define WARTS_TRACE_HOP_ADDR 18 /* address */ #define WARTS_TRACE_HOP_TX 19 /* transmit time */ static const warts_var_t hop_vars[] = { {WARTS_TRACE_HOP_ADDR_GID, 4, -1}, {WARTS_TRACE_HOP_PROBE_TTL, 1, -1}, {WARTS_TRACE_HOP_REPLY_TTL, 1, -1}, {WARTS_TRACE_HOP_FLAGS, 1, -1}, {WARTS_TRACE_HOP_PROBE_ID, 1, -1}, {WARTS_TRACE_HOP_RTT, 4, -1}, {WARTS_TRACE_HOP_ICMP_TC, 2, -1}, {WARTS_TRACE_HOP_PROBE_SIZE, 2, -1}, {WARTS_TRACE_HOP_REPLY_SIZE, 2, -1}, {WARTS_TRACE_HOP_REPLY_IPID, 2, -1}, {WARTS_TRACE_HOP_REPLY_IPTOS, 1, -1}, {WARTS_TRACE_HOP_NHMTU, 2, -1}, {WARTS_TRACE_HOP_Q_IPLEN, 2, -1}, {WARTS_TRACE_HOP_Q_IPTTL, 1, -1}, {WARTS_TRACE_HOP_TCP_FLAGS, 1, -1}, {WARTS_TRACE_HOP_Q_IPTOS, 1, -1}, {WARTS_TRACE_HOP_ICMPEXT, -1, -1}, {WARTS_TRACE_HOP_ADDR, -1, -1}, {WARTS_TRACE_HOP_TX, 8, -1}, }; #define hop_vars_mfb WARTS_VAR_MFB(hop_vars) typedef struct warts_trace_hop { scamper_trace_hop_t *hop; uint8_t flags[WARTS_VAR_MFB(hop_vars)]; uint16_t flags_len; uint16_t params_len; } warts_trace_hop_t; typedef struct warts_trace_dtree { uint8_t flags[WARTS_VAR_MFB(trace_dtree_vars)]; uint16_t flags_len; uint16_t params_len; uint32_t len; } warts_trace_dtree_t; typedef struct warts_trace_pmtud_n { uint8_t flags[pmtud_n_vars_mfb]; uint16_t flags_len; uint16_t params_len; uint16_t hop; } warts_trace_pmtud_n_t; typedef struct warts_trace_pmtud { uint8_t flags[pmtud_vars_mfb]; uint16_t flags_len; uint16_t params_len; warts_trace_hop_t *hops; uint16_t hopc; warts_trace_pmtud_n_t *notes; uint32_t len; } warts_trace_pmtud_t; static void warts_trace_params(const scamper_trace_t *trace, warts_addrtable_t *table, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { int max_id = 0; const warts_var_t *var; size_t i; /* unset all the flags possible */ memset(flags, 0, trace_vars_mfb); *params_len = 0; for(i=0; iid == WARTS_TRACE_ADDR_SRC_GID || var->id == WARTS_TRACE_ADDR_DST_GID) { continue; } if(var->id == WARTS_TRACE_USERID) { if(trace->userid == 0) continue; } if(var->id == WARTS_TRACE_OFFSET) { if(trace->offset == 0) continue; } flag_set(flags, var->id, &max_id); if(var->id == WARTS_TRACE_ADDR_SRC) { *params_len += warts_addr_size(table, trace->src); continue; } else if(var->id == WARTS_TRACE_ADDR_DST) { *params_len += warts_addr_size(table, trace->dst); continue; } assert(var->size >= 0); *params_len += var->size; } *flags_len = fold_flags(flags, max_id); return; } static int warts_trace_params_read(scamper_trace_t *trace,warts_state_t *state, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&trace->list, (wpr_t)extract_list, state}, {&trace->cycle, (wpr_t)extract_cycle, state}, {&trace->src, (wpr_t)extract_addr_gid, state}, {&trace->dst, (wpr_t)extract_addr_gid, state}, {&trace->start, (wpr_t)extract_timeval, NULL}, {&trace->stop_reason, (wpr_t)extract_byte, NULL}, {&trace->stop_data, (wpr_t)extract_byte, NULL}, {&trace->flags, (wpr_t)extract_byte, NULL}, {&trace->attempts, (wpr_t)extract_byte, NULL}, {&trace->hoplimit, (wpr_t)extract_byte, NULL}, {&trace->type, (wpr_t)extract_byte, NULL}, {&trace->probe_size, (wpr_t)extract_uint16, NULL}, {&trace->sport, (wpr_t)extract_uint16, NULL}, {&trace->dport, (wpr_t)extract_uint16, NULL}, {&trace->firsthop, (wpr_t)extract_byte, NULL}, {&trace->tos, (wpr_t)extract_byte, NULL}, {&trace->wait, (wpr_t)extract_byte, NULL}, {&trace->loops, (wpr_t)extract_byte, NULL}, {&trace->hop_count, (wpr_t)extract_uint16, NULL}, {&trace->gaplimit, (wpr_t)extract_byte, NULL}, {&trace->gapaction, (wpr_t)extract_byte, NULL}, {&trace->loopaction, (wpr_t)extract_byte, NULL}, {&trace->probec, (wpr_t)extract_uint16, NULL}, {&trace->wait_probe, (wpr_t)extract_byte, NULL}, {&trace->confidence, (wpr_t)extract_byte, NULL}, {&trace->src, (wpr_t)extract_addr, table}, {&trace->dst, (wpr_t)extract_addr, table}, {&trace->userid, (wpr_t)extract_uint32, NULL}, {&trace->offset, (wpr_t)extract_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); int rc; if((rc = warts_params_read(buf, off, len, handlers, handler_cnt)) != 0) return rc; if(trace->dst == NULL) return -1; return 0; } static int warts_trace_params_write(const scamper_trace_t *trace, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len) { uint32_t list_id, cycle_id; warts_param_writer_t handlers[] = { {&list_id, (wpw_t)insert_uint32, NULL}, {&cycle_id, (wpw_t)insert_uint32, NULL}, {NULL, NULL, NULL}, {NULL, NULL, NULL}, {&trace->start, (wpw_t)insert_timeval, NULL}, {&trace->stop_reason, (wpw_t)insert_byte, NULL}, {&trace->stop_data, (wpw_t)insert_byte, NULL}, {&trace->flags, (wpw_t)insert_byte, NULL}, {&trace->attempts, (wpw_t)insert_byte, NULL}, {&trace->hoplimit, (wpw_t)insert_byte, NULL}, {&trace->type, (wpw_t)insert_byte, NULL}, {&trace->probe_size, (wpw_t)insert_uint16, NULL}, {&trace->sport, (wpw_t)insert_uint16, NULL}, {&trace->dport, (wpw_t)insert_uint16, NULL}, {&trace->firsthop, (wpw_t)insert_byte, NULL}, {&trace->tos, (wpw_t)insert_byte, NULL}, {&trace->wait, (wpw_t)insert_byte, NULL}, {&trace->loops, (wpw_t)insert_byte, NULL}, {&trace->hop_count, (wpw_t)insert_uint16, NULL}, {&trace->gaplimit, (wpw_t)insert_byte, NULL}, {&trace->gapaction, (wpw_t)insert_byte, NULL}, {&trace->loopaction, (wpw_t)insert_byte, NULL}, {&trace->probec, (wpw_t)insert_uint16, NULL}, {&trace->wait_probe, (wpw_t)insert_byte, NULL}, {&trace->confidence, (wpw_t)insert_byte, NULL}, {trace->src, (wpw_t)insert_addr, table}, {trace->dst, (wpw_t)insert_addr, table}, {&trace->userid, (wpw_t)insert_uint32, NULL}, {&trace->offset, (wpw_t)insert_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); if(warts_list_getid(sf, trace->list, &list_id) == -1) return -1; if(warts_cycle_getid(sf, trace->cycle, &cycle_id) == -1) return -1; warts_params_write(buf, off, len, flags, flags_len, params_len, handlers, handler_cnt); return 0; } static int warts_trace_hop_read_icmp_tc(const uint8_t *buf, uint32_t *off, uint32_t len, scamper_trace_hop_t *hop, void *param) { if(len - *off < 2) return -1; hop->hop_icmp_type = buf[(*off)++]; hop->hop_icmp_code = buf[(*off)++]; return 0; } static void warts_trace_hop_write_icmp_tc(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_trace_hop_t *hop, void *param) { assert(len - *off >= 2); buf[(*off)++] = hop->hop_icmp_type; buf[(*off)++] = hop->hop_icmp_code; return; } static int warts_trace_hop_read_probe_id(const uint8_t *buf, uint32_t *off, uint32_t len, uint8_t *out, void *param) { if(len - *off < 1) { return -1; } *out = buf[(*off)++] + 1; return 0; } static void warts_trace_hop_write_probe_id(uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *in, void *param) { assert(len - *off >= 1); buf[(*off)++] = *in - 1; return; } static int warts_trace_hop_read_icmpext(const uint8_t *buf, uint32_t *off, uint32_t len, scamper_trace_hop_t *hop, void *param) { return warts_icmpext_read(buf, off, len, &hop->hop_icmpext); } static void warts_trace_hop_write_icmpext(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_trace_hop_t *hop, void *param) { warts_icmpext_write(buf, off, len, hop->hop_icmpext); return; } static void warts_trace_hop_params(const scamper_trace_t *trace, const scamper_trace_hop_t *hop, warts_addrtable_t *table, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { scamper_icmpext_t *ie; const warts_var_t *var; int i, max_id = 0; /* unset all the flags possible */ memset(flags, 0, hop_vars_mfb); *params_len = 0; for(i=0; iid == WARTS_TRACE_HOP_ADDR_GID) continue; if(var->id == WARTS_TRACE_HOP_ADDR) { if(hop->hop_addr == NULL) continue; } else if(var->id == WARTS_TRACE_HOP_TCP_FLAGS) { if(SCAMPER_TRACE_HOP_IS_TCP(hop) == 0) continue; } else if(var->id == WARTS_TRACE_HOP_ICMP_TC) { if(SCAMPER_TRACE_HOP_IS_ICMP(hop) == 0) continue; } else if(var->id == WARTS_TRACE_HOP_Q_IPLEN) { if(SCAMPER_TRACE_HOP_IS_ICMP_Q(hop) == 0) continue; if(hop->hop_icmp_q_ipl == trace->probe_size) continue; } else if(var->id == WARTS_TRACE_HOP_Q_IPTTL) { if(SCAMPER_TRACE_HOP_IS_ICMP_Q(hop) == 0) continue; if(hop->hop_icmp_q_ttl == 1) continue; } else if(var->id == WARTS_TRACE_HOP_Q_IPTOS) { if(SCAMPER_TRACE_HOP_IS_ICMP_Q(hop) == 0) continue; if(hop->hop_addr->type != SCAMPER_ADDR_TYPE_IPV4) continue; } else if(var->id == WARTS_TRACE_HOP_NHMTU) { if(SCAMPER_TRACE_HOP_IS_ICMP_PTB(hop) == 0) continue; } else if(var->id == WARTS_TRACE_HOP_ICMPEXT) { if(hop->hop_icmpext == NULL) continue; } else if(var->id == WARTS_TRACE_HOP_REPLY_IPID) { if(hop->hop_reply_ipid == 0) continue; } else if(var->id == WARTS_TRACE_HOP_TX) { if(hop->hop_tx.tv_sec == 0) continue; } flag_set(flags, var->id, &max_id); if(var->id == WARTS_TRACE_HOP_ADDR) { *params_len += warts_addr_size(table, hop->hop_addr); } else if(var->id == WARTS_TRACE_HOP_ICMPEXT) { *params_len += 2; for(ie = hop->hop_icmpext; ie != NULL; ie = ie->ie_next) *params_len += (2 + 1 + 1 + ie->ie_dl); } else { assert(var->size >= 0); *params_len += var->size; } } *flags_len = fold_flags(flags, max_id); return; } static void warts_trace_hop_state(const scamper_trace_t *trace, scamper_trace_hop_t *hop, warts_trace_hop_t *state, warts_addrtable_t *table, uint32_t *len) { /* for each hop, figure out how much space it will take up */ warts_trace_hop_params(trace, hop, table, state->flags, &state->flags_len, &state->params_len); /* store the actual hop record with the state structure too */ state->hop = hop; /* increase length required for the trace record */ *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return; } static int warts_trace_hop_read(scamper_trace_hop_t *hop, warts_state_t *state, warts_addrtable_t *table, const uint8_t *buf,uint32_t *off,uint32_t len) { warts_param_reader_t handlers[] = { {&hop->hop_addr, (wpr_t)extract_addr_gid, state}, {&hop->hop_probe_ttl, (wpr_t)extract_byte, NULL}, {&hop->hop_reply_ttl, (wpr_t)extract_byte, NULL}, {&hop->hop_flags, (wpr_t)extract_byte, NULL}, {&hop->hop_probe_id, (wpr_t)warts_trace_hop_read_probe_id, NULL}, {&hop->hop_rtt, (wpr_t)extract_rtt, NULL}, {hop, (wpr_t)warts_trace_hop_read_icmp_tc, NULL}, {&hop->hop_probe_size, (wpr_t)extract_uint16, NULL}, {&hop->hop_reply_size, (wpr_t)extract_uint16, NULL}, {&hop->hop_reply_ipid, (wpr_t)extract_uint16, NULL}, {&hop->hop_reply_tos, (wpr_t)extract_byte, NULL}, {&hop->hop_icmp_nhmtu, (wpr_t)extract_uint16, NULL}, {&hop->hop_icmp_q_ipl, (wpr_t)extract_uint16, NULL}, {&hop->hop_icmp_q_ttl, (wpr_t)extract_byte, NULL}, {&hop->hop_tcp_flags, (wpr_t)extract_byte, NULL}, {&hop->hop_icmp_q_tos, (wpr_t)extract_byte, NULL}, {hop, (wpr_t)warts_trace_hop_read_icmpext, NULL}, {&hop->hop_addr, (wpr_t)extract_addr, table}, {&hop->hop_tx, (wpr_t)extract_timeval, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); uint32_t o = *off; int rc; if((rc = warts_params_read(buf, off, len, handlers, handler_cnt)) != 0) return rc; if(hop->hop_addr == NULL) return -1; if(hop->hop_probe_ttl == 0) return -1; if(SCAMPER_TRACE_HOP_IS_ICMP_Q(hop)) { if(flag_isset(&buf[o], WARTS_TRACE_HOP_Q_IPTTL) == 0) hop->hop_icmp_q_ttl = 1; if(flag_isset(&buf[o], WARTS_TRACE_HOP_Q_IPLEN) == 0) hop->hop_icmp_q_ipl = hop->hop_probe_size; } return 0; } static void warts_trace_hop_write(const warts_trace_hop_t *state, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { scamper_trace_hop_t *hop = state->hop; warts_param_writer_t handlers[] = { {NULL, NULL, NULL}, {&hop->hop_probe_ttl, (wpw_t)insert_byte, NULL}, {&hop->hop_reply_ttl, (wpw_t)insert_byte, NULL}, {&hop->hop_flags, (wpw_t)insert_byte, NULL}, {&hop->hop_probe_id, (wpw_t)warts_trace_hop_write_probe_id, NULL}, {&hop->hop_rtt, (wpw_t)insert_rtt, NULL}, {hop, (wpw_t)warts_trace_hop_write_icmp_tc, NULL}, {&hop->hop_probe_size, (wpw_t)insert_uint16, NULL}, {&hop->hop_reply_size, (wpw_t)insert_uint16, NULL}, {&hop->hop_reply_ipid, (wpw_t)insert_uint16, NULL}, {&hop->hop_reply_tos, (wpw_t)insert_byte, NULL}, {&hop->hop_icmp_nhmtu, (wpw_t)insert_uint16, NULL}, {&hop->hop_icmp_q_ipl, (wpw_t)insert_uint16, NULL}, {&hop->hop_icmp_q_ttl, (wpw_t)insert_byte, NULL}, {&hop->hop_tcp_flags, (wpw_t)insert_byte, NULL}, {&hop->hop_icmp_q_tos, (wpw_t)insert_byte, NULL}, {hop, (wpw_t)warts_trace_hop_write_icmpext, NULL}, {hop->hop_addr, (wpw_t)insert_addr, table}, {&hop->hop_tx, (wpw_t)insert_timeval, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static int warts_trace_hops_read(scamper_trace_hop_t **hops, warts_state_t *state, warts_addrtable_t *table, const uint8_t *buf, uint32_t *off, uint32_t len, uint16_t count) { scamper_trace_hop_t *head = NULL, *hop = NULL; uint16_t i; for(i=0; ihop_next = scamper_trace_hop_alloc(); hop = hop->hop_next; } else { head = hop = scamper_trace_hop_alloc(); } /* could not allocate an empty hop structure ... */ if(hop == NULL) goto err; if(warts_trace_hop_read(hop, state, table, buf, off, len) != 0) goto err; } *hops = head; return 0; err: while(head != NULL) { hop = head; head = head->hop_next; scamper_trace_hop_free(hop); } return -1; } static void warts_trace_pmtud_n_params(const scamper_trace_pmtud_t *pmtud, const scamper_trace_pmtud_n_t *n, warts_trace_pmtud_n_t *state) { const scamper_trace_hop_t *hop; const warts_var_t *var; uint16_t u16; int i, max_id = 0; memset(state->flags, 0, pmtud_n_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_TRACE_PMTUD_N_TYPE) { if(n->type == 0) continue; } else if(var->id == WARTS_TRACE_PMTUD_N_NHMTU) { if(n->nhmtu == 0) continue; } else if(var->id == WARTS_TRACE_PMTUD_N_HOP) { if(n->hop == NULL) continue; u16 = 0; for(hop = pmtud->hops; hop != NULL; hop = hop->hop_next) { if(hop == n->hop) break; u16++; } assert(hop != NULL); state->hop = u16; } flag_set(state->flags, var->id, &max_id); assert(var->size >= 0); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); return; } static void warts_trace_pmtud_n_write(const scamper_trace_pmtud_n_t *note, uint8_t *buf, uint32_t *off, uint32_t len, warts_trace_pmtud_n_t *state) { warts_param_writer_t handlers[] = { {¬e->type, (wpw_t)insert_byte, NULL}, {¬e->nhmtu, (wpw_t)insert_uint16, NULL}, {&state->hop, (wpw_t)insert_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static int warts_trace_pmtud_n_read(const scamper_trace_pmtud_t *pmtud, scamper_trace_pmtud_n_t *note, const uint8_t *buf, uint32_t *off, uint32_t len) { scamper_trace_hop_t *hop; uint16_t u16 = 0; warts_param_reader_t handlers[] = { {¬e->type, (wpr_t)extract_byte, NULL}, {¬e->nhmtu, (wpr_t)extract_uint16, NULL}, {&u16, (wpr_t)extract_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); uint32_t o = *off; if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; if(flag_isset(&buf[o], WARTS_TRACE_PMTUD_N_HOP)) { hop = pmtud->hops; while(u16 > 0) { if(hop == NULL) break; hop = hop->hop_next; u16--; } if(hop == NULL) return -1; note->hop = hop; } return 0; } static void warts_trace_pmtud_params(const scamper_trace_t *trace, warts_trace_pmtud_t *state) { const scamper_trace_pmtud_t *pmtud = trace->pmtud; const warts_var_t *var; int i, max_id = 0; /* unset all the flags possible */ memset(state->flags, 0, pmtud_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_TRACE_PMTUD_IFMTU) { if(pmtud->ifmtu == 0) continue; } else if(var->id == WARTS_TRACE_PMTUD_PMTU) { if(pmtud->pmtu == 0) continue; } else if(var->id == WARTS_TRACE_PMTUD_OUTMTU) { if(pmtud->outmtu == 0) continue; } else if(var->id == WARTS_TRACE_PMTUD_NOTEC) { if(pmtud->notec == 0) continue; } flag_set(state->flags, var->id, &max_id); assert(var->size >= 0); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); return; } static int warts_trace_pmtud_state(const scamper_trace_t *trace, warts_trace_pmtud_t *state, warts_addrtable_t *table) { warts_trace_pmtud_n_t *note; scamper_trace_hop_t *hop; uint8_t i; size_t size; int j; /* figure out what the structure of the pmtud header looks like */ warts_trace_pmtud_params(trace, state); /* flags + params + number of hop records for pmtud structure */ state->len = state->flags_len + state->params_len + 2; if(state->params_len != 0) state->len += 2; /* count the number of hop records */ state->hopc = scamper_trace_pmtud_hop_count(trace); if(state->hopc > 0) { /* allocate an array of address indexes for the pmtud hop addresses */ size = state->hopc * sizeof(warts_trace_hop_t); if((state->hops = (warts_trace_hop_t *)malloc_zero(size)) == NULL) return -1; /* record hop state for each pmtud hop */ for(hop = trace->pmtud->hops, j=0; hop != NULL; hop = hop->hop_next) warts_trace_hop_state(trace,hop,&state->hops[j++],table,&state->len); } /* record state for each pmtud note */ if(trace->pmtud->notec > 0) { size = trace->pmtud->notec * sizeof(warts_trace_pmtud_n_t); if((state->notes = (warts_trace_pmtud_n_t *)malloc_zero(size)) == NULL) return -1; for(i=0; ipmtud->notec; i++) { note = &state->notes[i]; warts_trace_pmtud_n_params(trace->pmtud,trace->pmtud->notes[i],note); /* increase length required for the trace record */ state->len += note->flags_len + note->params_len; if(note->params_len != 0) state->len += 2; } } return 0; } static int warts_trace_pmtud_read(scamper_trace_t *trace, warts_state_t *state, warts_addrtable_t *table, const uint8_t *buf, uint32_t *off, uint32_t len) { uint16_t ifmtu = 0, pmtu = 0, outmtu = 0; uint8_t ver = 1, notec = 0; warts_param_reader_t handlers[] = { {&ifmtu, (wpr_t)extract_uint16, NULL}, {&pmtu, (wpr_t)extract_uint16, NULL}, {&outmtu, (wpr_t)extract_uint16, NULL}, {&ver, (wpr_t)extract_byte, NULL}, {¬ec, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); scamper_trace_pmtud_n_t *n = NULL; scamper_trace_hop_t *hops; uint16_t count; uint8_t u8; if(scamper_trace_pmtud_alloc(trace) != 0) goto err; if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) goto err; trace->pmtud->ifmtu = ifmtu; trace->pmtud->pmtu = pmtu; trace->pmtud->outmtu = outmtu; trace->pmtud->ver = ver; trace->pmtud->notec = notec; /* the number of hop records that follow */ if(extract_uint16(buf, off, len, &count, NULL) != 0) goto err; if(count != 0) { if(warts_trace_hops_read(&hops,state,table,buf,off,len,count) != 0) goto err; trace->pmtud->hops = hops; } if(trace->pmtud->notec != 0) { if(scamper_trace_pmtud_n_alloc_c(trace->pmtud, trace->pmtud->notec) != 0) goto err; for(u8=0; u8pmtud->notec; u8++) { if((n = scamper_trace_pmtud_n_alloc()) == NULL) goto err; if(warts_trace_pmtud_n_read(trace->pmtud, n, buf, off, len) != 0) goto err; trace->pmtud->notes[u8] = n; n = NULL; } } return 0; err: if(n != NULL) scamper_trace_pmtud_n_free(n); return -1; } static void warts_trace_pmtud_write(const scamper_trace_t *trace, uint8_t *buf, uint32_t *off, uint32_t len, warts_trace_pmtud_t *state, warts_addrtable_t *table) { warts_param_writer_t handlers[] = { {&trace->pmtud->ifmtu, (wpw_t)insert_uint16, NULL}, {&trace->pmtud->pmtu, (wpw_t)insert_uint16, NULL}, {&trace->pmtud->outmtu, (wpw_t)insert_uint16, NULL}, {&trace->pmtud->ver, (wpw_t)insert_byte, NULL}, {&trace->pmtud->notec, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); uint16_t u16; uint8_t u8; warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); /* write the number of hop records */ insert_uint16(buf, off, len, &state->hopc, NULL); /* write the hop records */ for(u16=0; u16hopc; u16++) warts_trace_hop_write(&state->hops[u16], table, buf, off, len); /* write the notes */ for(u8=0; u8pmtud->notec; u8++) warts_trace_pmtud_n_write(trace->pmtud->notes[u8], buf, off, len, &state->notes[u8]); return; } static void warts_trace_pmtud_free(warts_trace_pmtud_t *state) { if(state == NULL) return; if(state->hops != NULL) free(state->hops); free(state); return; } static int warts_trace_lastditch_read(scamper_trace_t *trace, warts_state_t *state, warts_addrtable_t *table, const uint8_t *buf, uint32_t *off, uint32_t len) { scamper_trace_hop_t *hops; uint16_t count; if(warts_params_read(buf, off, len, NULL, 0) != 0) goto err; if(extract_uint16(buf, off, len, &count, NULL) != 0) goto err; if(count != 0) { if(warts_trace_hops_read(&hops,state,table,buf,off,len,count) != 0) goto err; trace->lastditch = hops; } return 0; err: return -1; } static int warts_trace_dtree_params(const scamper_file_t *sf, const scamper_trace_t *trace, warts_addrtable_t *table, warts_trace_dtree_t *state) { scamper_trace_dtree_t *dtree = trace->dtree; const warts_var_t *var; int i, max_id = 0; /* unset all the flags possible */ memset(state->flags, 0, trace_dtree_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_TRACE_DTREE_LSS_STOP_GID || var->id == WARTS_TRACE_DTREE_GSS_STOP_GID) continue; if((var->id == WARTS_TRACE_DTREE_LSS_STOP && dtree->lss_stop == NULL) || (var->id == WARTS_TRACE_DTREE_LSS_NAME && dtree->lss == NULL) || (var->id == WARTS_TRACE_DTREE_GSS_STOP && dtree->gss_stop == NULL) || (var->id == WARTS_TRACE_DTREE_FLAGS && dtree->flags == 0)) continue; flag_set(state->flags, var->id, &max_id); /* variables that don't have a fixed size */ if(var->id == WARTS_TRACE_DTREE_LSS_STOP) { state->params_len += warts_addr_size(table, dtree->lss_stop); continue; } else if(var->id == WARTS_TRACE_DTREE_LSS_NAME) { state->params_len += warts_str_size(dtree->lss); continue; } else if(var->id == WARTS_TRACE_DTREE_GSS_STOP) { state->params_len += warts_addr_size(table, dtree->gss_stop); continue; } assert(var->size != -1); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); state->len = state->flags_len + state->params_len; if(state->params_len != 0) state->len += 2 ; return 0; } static void warts_trace_dtree_write(const scamper_trace_t *trace, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len, warts_trace_dtree_t *state) { warts_param_writer_t handlers[] = { {NULL, NULL, NULL}, {NULL, NULL, NULL}, {&trace->dtree->firsthop, (wpw_t)insert_byte, NULL}, {trace->dtree->lss_stop, (wpw_t)insert_addr, table}, {trace->dtree->gss_stop, (wpw_t)insert_addr, table}, {trace->dtree->lss, (wpw_t)insert_string, NULL}, {&trace->dtree->flags, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static int warts_trace_dtree_read(scamper_trace_t *trace, warts_state_t *state, warts_addrtable_t *table, const uint8_t *buf, uint32_t *off, uint32_t len) { scamper_addr_t *lss_stop = NULL, *gss_stop = NULL; uint8_t firsthop = 0, flags = 0; char *lss = NULL; warts_param_reader_t handlers[] = { {&lss_stop, (wpr_t)extract_addr_gid, state}, {&gss_stop, (wpr_t)extract_addr_gid, state}, {&firsthop, (wpr_t)extract_byte, NULL}, {&lss_stop, (wpr_t)extract_addr, table}, {&gss_stop, (wpr_t)extract_addr, table}, {&lss, (wpr_t)extract_string, NULL}, {&flags, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(scamper_trace_dtree_alloc(trace) != 0 || warts_params_read(buf, off, len, handlers, handler_cnt) != 0) { if(lss_stop != NULL) scamper_addr_free(lss_stop); if(gss_stop != NULL) scamper_addr_free(gss_stop); if(lss != NULL) free(lss); return -1; } trace->dtree->lss_stop = lss_stop; trace->dtree->gss_stop = gss_stop; trace->dtree->firsthop = firsthop; trace->dtree->lss = lss; trace->dtree->flags = flags; return 0; } /* * warts_trace_read * */ int scamper_file_warts_trace_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_trace_t **trace_out) { warts_state_t *state = scamper_file_getstate(sf); scamper_trace_t *trace = NULL; uint8_t *buf = NULL; uint32_t i, off = 0; scamper_trace_hop_t *hops = NULL; scamper_trace_hop_t *hop; uint16_t count; uint8_t max_ttl; uint8_t type; uint16_t len; uint16_t u16; warts_addrtable_t *table = NULL; if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { *trace_out = NULL; return 0; } if((trace = scamper_trace_alloc()) == NULL) { goto err; } if((table = warts_addrtable_alloc_byid()) == NULL) goto err; /* read the trace's parameters */ if(warts_trace_params_read(trace, state, table, buf, &off, hdr->len) != 0) { goto err; } /* * the next two bytes tell us how many scamper_hops to read out of trace * if we did not get any responses, we are done. */ if(extract_uint16(buf, &off, hdr->len, &count, NULL) != 0) { goto err; } /* read all the hop records */ if(warts_trace_hops_read(&hops,state,table,buf,&off,hdr->len,count) != 0) goto err; /* work out the maximum ttl probed with that got a response */ max_ttl = 0; for(i=0, hop = hops; i < count; i++) { if(hop->hop_probe_ttl > max_ttl) max_ttl = hop->hop_probe_ttl; hop = hop->hop_next; } /* * if the hop_count field was provided in the file, then * make sure it makes sense based on the hop data we've just scanned */ if(trace->hop_count != 0) { if(trace->hop_count < max_ttl) goto err; if(trace->hop_count > 255) goto err; } else { trace->hop_count = max_ttl; } /* allocate enough hops to string the trace together */ if(scamper_trace_hops_alloc(trace, trace->hop_count) == -1) { goto err; } if(hops == NULL) { assert(count == 0); goto done; } /* * now loop through the hops array stored in this procedure * and assemble the responses into trace->hops. */ trace->hops[hops->hop_probe_ttl-1] = hop = hops; while(hop->hop_next != NULL) { if(hop->hop_probe_ttl != hop->hop_next->hop_probe_ttl) { i = hop->hop_next->hop_probe_ttl-1; trace->hops[i] = hop->hop_next; hop->hop_next = NULL; hop = trace->hops[i]; } else hop = hop->hop_next; } hops = NULL; for(;;) { if(extract_uint16(buf, &off, hdr->len, &u16, NULL) != 0) goto err; if(u16 == WARTS_TRACE_ATTR_EOF) break; type = WARTS_TRACE_ATTR_HDR_TYPE(u16); len = WARTS_TRACE_ATTR_HDR_LEN(u16); if(type == WARTS_TRACE_ATTR_PMTUD) { i = off; if(warts_trace_pmtud_read(trace,state,table,buf,&i,hdr->len) != 0) goto err; } else if(type == WARTS_TRACE_ATTR_LASTDITCH) { i = off; if(warts_trace_lastditch_read(trace, state, table, buf, &i, hdr->len) != 0) goto err; } else if(type == WARTS_TRACE_ATTR_DTREE) { i = off; if(warts_trace_dtree_read(trace,state,table,buf,&i,hdr->len) != 0) goto err; } off += len; } done: warts_addrtable_free(table); free(buf); *trace_out = trace; return 0; err: if(table != NULL) warts_addrtable_free(table); if(hops != NULL) free(hops); if(buf != NULL) free(buf); if(trace != NULL) scamper_trace_free(trace); return -1; } int scamper_file_warts_trace_write(const scamper_file_t *sf, const scamper_trace_t *trace) { scamper_trace_hop_t *hop; uint8_t *buf = NULL; uint8_t trace_flags[trace_vars_mfb]; uint16_t trace_flags_len, trace_params_len; warts_trace_hop_t *hop_state = NULL; uint16_t hop_recs; warts_trace_pmtud_t *pmtud = NULL; warts_trace_hop_t *ld_state = NULL; uint16_t ld_recs = 0; uint32_t ld_len = 0; warts_trace_dtree_t dtree_state; uint16_t u16; uint8_t u8; uint32_t off = 0, len, len2; size_t size; int i, j; warts_addrtable_t *table = NULL; memset(&dtree_state, 0, sizeof(dtree_state)); if((table = warts_addrtable_alloc_byaddr()) == NULL) goto err; /* figure out which trace data items we'll store in this record */ warts_trace_params(trace, table, trace_flags, &trace_flags_len, &trace_params_len); /* * this represents the length of the trace's flags and parameters, and the * 2-byte field that records the number of hop records that follow */ len = 8 + trace_flags_len + trace_params_len + 2; if(trace_params_len != 0) len += 2; /* for each hop, figure out what is going to be stored in this record */ if((hop_recs = scamper_trace_hop_count(trace)) > 0) { size = hop_recs * sizeof(warts_trace_hop_t); if((hop_state = (warts_trace_hop_t *)malloc_zero(size)) == NULL) { goto err; } for(i=0, j=0; ihop_count; i++) { for(hop = trace->hops[i]; hop != NULL; hop = hop->hop_next) { /* record basic hop state */ len2 = len; warts_trace_hop_state(trace,hop,&hop_state[j++],table,&len2); if(len2 < len) goto err; len = len2; } } } /* figure out how much space we need for PMTUD data, if we have it */ if(trace->pmtud != NULL) { if((pmtud = malloc_zero(sizeof(warts_trace_pmtud_t))) == NULL) goto err; if(warts_trace_pmtud_state(trace, pmtud, table) != 0) goto err; len += (2 + pmtud->len); /* 2 = size of attribute header */ } if(trace->lastditch != NULL) { /* count the number of last-ditch hop records */ ld_recs = scamper_trace_lastditch_hop_count(trace); /* allocate an array of hop state structs for the lastditch hops */ size = ld_recs * sizeof(warts_trace_hop_t); if((ld_state = (warts_trace_hop_t *)malloc_zero(size)) == NULL) goto err; /* need to record count of lastditch hops and a single zero flags byte */ ld_len = 3; /* record hop state for each lastditch reply */ for(hop = trace->lastditch, j=0; hop != NULL; hop = hop->hop_next) warts_trace_hop_state(trace, hop, &ld_state[j++], table, &ld_len); len += (2 + ld_len); /* 2 = size of attribute header */ } if(trace->dtree != NULL) { /* figure out what the structure of the dtree header looks like */ if(warts_trace_dtree_params(sf, trace, table, &dtree_state) != 0) goto err; /* 2 = size of attribute header */ len += (2 + dtree_state.len); } len += 2; /* EOF */ if((buf = malloc_zero(len)) == NULL) { goto err; } insert_wartshdr(buf, &off, len, SCAMPER_FILE_OBJ_TRACE); /* write trace parameters */ if(warts_trace_params_write(trace, sf, table, buf, &off, len, trace_flags, trace_flags_len, trace_params_len) == -1) { goto err; } /* hop record count */ insert_uint16(buf, &off, len, &hop_recs, NULL); /* write each traceroute hop record */ for(i=0; ilen); insert_uint16(buf, &off, len, &u16, NULL); /* write details of the pmtud measurement */ warts_trace_pmtud_write(trace, buf, &off, len, pmtud, table); warts_trace_pmtud_free(pmtud); pmtud = NULL; } /* write the last-ditch data */ if(trace->lastditch != NULL) { /* write the attribute header */ u16 = WARTS_TRACE_ATTR_HDR(WARTS_TRACE_ATTR_LASTDITCH, ld_len); insert_uint16(buf, &off, len, &u16, NULL); /* write the last-ditch flags: currently zero */ u8 = 0; insert_byte(buf, &off, len, &u8, NULL); /* write the number of hop records */ insert_uint16(buf, &off, len, &ld_recs, NULL); for(i=0; idtree != NULL) { u16 = WARTS_TRACE_ATTR_HDR(WARTS_TRACE_ATTR_DTREE, dtree_state.len); insert_uint16(buf, &off, len, &u16, NULL); /* write details of the pmtud measurement */ warts_trace_dtree_write(trace, table, buf, &off, len, &dtree_state); } /* write the end of trace attributes header */ u16 = WARTS_TRACE_ATTR_EOF; insert_uint16(buf, &off, len, &u16, NULL); assert(off == len); if(warts_write(sf, buf, len) == -1) { goto err; } warts_addrtable_free(table); free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(buf != NULL) free(buf); if(hop_state != NULL) free(hop_state); if(pmtud != NULL) warts_trace_pmtud_free(pmtud); if(ld_state != NULL) free(ld_state); return -1; } scamper-cvs-20171204/scamper/trace/scamper_trace_warts.h000644 001751 000000 00000002232 11634537540 023053 0ustar00mjlwheel000000 000000 /* * scamper_trace_warts.h * * $Id: scamper_trace_warts.h,v 1.3 2011/09/16 03:15:44 mjl Exp $ * * Copyright (C) 2004-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_TRACE_WARTS_H #define __SCAMPER_TRACE_WARTS_H int scamper_file_warts_trace_read(scamper_file_t *sf, const warts_hdr_t *hdr, struct scamper_trace **trace_out); int scamper_file_warts_trace_write(const scamper_file_t *sf, const struct scamper_trace *trace); #endif scamper-cvs-20171204/scamper/tbit/.cvsignore000644 001751 000000 00000000034 12415633115 020505 0ustar00mjlwheel000000 000000 .deps .dirstamp .libs *.lo scamper-cvs-20171204/scamper/tbit/scamper_tbit.c000644 001751 000000 00000051242 13162602311 021326 0ustar00mjlwheel000000 000000 /* * scamper_tbit.c * * Copyright (C) 2009-2010 Ben Stasiewicz * Copyright (C) 2010-2011 The University of Waikato * Copyright (C) 2012 Matthew Luckie * Copyright (C) 2012,2015 The Regents of the University of California * Authors: Ben Stasiewicz, Matthew Luckie * * $Id: scamper_tbit.c,v 1.48 2017/09/27 01:54:17 mjl Exp $ * * This file implements algorithms described in the tbit-1.0 source code, * as well as the papers: * * "On Inferring TCP Behaviour" * by Jitendra Padhye and Sally Floyd * "Measuring the Evolution of Transport Protocols in the Internet" * by Alberto Medina, Mark Allman, and Sally Floyd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_tbit.c,v 1.48 2017/09/27 01:54:17 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_tbit.h" #include "utils.h" typedef struct tqe { int off; scamper_tbit_tcpqe_t *qe; } tqe_t; struct scamper_tbit_tcpq { uint32_t seq; tqe_t **tqes; int tqec; }; int scamper_tbit_data_seqoff(uint32_t rcv_nxt, uint32_t seq) { if(seq >= rcv_nxt) return seq - rcv_nxt; return TCP_MAX_SEQNUM - rcv_nxt + seq + 1; } static int tqe_cmp(const tqe_t *a, const tqe_t *b) { if(a->off < b->off) return -1; if(a->off > b->off) return 1; if(a->qe->len < b->qe->len) return -1; if(a->qe->len > b->qe->len) return 1; return 0; } int scamper_tbit_fo_setcookie(scamper_tbit_t *tbit,uint8_t *cookie,uint8_t len) { if((tbit->fo_cookie = memdup(cookie, len)) == NULL) return -1; tbit->fo_cookielen = len; return 0; } int scamper_tbit_fo_getcookie(scamper_tbit_t *tbit, uint8_t *c, uint8_t *l) { uint8_t u8, v, iphlen, tcphlen, *pktptr; scamper_tbit_pkt_t *pkt; uint32_t i; for(i=0; ipktc; i++) { pkt = tbit->pkts[i]; if(pkt->dir != SCAMPER_TBIT_PKT_DIR_RX) continue; v = (pkt->data[0] >> 4); if(v == 4) { iphlen = (pkt->data[0] & 0xf) * 4; if(pkt->data[9] != IPPROTO_TCP) continue; if((bytes_ntohs(pkt->data+6) & 0x1fff) != 0) continue; } else if(v == 6) { iphlen = 40; u8 = pkt->data[6]; for(;;) { switch(u8) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: case IPPROTO_ROUTING: u8 = pkt->data[iphlen+0]; iphlen += (pkt->data[iphlen+1] * 8) + 8; continue; case IPPROTO_FRAGMENT: if((bytes_ntohs(pkt->data+iphlen+2) & 0xfff8) != 0) break; u8 = pkt->data[iphlen+0]; iphlen += 8; continue; } break; } if(u8 != IPPROTO_TCP) continue; } else continue; if((pkt->data[iphlen+13] & (TH_SYN|TH_ACK)) != (TH_SYN|TH_ACK)) continue; tcphlen = ((pkt->data[iphlen+12] & 0xf0) >> 4) * 4; u8 = 20; while(u8 < tcphlen) { pktptr = pkt->data + iphlen + u8; if(pktptr[0] == 0) break; if(pktptr[1] == 1) { u8++; continue; } if(pktptr[1] == 0 || u8 + pktptr[1] > tcphlen) break; if(pktptr[0] == 34 && pktptr[1] > 2 && pktptr[1] <= 18) { *l = pktptr[1] - 2; memcpy(c, pktptr+2, *l); return 1; } else if(pktptr[0] == 254 && pktptr[1] > 4 && pktptr[1] <= 20 && pktptr[2] == 0xF9 && pktptr[3] == 0x89) { *l = pktptr[1] - 4; memcpy(c, pktptr+4, *l); return 1; } u8 += pktptr[1]; } } return 0; } void scamper_tbit_tcpqe_free(scamper_tbit_tcpqe_t *qe, void (*ff)(void *)) { if(qe == NULL) return; if(ff != NULL && qe->data != NULL) ff(qe->data); free(qe); return; } /* * scamper_tbit_tcpq_tail * * returns the sequence number at the tail of the tcpq, even if there * are gaps in the tcpq. */ uint32_t scamper_tbit_tcpq_tail(const scamper_tbit_tcpq_t *tcpq) { uint32_t range = 0, edge, u32; scamper_tbit_tcpqe_t *qe; int i; for(i=0; itqec; i++) { qe = tcpq->tqes[i]->qe; edge = qe->seq + qe->len; if((u32 = scamper_tbit_data_seqoff(tcpq->seq, edge)) > range) range = u32; } return tcpq->seq + range; } scamper_tbit_tcpq_t *scamper_tbit_tcpq_alloc(uint32_t isn) { scamper_tbit_tcpq_t *q; if((q = malloc_zero(sizeof(scamper_tbit_tcpq_t))) == NULL) goto err; q->seq = isn; return q; err: scamper_tbit_tcpq_free(q, NULL); return NULL; } void scamper_tbit_tcpq_flush(scamper_tbit_tcpq_t *q, void (*ff)(void *)) { tqe_t *tqe; int i; if(q->tqes == NULL) return; for(i=0; itqec; i++) { tqe = q->tqes[i]; scamper_tbit_tcpqe_free(tqe->qe, ff); free(tqe); } free(q->tqes); q->tqes = NULL; q->tqec = 0; return; } void scamper_tbit_tcpq_free(scamper_tbit_tcpq_t *q, void (*ff)(void *)) { if(q == NULL) return; if(q->tqes != NULL) scamper_tbit_tcpq_flush(q, ff); free(q); return; } int scamper_tbit_tcpq_seg(scamper_tbit_tcpq_t *q, uint32_t *seq, uint16_t *len) { tqe_t *tqe; assert(q->tqec >= 0); if(q->tqec == 0) return -1; tqe = q->tqes[0]; assert(q->seq + tqe->off == tqe->qe->seq); *seq = tqe->qe->seq; *len = tqe->qe->len; return 0; } scamper_tbit_tcpqe_t *scamper_tbit_tcpq_pop(scamper_tbit_tcpq_t *q) { scamper_tbit_tcpqe_t *qe; uint16_t len; tqe_t *tqe; int i, off; if(q->tqec == 0) return NULL; tqe = q->tqes[0]; qe = tqe->qe; free(tqe); if(--q->tqec > 0) memmove(q->tqes, q->tqes+1, sizeof(tqe_t *) * q->tqec); off = scamper_tbit_data_seqoff(q->seq, qe->seq); if(off < 0 && off + qe->len <= 0) return qe; len = qe->len + off; for(i=0; itqec; i++) q->tqes[i]->off -= len; q->seq += len; return qe; } int scamper_tbit_tcpq_add(scamper_tbit_tcpq_t *q, uint32_t seq, uint8_t flags, uint16_t len, uint8_t *data) { tqe_t *tqe; assert(scamper_tbit_data_inrange(q->seq, seq, len) != 0); if((tqe = malloc_zero(sizeof(tqe_t))) == NULL) goto err; if((tqe->qe = malloc_zero(sizeof(scamper_tbit_tcpqe_t))) == NULL) goto err; tqe->off = scamper_tbit_data_seqoff(q->seq, seq); tqe->qe->seq = seq; tqe->qe->flags = flags; tqe->qe->len = len; tqe->qe->data = data; if(array_insert((void ***)&q->tqes,&q->tqec,tqe,(array_cmp_t)tqe_cmp) != 0) goto err; return 0; err: if(tqe != NULL) { scamper_tbit_tcpqe_free(tqe->qe, NULL); free(tqe); } return -1; } int scamper_tbit_tcpq_sack(scamper_tbit_tcpq_t *q, uint32_t *sack, int count) { uint32_t left, right; scamper_tbit_tcpqe_t *qe; int i, off, c = 0; assert(q->tqec >= 0); if(q->tqec == 0) return 0; qe = q->tqes[0]->qe; if(qe->len == 0) return 0; left = qe->seq; right = qe->seq + qe->len; assert(scamper_tbit_data_seqoff(q->seq, left) > 0); for(i=1; itqec && c < count; i++) { qe = q->tqes[i]->qe; if(qe->len == 0) continue; if((off = scamper_tbit_data_seqoff(right, qe->seq)) <= 0) { off = abs(off); if(qe->len > off) right = right + qe->len - off; continue; } sack[c*2] = left; sack[(c*2)+1] = right; c++; left = qe->seq; right = qe->seq + qe->len; } if(c < count) { sack[c*2] = left; sack[(c*2)+1] = right; c++; } return c; } /* * scamper_tbit_data_inrange: * * rcv_nxt <= beginning sequence number of segment < rcv_nxt + rcv_wnd OR * rcv_nxt <= ending sequence number of segment < rcv_nxt + rcv_wnd */ int scamper_tbit_data_inrange(uint32_t rcv_nxt, uint32_t seq, uint16_t len) { if((SEQ_LEQ(rcv_nxt, seq) && SEQ_LT(seq, rcv_nxt + 65535)) || (SEQ_LEQ(rcv_nxt, seq+len-1) && SEQ_LT(seq+len-1, rcv_nxt + 65535))) return 1; return 0; } int scamper_tbit_pkt_iplen(const scamper_tbit_pkt_t *pkt) { uint8_t v = pkt->data[0] >> 4; int rc = -1; if(v == 4) rc = bytes_ntohs(pkt->data+2); else if(v == 6) rc = bytes_ntohs(pkt->data+4) + 40; return rc; } int scamper_tbit_pkt_iph(const scamper_tbit_pkt_t *pkt, uint8_t *proto, uint8_t *iphlen, uint16_t *iplen) { uint8_t v = pkt->data[0] >> 4; if(v == 4) { *iphlen = (pkt->data[0] & 0xf) * 4; *iplen = bytes_ntohs(pkt->data+2); *proto = pkt->data[9]; return 0; } if(v == 6) { *iphlen = 40; *iplen = bytes_ntohs(pkt->data+4) + 40; *proto = pkt->data[6]; for(;;) { switch(*proto) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: case IPPROTO_ROUTING: *proto = pkt->data[*iphlen]; *iphlen += (pkt->data[(*iphlen)+1] * 8) + 8; continue; case IPPROTO_FRAGMENT: *proto = pkt->data[*iphlen]; if((bytes_ntohs(pkt->data+(*iphlen)+2) & 0xfff8) != 0) /* off */ return -1; if((pkt->data[(*iphlen)+3] & 0x1) != 0) /* mf */ return -1; *iphlen += 8; continue; } break; } return 0; } return -1; } int scamper_tbit_pkt_tcpdatabytes(const scamper_tbit_pkt_t *pkt, uint16_t *bc) { uint8_t iphlen, tcphlen, proto; uint16_t iplen; if(scamper_tbit_pkt_iph(pkt, &proto, &iphlen, &iplen) != 0) return -1; if(proto != IPPROTO_TCP) return -1; tcphlen = ((pkt->data[iphlen+12] & 0xf0) >> 4) * 4; *bc = iplen - iphlen - tcphlen; return 0; } int scamper_tbit_pkt_tcpack(const scamper_tbit_pkt_t *pkt, uint32_t *ack) { uint8_t iphlen, proto; uint16_t iplen; if(scamper_tbit_pkt_iph(pkt, &proto, &iphlen, &iplen) != 0) return -1; if(proto != IPPROTO_TCP || (pkt->data[iphlen+13] & TH_ACK) == 0) return -1; *ack = bytes_ntohl(pkt->data+iphlen+8); return 0; } int scamper_tbit_icw_size(const scamper_tbit_t *tbit, uint32_t *icw_out) { const scamper_tbit_icw_t *icw = tbit->data; const scamper_tbit_pkt_t *pkt; scamper_tbit_tcpq_t *q = NULL; uint32_t i, u32, seq, start_seq; uint16_t iplen, datalen; uint8_t proto, iphlen, tcphlen, flags, start_seq_c = 0; int rc = -1; if(tbit->result != SCAMPER_TBIT_RESULT_ICW_SUCCESS || tbit->pktc < 1) goto done; for(i=1; ipktc; i++) { pkt = tbit->pkts[i]; if(pkt->dir == SCAMPER_TBIT_PKT_DIR_RX) break; } if(i == tbit->pktc || scamper_tbit_pkt_iph(pkt, &proto, &iphlen, &iplen) != 0 || proto != IPPROTO_TCP || (pkt->data[iphlen+13] & (TH_SYN|TH_ACK)) != (TH_SYN|TH_ACK)) goto done; start_seq = bytes_ntohl(pkt->data+iphlen+4) + icw->start_seq; if((q = scamper_tbit_tcpq_alloc(start_seq)) == NULL) goto done; for(i++; ipktc; i++) { pkt = tbit->pkts[i]; if(pkt->dir != SCAMPER_TBIT_PKT_DIR_RX) continue; if(scamper_tbit_pkt_iph(pkt, &proto, &iphlen, &iplen) != 0) break; if(proto != IPPROTO_TCP) break; seq = bytes_ntohl(pkt->data+iphlen+4); tcphlen = ((pkt->data[iphlen+12] & 0xf0) >> 4) * 4; flags = pkt->data[iphlen+13]; if((datalen = iplen - iphlen - tcphlen) == 0 && (flags & TH_FIN) == 0) continue; if(scamper_tbit_data_inrange(start_seq, seq, datalen) == 0) continue; if(seq == start_seq) { start_seq_c++; if(start_seq_c == 2) { u32 = scamper_tbit_tcpq_tail(q); *icw_out = scamper_tbit_data_seqoff(start_seq, u32); rc = 0; break; } } if(scamper_tbit_tcpq_add(q, seq, flags, datalen, NULL) != 0) break; } done: scamper_tbit_tcpq_free(q, NULL); return rc; } int scamper_tbit_stats(const scamper_tbit_t *tbit, scamper_tbit_stats_t *stats) { const scamper_tbit_pkt_t *pkt, *syn; scamper_tbit_tcpq_t *q = NULL; scamper_tbit_tcpqe_t *qe; uint32_t rcv_nxt, seq; uint16_t iplen, datalen, len; uint8_t proto, iphlen, tcphlen, flags; uint32_t i; int off, seenfin = 0; memset(stats, 0, sizeof(scamper_tbit_stats_t)); if(tbit->pktc < 1) return 0; /* to begin with, look for a SYN/ACK */ syn = tbit->pkts[0]; for(i=1; ipktc; i++) { pkt = tbit->pkts[i]; if(pkt->dir == SCAMPER_TBIT_PKT_DIR_RX) break; } if(i == tbit->pktc) return 0; if(scamper_tbit_pkt_iph(pkt, &proto, &iphlen, &iplen) != 0) goto err; if(proto != IPPROTO_TCP) goto err; if((pkt->data[iphlen+13] & (TH_SYN|TH_ACK)) != (TH_SYN|TH_ACK)) goto err; timeval_diff_tv(&stats->synack_rtt, &syn->tv, &pkt->tv); rcv_nxt = bytes_ntohl(pkt->data+iphlen+4) + 1; if((q = scamper_tbit_tcpq_alloc(rcv_nxt)) == NULL) goto err; for(i++; ipktc; i++) { pkt = tbit->pkts[i]; if(pkt->dir != SCAMPER_TBIT_PKT_DIR_RX) continue; if(scamper_tbit_pkt_iph(pkt, &proto, &iphlen, &iplen) != 0) goto err; if(proto != IPPROTO_TCP) goto err; seq = bytes_ntohl(pkt->data+iphlen+4); tcphlen = ((pkt->data[iphlen+12] & 0xf0) >> 4) * 4; flags = pkt->data[iphlen+13]; if((datalen = iplen - iphlen - tcphlen) == 0 && (flags & TH_FIN) == 0) continue; stats->rx_totalsize += (iplen - iphlen - tcphlen); /* skip over a packet out of range */ if(scamper_tbit_data_inrange(rcv_nxt, seq, datalen) == 0) continue; if(scamper_tbit_tcpq_add(q, seq, flags, datalen, NULL) != 0) goto err; while(scamper_tbit_tcpq_seg(q, &seq, &datalen) == 0) { if(scamper_tbit_data_inrange(rcv_nxt, seq, datalen) == 0) { scamper_tbit_tcpqe_free(scamper_tbit_tcpq_pop(q), NULL); continue; } /* can't process this packet yet */ if((off = scamper_tbit_data_seqoff(rcv_nxt, seq)) > 0) break; qe = scamper_tbit_tcpq_pop(q); flags = qe->flags; scamper_tbit_tcpqe_free(qe, NULL); len = datalen + off; rcv_nxt += len; stats->rx_xfersize += len; if((flags & TH_FIN) != 0) { timeval_diff_tv(&stats->xfertime, &syn->tv, &pkt->tv); seenfin = 1; } } } if(seenfin == 0) goto err; scamper_tbit_tcpq_free(q, NULL); return 0; err: scamper_tbit_tcpq_free(q, NULL); return -1; } char *scamper_tbit_type2str(const scamper_tbit_t *tbit, char *buf, size_t len) { static char *t[] = { NULL, "pmtud", "ecn", "null", "sack-rcvr", "icw", "abc", "blind-data", "blind-rst", "blind-syn", "blind-fin", }; if(tbit->type > sizeof(t) / sizeof(char *) || t[tbit->type] == NULL) { snprintf(buf, len, "%d", tbit->type); return buf; } return t[tbit->type]; } char *scamper_tbit_res2str(const scamper_tbit_t *tbit, char *buf, size_t len) { static char *t[] = { "none", /* 0 */ "tcp-noconn", "tcp-rst", "tcp-error", "sys-error", "aborted", "tcp-noconn-rst", "halted", "tcp-badopt", "tcp-fin", "tcp-zerowin", /* 10 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "pmtud-noack", /* 20 */ "pmtud-nodata", "pmtud-toosmall", "pmtud-nodf", "pmtud-fail", "pmtud-success", "pmtud-cleardf", NULL, NULL, NULL, "ecn-success", /* 30 */ "ecn-incapable", "ecn-badsynack", "ecn-noece", "ecn-noack", "ecn-nodata", NULL, NULL, NULL, NULL, "null-success", /* 40 */ "null-nodata", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "sack-incapable", /* 50 */ "sack-rcvr-success", "sack-rcvr-shifted", "sack-rcvr-timeout", "sack-rcvr-nosack", NULL, NULL, NULL, NULL, NULL, "icw-success", /* 60 */ "icw-tooshort", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "abc-success", /* 70 */ "abc-tooshort", "abc-badicw", NULL, NULL, NULL, NULL, NULL, NULL, NULL, "blind-accepted", /* 80 */ "blind-challenge", "blind-ignored", "blind-rst", "blind-synnew", }; if(tbit->result > sizeof(t) / sizeof(char *) || t[tbit->result] == NULL) { snprintf(buf, len, "%d", tbit->result); return buf; } return t[tbit->result]; } scamper_tbit_pkt_t *scamper_tbit_pkt_alloc(uint8_t dir, uint8_t *data, uint16_t len, struct timeval *tv) { scamper_tbit_pkt_t *pkt; if((pkt = malloc_zero(sizeof(scamper_tbit_pkt_t))) == NULL) goto err; pkt->dir = dir; if(len != 0 && data != NULL) { if((pkt->data = memdup(data, len)) == NULL) goto err; pkt->len = len; } if(tv != NULL) timeval_cpy(&pkt->tv, tv); return pkt; err: free(pkt); return NULL; } void scamper_tbit_pkt_free(scamper_tbit_pkt_t *pkt) { if(pkt == NULL) return; if(pkt->data != NULL) free(pkt->data); free(pkt); return; } int scamper_tbit_pkts_alloc(scamper_tbit_t *tbit, uint32_t count) { size_t size = count * sizeof(scamper_tbit_pkt_t *); if((tbit->pkts = (scamper_tbit_pkt_t **)malloc_zero(size)) == NULL) return -1; return 0; } int scamper_tbit_record_pkt(scamper_tbit_t *tbit, scamper_tbit_pkt_t *pkt) { size_t len = (tbit->pktc + 1) * sizeof(scamper_tbit_pkt_t *); /* Add a new element to the pkts array */ if(realloc_wrap((void**)&tbit->pkts, len) != 0) return -1; tbit->pkts[tbit->pktc++] = pkt; return 0; } scamper_tbit_app_http_t *scamper_tbit_app_http_alloc(uint8_t type, char *host, char *file) { scamper_tbit_app_http_t *http; if((http = malloc_zero(sizeof(scamper_tbit_app_http_t))) == NULL || (host != NULL && (http->host = strdup(host)) == NULL) || (file != NULL && (http->file = strdup(file)) == NULL)) { if(http == NULL) return NULL; if(http->host != NULL) free(http->host); if(http->file != NULL) free(http->file); free(http); return NULL; } http->type = type; return http; } void scamper_tbit_app_http_free(scamper_tbit_app_http_t *http) { if(http == NULL) return; if(http->host != NULL) free(http->host); if(http->file != NULL) free(http->file); free(http); return; } scamper_tbit_app_bgp_t *scamper_tbit_app_bgp_alloc(void) { return malloc_zero(sizeof(scamper_tbit_app_bgp_t)); } void scamper_tbit_app_bgp_free(scamper_tbit_app_bgp_t *bgp) { if(bgp == NULL) return; free(bgp); return; } scamper_tbit_pmtud_t *scamper_tbit_pmtud_alloc(void) { return malloc_zero(sizeof(scamper_tbit_pmtud_t)); } void scamper_tbit_pmtud_free(scamper_tbit_pmtud_t *pmtud) { if(pmtud == NULL) return; if(pmtud->ptbsrc != NULL) scamper_addr_free(pmtud->ptbsrc); free(pmtud); return; } scamper_tbit_null_t *scamper_tbit_null_alloc(void) { return malloc_zero(sizeof(scamper_tbit_null_t)); } void scamper_tbit_null_free(scamper_tbit_null_t *null) { if(null == NULL) return; free(null); return; } scamper_tbit_icw_t *scamper_tbit_icw_alloc(void) { return malloc_zero(sizeof(scamper_tbit_icw_t)); } void scamper_tbit_icw_free(scamper_tbit_icw_t *icw) { free(icw); return; } scamper_tbit_blind_t *scamper_tbit_blind_alloc(void) { return malloc_zero(sizeof(scamper_tbit_blind_t)); } void scamper_tbit_blind_free(scamper_tbit_blind_t *blind) { if(blind == NULL) return; free(blind); return; } /* Free the tbit object. */ void scamper_tbit_free(scamper_tbit_t *tbit) { uint32_t i; if(tbit == NULL) return; if(tbit->src != NULL) scamper_addr_free(tbit->src); if(tbit->dst != NULL) scamper_addr_free(tbit->dst); if(tbit->list != NULL) scamper_list_free(tbit->list); if(tbit->cycle != NULL) scamper_cycle_free(tbit->cycle); if(tbit->fo_cookie != NULL) free(tbit->fo_cookie); /* Free the recorded packets */ if(tbit->pkts != NULL) { for(i=0; ipktc; i++) scamper_tbit_pkt_free(tbit->pkts[i]); free(tbit->pkts); } /* Free protocol specific data */ if(tbit->app_data != NULL) { if(tbit->app_proto == SCAMPER_TBIT_APP_HTTP) scamper_tbit_app_http_free(tbit->app_data); } /* Free test-specific data */ if(tbit->data != NULL) { if(tbit->type == SCAMPER_TBIT_TYPE_PMTUD) scamper_tbit_pmtud_free(tbit->data); else if(tbit->type == SCAMPER_TBIT_TYPE_NULL) scamper_tbit_null_free(tbit->data); else if(tbit->type == SCAMPER_TBIT_TYPE_ICW) scamper_tbit_icw_free(tbit->data); else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_RST || tbit->type == SCAMPER_TBIT_TYPE_BLIND_SYN || tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA || tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN) scamper_tbit_blind_free(tbit->data); } free(tbit); return; } scamper_tbit_t *scamper_tbit_alloc(void) { return (scamper_tbit_t *)malloc_zero(sizeof(scamper_tbit_t)); } scamper-cvs-20171204/scamper/tbit/scamper_tbit.h000644 001751 000000 00000033470 13162602311 021336 0ustar00mjlwheel000000 000000 /* * scamper_tbit.h * * $Id: scamper_tbit.h,v 1.55 2017/09/27 01:54:17 mjl Exp $ * * Copyright (C) 2009-2010 Ben Stasiewicz * Copyright (C) 2010-2011 University of Waikato * Copyright (C) 2012 Matthew Luckie * Copyright (C) 2012,2015 The Regents of the University of California * * This file implements algorithms described in the tbit-1.0 source code, * as well as the papers: * * "On Inferring TCP Behaviour" * by Jitendra Padhye and Sally Floyd * "Measuring the Evolution of Transport Protocols in the Internet" by * by Alberto Medina, Mark Allman, and Sally Floyd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_TBIT_H #define __SCAMPER_TBIT_H /* types of tbit tests */ #define SCAMPER_TBIT_TYPE_PMTUD 1 #define SCAMPER_TBIT_TYPE_ECN 2 #define SCAMPER_TBIT_TYPE_NULL 3 #define SCAMPER_TBIT_TYPE_SACK_RCVR 4 #define SCAMPER_TBIT_TYPE_ICW 5 #define SCAMPER_TBIT_TYPE_ABC 6 #define SCAMPER_TBIT_TYPE_BLIND_DATA 7 #define SCAMPER_TBIT_TYPE_BLIND_RST 8 #define SCAMPER_TBIT_TYPE_BLIND_SYN 9 #define SCAMPER_TBIT_TYPE_BLIND_FIN 10 /* tbit options */ #define SCAMPER_TBIT_OPTION_TCPTS 0x01 /* tcp timestamps */ #define SCAMPER_TBIT_OPTION_SACK 0x02 /* offer use of TCP SACK */ /* application layer protocols supported by the tbit test */ #define SCAMPER_TBIT_APP_HTTP 1 #define SCAMPER_TBIT_APP_SMTP 2 #define SCAMPER_TBIT_APP_DNS 3 #define SCAMPER_TBIT_APP_FTP 4 #define SCAMPER_TBIT_APP_BGP 5 /* for http, either http or https */ #define SCAMPER_TBIT_APP_HTTP_TYPE_HTTP 0 #define SCAMPER_TBIT_APP_HTTP_TYPE_HTTPS 1 /* generic tbit results */ #define SCAMPER_TBIT_RESULT_NONE 0 /* no result */ #define SCAMPER_TBIT_RESULT_TCP_NOCONN 1 /* no connection */ #define SCAMPER_TBIT_RESULT_TCP_RST 2 /* Early reset */ #define SCAMPER_TBIT_RESULT_TCP_ERROR 3 /* TCP Error */ #define SCAMPER_TBIT_RESULT_ERROR 4 /* System error */ #define SCAMPER_TBIT_RESULT_ABORTED 5 /* Test aborted */ #define SCAMPER_TBIT_RESULT_TCP_NOCONN_RST 6 /* no connection: rst rx */ #define SCAMPER_TBIT_RESULT_HALTED 7 /* halted */ #define SCAMPER_TBIT_RESULT_TCP_BADOPT 8 /* bad TCP option */ #define SCAMPER_TBIT_RESULT_TCP_FIN 9 /* early fin */ #define SCAMPER_TBIT_RESULT_TCP_ZEROWIN 10 /* zero window */ /* possible PMTUD test results */ #define SCAMPER_TBIT_RESULT_PMTUD_NOACK 20 /* no ACK of request */ #define SCAMPER_TBIT_RESULT_PMTUD_NODATA 21 /* no data received */ #define SCAMPER_TBIT_RESULT_PMTUD_TOOSMALL 22 /* packets too small */ #define SCAMPER_TBIT_RESULT_PMTUD_NODF 23 /* DF not set (IPv4 only) */ #define SCAMPER_TBIT_RESULT_PMTUD_FAIL 24 /* did not reduce pkt size */ #define SCAMPER_TBIT_RESULT_PMTUD_SUCCESS 25 /* responded correctly */ #define SCAMPER_TBIT_RESULT_PMTUD_CLEARDF 26 /* cleared DF in response */ /* possible ECN test results */ #define SCAMPER_TBIT_RESULT_ECN_SUCCESS 30 /* responded correctly */ #define SCAMPER_TBIT_RESULT_ECN_INCAPABLE 31 /* no ece on syn/ack */ #define SCAMPER_TBIT_RESULT_ECN_BADSYNACK 32 /* bad syn/ack */ #define SCAMPER_TBIT_RESULT_ECN_NOECE 33 /* no ECN echo */ #define SCAMPER_TBIT_RESULT_ECN_NOACK 34 /* no ack of request */ #define SCAMPER_TBIT_RESULT_ECN_NODATA 35 /* no data received */ /* possible NULL test results */ #define SCAMPER_TBIT_RESULT_NULL_SUCCESS 40 /* responded correctly */ #define SCAMPER_TBIT_RESULT_NULL_NODATA 41 /* no data received */ /* possible SACK-RCVR test results */ #define SCAMPER_TBIT_RESULT_SACK_INCAPABLE 50 /* not capable of SACK */ #define SCAMPER_TBIT_RESULT_SACK_RCVR_SUCCESS 51 /* responded correctly */ #define SCAMPER_TBIT_RESULT_SACK_RCVR_SHIFTED 52 /* shifted sack blocks */ #define SCAMPER_TBIT_RESULT_SACK_RCVR_TIMEOUT 53 /* missing ack */ #define SCAMPER_TBIT_RESULT_SACK_RCVR_NOSACK 54 /* missing sack blocks */ /* possible ICW test results */ #define SCAMPER_TBIT_RESULT_ICW_SUCCESS 60 /* estimate of ICW */ #define SCAMPER_TBIT_RESULT_ICW_TOOSHORT 61 /* not enough data to infer */ /* possible ABC test results */ #define SCAMPER_TBIT_RESULT_ABC_SUCCESS 70 /* ABC test successful */ #define SCAMPER_TBIT_RESULT_ABC_TOOSHORT 71 /* not enough data to infer */ #define SCAMPER_TBIT_RESULT_ABC_BADICW 72 /* apparent bad ICW */ /* possible blind test results */ #define SCAMPER_TBIT_RESULT_BLIND_ACCEPTED 80 /* blind packet accepted */ #define SCAMPER_TBIT_RESULT_BLIND_CHALLENGE 81 /* challenge ack */ #define SCAMPER_TBIT_RESULT_BLIND_IGNORED 82 /* no effect */ #define SCAMPER_TBIT_RESULT_BLIND_RST 83 /* reset for blinded packet */ #define SCAMPER_TBIT_RESULT_BLIND_SYNNEW 84 /* new S/A for blinded syn */ /* direction of recorded packet */ #define SCAMPER_TBIT_PKT_DIR_TX 1 #define SCAMPER_TBIT_PKT_DIR_RX 2 /* pmtud options */ #define SCAMPER_TBIT_PMTUD_OPTION_BLACKHOLE 0x1 /* test blackhole behaviour */ /* null options */ #define SCAMPER_TBIT_NULL_OPTION_TCPTS 0x01 /* tcp timestamps */ #define SCAMPER_TBIT_NULL_OPTION_IPTS_SYN 0x02 /* IP TS option on SYN */ #define SCAMPER_TBIT_NULL_OPTION_IPRR_SYN 0x04 /* IP RR option on SYN */ #define SCAMPER_TBIT_NULL_OPTION_IPQS_SYN 0x08 /* IP QS option on SYN */ #define SCAMPER_TBIT_NULL_OPTION_SACK 0x10 /* offer use of TCP SACK */ #define SCAMPER_TBIT_NULL_OPTION_FO 0x20 /* offer use of TCP FO */ #define SCAMPER_TBIT_NULL_OPTION_FO_EXP 0x40 /* offer use of TCP FO-exp */ /* null results */ #define SCAMPER_TBIT_NULL_RESULT_TCPTS 0x01 /* TCP timestamps OK */ #define SCAMPER_TBIT_NULL_RESULT_SACK 0x02 /* use of TCP SACK OK */ #define SCAMPER_TBIT_NULL_RESULT_FO 0x04 /* use of TCP FO OK */ typedef struct scamper_tbit_pkt { struct timeval tv; uint8_t dir; uint16_t len; uint8_t *data; } scamper_tbit_pkt_t; typedef struct scamper_tbit_app_http { uint8_t type; char *host; char *file; } scamper_tbit_app_http_t; typedef struct scamper_tbit_app_bgp { uint32_t asn; } scamper_tbit_app_bgp_t; typedef struct scamper_tbit_pmtud { uint16_t mtu; uint8_t ptb_retx; uint8_t options; scamper_addr_t *ptbsrc; } scamper_tbit_pmtud_t; typedef struct scamper_tbit_null { uint16_t options; uint16_t results; } scamper_tbit_null_t; typedef struct scamper_tbit_icw { uint32_t start_seq; } scamper_tbit_icw_t; typedef struct scamper_tbit_blind { int32_t off; uint8_t retx; } scamper_tbit_blind_t; /* * scamper_tbit * * parameters and results of a measurement conducted with tbit. */ typedef struct scamper_tbit { scamper_list_t *list; scamper_cycle_t *cycle; uint32_t userid; scamper_addr_t *src; scamper_addr_t *dst; uint16_t sport; uint16_t dport; struct timeval start; /* outcome of test */ uint16_t result; /* type of tbit test and data specific to that test */ uint8_t type; void *data; /* details of application protocol used */ uint8_t app_proto; void *app_data; /* client and server mss values advertised */ uint32_t options; uint16_t client_mss; uint16_t server_mss; uint8_t *fo_cookie; uint8_t fo_cookielen; uint8_t wscale; uint8_t ttl; /* various generic retransmit values */ uint8_t syn_retx; uint8_t dat_retx; /* packets collected as part of this test */ scamper_tbit_pkt_t **pkts; uint32_t pktc; } scamper_tbit_t; scamper_tbit_t *scamper_tbit_alloc(void); void scamper_tbit_free(scamper_tbit_t *tbit); char *scamper_tbit_res2str(const scamper_tbit_t *tbit, char *buf, size_t len); char *scamper_tbit_type2str(const scamper_tbit_t *tbit, char *buf, size_t len); scamper_tbit_pkt_t *scamper_tbit_pkt_alloc(uint8_t dir, uint8_t *data, uint16_t len, struct timeval *tv); void scamper_tbit_pkt_free(scamper_tbit_pkt_t *pkt); int scamper_tbit_pkt_tcpdatabytes(const scamper_tbit_pkt_t *pkt, uint16_t *bc); int scamper_tbit_pkt_tcpack(const scamper_tbit_pkt_t *pkt, uint32_t *ack); scamper_tbit_pmtud_t *scamper_tbit_pmtud_alloc(void); void scamper_tbit_pmtud_free(scamper_tbit_pmtud_t *pmtud); scamper_tbit_icw_t *scamper_tbit_icw_alloc(void); int scamper_tbit_icw_size(const scamper_tbit_t *tbit, uint32_t *size); void scamper_tbit_icw_free(scamper_tbit_icw_t *icw); scamper_tbit_null_t *scamper_tbit_null_alloc(void); void scamper_tbit_null_free(scamper_tbit_null_t *null); scamper_tbit_blind_t *scamper_tbit_blind_alloc(void); void scamper_tbit_blind_free(scamper_tbit_blind_t *blind); scamper_tbit_app_http_t *scamper_tbit_app_http_alloc(uint8_t type, char *host, char *file); int scamper_tbit_app_http_host(scamper_tbit_app_http_t *http, const char *h); int scamper_tbit_app_http_file(scamper_tbit_app_http_t *http, const char *f); void scamper_tbit_app_http_free(scamper_tbit_app_http_t *http); scamper_tbit_app_bgp_t *scamper_tbit_app_bgp_alloc(void); void scamper_tbit_app_bgp_free(scamper_tbit_app_bgp_t *bgp); int scamper_tbit_pkts_alloc(scamper_tbit_t *tbit, uint32_t count); int scamper_tbit_record_pkt(scamper_tbit_t *tbit, scamper_tbit_pkt_t *pkt); int scamper_tbit_fo_getcookie(scamper_tbit_t *tbit, uint8_t *c, uint8_t *l); int scamper_tbit_fo_setcookie(scamper_tbit_t *tbit, uint8_t *c, uint8_t l); /* * scamper_tbit_tcpq functions. * * these functions are used to maintain in-order processing of TCP packets * when the packets are received out of order. for these routines to work * correctly, all TCP packets that are received in range must be processed * through the queue so that the queue knows what sequence number is * expected. * * scamper_tbit_tcpq_alloc: allocate a new tcp data queue with an initial * sequence number seeding the queue. * * scamper_tbit_tcpq_free: free the tcp data queue. the ff parameter is an * optional free() function that can be called on all queue entry param * fields. * * scamper_tbit_tcpq_add: add a new segment to the queue. the seq, flags, * and length must be supplied. the param field is an optional field that * will be returned with the queue entry when the segment is returned in * order. * * scamper_tbit_tcpq_seg: return the sequence number and payload length of * the next packet in line to be returned. the segment remains in the queue. * returns -1 if there is no segment in the queue, zero otherwise. * * scamper_tbit_tcpq_pop: return the next queue entry that is next in line * to be returned. the segment is now the responsibility of the caller. * * scamper_tbit_tcpq_sack: return a set of sack blocks that specify the * state of the tcpq. the caller must pass a pointer to an array of * (c*2) uint32_t. the routine returns the number of sack blocks * computed given the constraint of c and the state of the queue. * * scamper_tbit_tcpq_tail: returns the sequence number at the tail of the * tcp, even if there are gaps in the tcpq. * * scamper_tbit_tcpqe_free: free the queue entry passed in. ff is an * optional free() function that will be called on the param if not null. * */ typedef struct scamper_tbit_tcpq scamper_tbit_tcpq_t; typedef struct scamper_tbit_tcpqe { uint32_t seq; uint16_t len; uint8_t flags; uint8_t *data; } scamper_tbit_tcpqe_t; scamper_tbit_tcpq_t *scamper_tbit_tcpq_alloc(uint32_t isn); void scamper_tbit_tcpq_free(scamper_tbit_tcpq_t *q, void (*ff)(void *)); void scamper_tbit_tcpq_flush(scamper_tbit_tcpq_t *q, void (*ff)(void *)); int scamper_tbit_tcpq_add(scamper_tbit_tcpq_t *q, uint32_t seq, uint8_t flags, uint16_t len, uint8_t *data); int scamper_tbit_tcpq_seg(scamper_tbit_tcpq_t *q,uint32_t *seq,uint16_t *len); scamper_tbit_tcpqe_t *scamper_tbit_tcpq_pop(scamper_tbit_tcpq_t *q); int scamper_tbit_tcpq_sack(scamper_tbit_tcpq_t *q, uint32_t *blocks, int c); uint32_t scamper_tbit_tcpq_tail(const scamper_tbit_tcpq_t *q); void scamper_tbit_tcpqe_free(scamper_tbit_tcpqe_t *qe, void (*ff)(void *)); /* * convenience functions. * * scamper_tbit_data_inrange: determine if a particular packet and length * are in range or not. * * scamper_tbit_data_seqoff: determine the difference in sequence number * space between a and b handling wrapping. this function assumes that * the caller has used scamper_tbit_data_inrange first to determine * the packet is in the current window. * */ int scamper_tbit_data_inrange(uint32_t rcv_nxt, uint32_t seq, uint16_t len); int scamper_tbit_data_seqoff(uint32_t rcv_nxt, uint32_t seq); /* * scamper_tbit_stats * * give some idea about what took place during the tbit measurement. */ typedef struct scamper_tbit_stats { struct timeval synack_rtt; uint32_t rx_xfersize; uint32_t rx_totalsize; struct timeval xfertime; } scamper_tbit_stats_t; int scamper_tbit_stats(const scamper_tbit_t *tbit,scamper_tbit_stats_t *stats); #endif /* __SCAMPER_TBIT_H */ scamper-cvs-20171204/scamper/tbit/scamper_tbit_do.c000644 001751 000000 00000343273 13210743023 022020 0ustar00mjlwheel000000 000000 /* * scamper_do_tbit.c * * $Id: scamper_tbit_do.c,v 1.182 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2009-2010 Ben Stasiewicz * Copyright (C) 2009-2010 Stephen Eichler * Copyright (C) 2012 Matthew Luckie * Copyright (C) 2010-2011 University of Waikato * Copyright (C) 2012-2015 The Regents of the University of California * Copyright (C) 2017 University of Waikato * * Authors: Matthew Luckie, Ben Stasiewicz, Stephen Eichler, Tiange Wu, * Robert Beverly * * Some of the algorithms implemented in this file are described in the * tbit-1.0 source code, as well as the papers: * * "On Inferring TCP Behaviour" * by Jitendra Padhye and Sally Floyd * "Measuring the Evolution of Transport Protocols in the Internet" by * by Alberto Medina, Mark Allman, and Sally Floyd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_tbit_do.c,v 1.182 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_task.h" #include "scamper_dl.h" #include "scamper_fds.h" #include "scamper_dlhdr.h" #include "scamper_firewall.h" #include "scamper_rtsock.h" #include "scamper_if.h" #include "scamper_probe.h" #include "scamper_getsrc.h" #include "scamper_tcp4.h" #include "scamper_tcp6.h" #include "scamper_queue.h" #include "scamper_file.h" #include "scamper_options.h" #include "scamper_debug.h" #include "utils.h" #include "mjl_list.h" #include "scamper_tbit.h" #include "scamper_tbit_do.h" /* Default test parameters */ #define TBIT_RETX_DEFAULT 3 #define TBIT_TIMEOUT_DEFAULT 10000 #define TBIT_TIMEOUT_LONG 70000 #define TBIT_TIMEOUT_SACK 2000 #define TBIT_TIMEOUT_BLINDDATA 2000 typedef struct tbit_options { uint8_t app; uint8_t type; uint8_t syn_retx; uint8_t dat_retx; uint8_t attempts; uint8_t fo_cookielen; uint8_t fo_cookie[16]; uint16_t options; uint16_t mss; uint16_t mtu; uint16_t sport; uint16_t dport; char *url; char *ptbsrc; char *src; int32_t offset; uint16_t asn; } tbit_options_t; typedef struct tbit_segment { uint8_t *data; uint16_t len; } tbit_segment_t; typedef struct tbit_frag { uint16_t off; uint8_t *data; uint16_t datalen; } tbit_frag_t; typedef struct tbit_frags { struct timeval tv; uint32_t id; tbit_frag_t **frags; int fragc; uint8_t gotlast; } tbit_frags_t; typedef struct tbit_probe { uint8_t type; int wait; union { struct tp_tcp { uint16_t len; uint8_t flags; uint8_t sackb; uint32_t seq; uint32_t ack; uint32_t sack[8]; } tcp; } un; } tbit_probe_t; #define tp_len un.tcp.len #define tp_flags un.tcp.flags #define tp_sackb un.tcp.sackb #define tp_seq un.tcp.seq #define tp_ack un.tcp.ack #define tp_sack un.tcp.sack typedef struct tbit_state { #ifndef _WIN32 scamper_fd_t *rtsock; #endif scamper_fd_t *dl; scamper_dlhdr_t *dlhdr; scamper_route_t *route; scamper_firewall_entry_t *fw; uint8_t mode; uint8_t attempt; uint16_t flags; struct timeval timeout; uint16_t ipid; slist_t *tx; slist_t *segments; scamper_tbit_tcpq_t *rxq; uint32_t sa_seq; uint32_t snd_nxt; uint32_t rcv_nxt; tbit_frags_t **frags; int fragc; uint32_t ts_recent; uint32_t ts_lastack; uint32_t qs_nonce; uint8_t qs_ttl; #if defined(HAVE_OPENSSL) int ssl_mode; SSL *ssl; BIO *rbio; BIO *wbio; #endif union { struct tbit_pmtud { uint8_t *ptb_data; uint16_t ptb_datalen; uint16_t ptb_c; } pmtud; struct tbit_sackr { uint8_t rx[7]; /* pkts received */ uint8_t x; uint8_t flags; uint8_t timeout; } sackr; struct tbit_ecn { uint8_t flags; } ecn; struct tbit_icw { uint32_t seq; uint32_t tail; uint8_t count; uint8_t flags; } icw; struct tbit_blind { uint8_t flags; uint8_t c; /* the number of blind packets sent */ uint8_t sent; /* sent blind packet for this data */ uint8_t ignored; /* how many times sender ignored */ uint8_t step; /* what step in blind data */ uint16_t part1; uint16_t part2; uint16_t part3; uint32_t ack; } blind; } un; } tbit_state_t; #define pmtud_ptb_data un.pmtud.ptb_data #define pmtud_ptb_datalen un.pmtud.ptb_datalen #define pmtud_ptb_c un.pmtud.ptb_c #define sackr_rx un.sackr.rx #define sackr_x un.sackr.x #define sackr_flags un.sackr.flags #define sackr_timeout un.sackr.timeout #define ecn_flags un.ecn.flags #define icw_seq un.icw.seq #define icw_count un.icw.count #define icw_tail un.icw.tail #define icw_flags un.icw.flags #define blind_flags un.blind.flags #define blind_c un.blind.c #define blind_sent un.blind.sent #define blind_ignored un.blind.ignored #define blind_part1 un.blind.part1 #define blind_part2 un.blind.part2 #define blind_part3 un.blind.part3 #define blind_step un.blind.step #define blind_ack un.blind.ack /* The callback functions registered with the tbit task */ static scamper_task_funcs_t tbit_funcs; /* Address cache used to avoid reallocating the same address multiple times */ extern scamper_addrcache_t *addrcache; #define TBIT_STATE_FLAG_FIN_SEEN 0x0001 #define TBIT_STATE_FLAG_FIN_ACKED 0x0002 #define TBIT_STATE_FLAG_SEEN_DATA 0x0004 #define TBIT_STATE_FLAG_SEEN_220 0x0008 #define TBIT_STATE_FLAG_NODF 0x0010 #define TBIT_STATE_FLAG_RST_SEEN 0x0020 #define TBIT_STATE_FLAG_NOMOREDATA 0x0040 #define TBIT_STATE_FLAG_NORESET 0x1000 #define TBIT_STATE_FLAG_TCPTS 0x2000 #define TBIT_STATE_FLAG_SACK 0x4000 /* flags specific to the ecn test */ #define TBIT_STATE_ECN_FLAG_ECT 0x01 #define TBIT_STATE_ECN_FLAG_CE_SET 0x02 #define TBIT_STATE_ECN_FLAG_CE_SENT 0x04 #define TBIT_STATE_ECN_FLAG_CWR_SET 0x08 #define TBIT_STATE_ECN_FLAG_CWR_SENT 0x10 #define TBIT_STATE_ECN_FLAG_ECE_SEEN 0x20 /* flags specific to the sackr test */ #define TBIT_STATE_SACKR_FLAG_INCAPABLE 0x01 #define TBIT_STATE_SACKR_FLAG_SHIFTED 0x02 #define TBIT_STATE_SACKR_FLAG_BADOPT 0x04 /* flags specific to the icw test */ #define TBIT_STATE_ICW_FLAG_SEQ 0x01 /* flags specific to the blind tests */ #define TBIT_STATE_BLIND_FLAG_CHALLENGE 0x01 #define TBIT_STATE_BLIND_FLAG_ACCEPTED 0x02 #define TBIT_STATE_BLIND_FLAG_SILENCE 0x04 #define TBIT_STATE_BLIND_FLAG_RST 0x08 #define TBIT_STATE_BLIND_FLAG_FIN 0x10 #define TBIT_STATE_BLIND_FLAG_SPLIT 0x20 #if defined(HAVE_OPENSSL) /* ssl modes */ #define TBIT_STATE_SSL_MODE_HANDSHAKE 0x00 #define TBIT_STATE_SSL_MODE_ESTABLISHED 0x01 #define TBIT_STATE_SSL_MODE_SHUTDOWN 0x02 #endif /* Options that tbit supports */ #define TBIT_OPT_DPORT 1 #define TBIT_OPT_MSS 2 #define TBIT_OPT_MTU 3 #define TBIT_OPT_OPTION 4 #define TBIT_OPT_APP 5 #define TBIT_OPT_PTBSRC 6 #define TBIT_OPT_SPORT 7 #define TBIT_OPT_TYPE 8 #define TBIT_OPT_URL 9 #define TBIT_OPT_USERID 10 #define TBIT_OPT_SRCADDR 11 #define TBIT_OPT_FO 12 #define TBIT_OPT_WSCALE 17 #define TBIT_OPT_ATTEMPTS 18 #define TBIT_OPT_OFFSET 19 #define TBIT_OPT_ASN 20 #define TBIT_OPT_TTL 21 /* bits for the tbit_option.options field */ #define TBIT_OPT_OPTION_BLACKHOLE 0x0001 #define TBIT_OPT_OPTION_TCPTS 0x0002 #define TBIT_OPT_OPTION_IPTS_SYN 0x0004 #define TBIT_OPT_OPTION_IPRR_SYN 0x0008 #define TBIT_OPT_OPTION_IPQS_SYN 0x0010 #define TBIT_OPT_OPTION_SACK 0x0020 #define TBIT_OPT_OPTION_FO 0x0040 #define TBIT_OPT_OPTION_FO_EXP 0x0080 /* we only support one IP option on a SYN packet */ #define TBIT_OPT_OPTION_IPOPT_SYN_MASK \ (TBIT_OPT_OPTION_IPTS_SYN | TBIT_OPT_OPTION_IPRR_SYN | \ TBIT_OPT_OPTION_IPQS_SYN) /* types of tbit probe packets */ #define TBIT_PROBE_TYPE_TCP 1 #define TBIT_PROBE_TYPE_PTB 2 static const scamper_option_in_t opts[] = { {'b', NULL, TBIT_OPT_ASN, SCAMPER_OPTION_TYPE_NUM}, {'d', NULL, TBIT_OPT_DPORT, SCAMPER_OPTION_TYPE_NUM}, {'f', NULL, TBIT_OPT_FO, SCAMPER_OPTION_TYPE_STR}, {'m', NULL, TBIT_OPT_MSS, SCAMPER_OPTION_TYPE_NUM}, {'M', NULL, TBIT_OPT_MTU, SCAMPER_OPTION_TYPE_NUM}, {'o', NULL, TBIT_OPT_OFFSET, SCAMPER_OPTION_TYPE_NUM}, {'O', NULL, TBIT_OPT_OPTION, SCAMPER_OPTION_TYPE_STR}, {'p', NULL, TBIT_OPT_APP, SCAMPER_OPTION_TYPE_STR}, {'P', NULL, TBIT_OPT_PTBSRC, SCAMPER_OPTION_TYPE_STR}, {'q', NULL, TBIT_OPT_ATTEMPTS, SCAMPER_OPTION_TYPE_NUM}, {'s', NULL, TBIT_OPT_SPORT, SCAMPER_OPTION_TYPE_NUM}, {'S', NULL, TBIT_OPT_SRCADDR, SCAMPER_OPTION_TYPE_STR}, {'t', NULL, TBIT_OPT_TYPE, SCAMPER_OPTION_TYPE_STR}, {'T', NULL, TBIT_OPT_TTL, SCAMPER_OPTION_TYPE_NUM}, {'u', NULL, TBIT_OPT_URL, SCAMPER_OPTION_TYPE_STR}, {'U', NULL, TBIT_OPT_USERID, SCAMPER_OPTION_TYPE_NUM}, {'w', NULL, TBIT_OPT_WSCALE, SCAMPER_OPTION_TYPE_NUM}, }; static const int opts_cnt = SCAMPER_OPTION_COUNT(opts); static const uint8_t MODE_RTSOCK = 1; /* waiting for rtsock */ static const uint8_t MODE_DLHDR = 2; /* waiting for dlhdr to use */ static const uint8_t MODE_FIREWALL = 3; /* insert firewall rule */ static const uint8_t MODE_DONE = 4; /* test finished */ static const uint8_t MODE_SYN = 5; /* waiting for syn/ack */ static const uint8_t MODE_FIN = 6; /* send fin, wait for ack */ static const uint8_t MODE_DATA = 7; /* connection established */ static const uint8_t MODE_PMTUD = 8; /* sending PTBs */ static const uint8_t MODE_BLACKHOLE = 9; /* don't send PTBs */ static const uint8_t MODE_ZEROWIN = 10; /* wait for window update */ static const uint8_t MODE_MOREDATA = 11; /* wait for new data beyond tail */ static const uint8_t MODE_BLIND = 12; /* in process of blind packets */ #if defined(HAVE_OPENSSL) static SSL_CTX *ssl_ctx = NULL; #endif /* Note : URL is only valid for HTTP tests. */ const char *scamper_do_tbit_usage(void) { return "tbit [-t type] [-p app] [-d dport] [-s sport] [-b asn] [-f cookie]\n" " [-m mss] [-M mtu] [-o offset] [-O option]\n" " [-P ptbsrc] [-q attempts] [-S srcaddr] [-T ttl] [-u url]"; } static scamper_tbit_t *tbit_getdata(const scamper_task_t *task) { return scamper_task_getdata(task); } static tbit_state_t *tbit_getstate(const scamper_task_t *task) { return scamper_task_getstate(task); } static void tbit_queue(scamper_task_t *task) { tbit_state_t *state = tbit_getstate(task); if(slist_count(state->tx) > 0) scamper_task_queue_probe(task); else if(state->mode == MODE_DONE) scamper_task_queue_done(task, 0); else scamper_task_queue_wait_tv(task, &state->timeout); return; } /* * tbit_result: * * record the result, and then begin to gracefully end the connection. */ static void tbit_result(scamper_task_t *task, uint8_t result) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); int d = 0; #ifdef HAVE_SCAMPER_DEBUG char addr[64], buf[16]; #endif switch(result) { case SCAMPER_TBIT_RESULT_NONE: case SCAMPER_TBIT_RESULT_TCP_NOCONN: case SCAMPER_TBIT_RESULT_TCP_NOCONN_RST: case SCAMPER_TBIT_RESULT_TCP_ERROR: case SCAMPER_TBIT_RESULT_TCP_RST: case SCAMPER_TBIT_RESULT_TCP_BADOPT: case SCAMPER_TBIT_RESULT_TCP_FIN: case SCAMPER_TBIT_RESULT_TCP_ZEROWIN: case SCAMPER_TBIT_RESULT_ERROR: case SCAMPER_TBIT_RESULT_ABORTED: case SCAMPER_TBIT_RESULT_HALTED: case SCAMPER_TBIT_RESULT_PMTUD_NOACK: case SCAMPER_TBIT_RESULT_PMTUD_FAIL: case SCAMPER_TBIT_RESULT_SACK_INCAPABLE: case SCAMPER_TBIT_RESULT_SACK_RCVR_SUCCESS: case SCAMPER_TBIT_RESULT_SACK_RCVR_SHIFTED: case SCAMPER_TBIT_RESULT_SACK_RCVR_TIMEOUT: case SCAMPER_TBIT_RESULT_SACK_RCVR_NOSACK: case SCAMPER_TBIT_RESULT_BLIND_RST: case SCAMPER_TBIT_RESULT_BLIND_ACCEPTED: d = 1; break; } if(state->flags & TBIT_STATE_FLAG_RST_SEEN) d = 1; if(tbit->result == SCAMPER_TBIT_RESULT_NONE) { tbit->result = result; #ifdef HAVE_SCAMPER_DEBUG scamper_debug(__func__, "%s %s", scamper_addr_tostr(tbit->dst, addr, sizeof(addr)), scamper_tbit_res2str(tbit, buf, sizeof(buf))); #endif } if(d == 0) { /* only set MODE_FIN if we are out of the SYN mode */ if(state->mode != MODE_SYN) { state->mode = MODE_FIN; scamper_task_queue_probe(task); } } else { state->mode = MODE_DONE; scamper_task_queue_done(task, 0); } return; } static void tbit_classify(scamper_task_t *task) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_pmtud_t *pmtud; scamper_tbit_blind_t *blind; int ipv6 = SCAMPER_ADDR_TYPE_IS_IPV6(tbit->dst) ? 1 : 0; int bh = 0; if(tbit->result != SCAMPER_TBIT_RESULT_NONE) { if(state->flags & TBIT_STATE_FLAG_RST_SEEN) { state->mode = MODE_DONE; scamper_task_queue_done(task, 0); } return; } if(tbit->type == SCAMPER_TBIT_TYPE_PMTUD) { pmtud = tbit->data; if(pmtud->options & SCAMPER_TBIT_PMTUD_OPTION_BLACKHOLE) bh = 1; /* * if we receive a reset, then the measurement is finished. * if we have sent two PTBs, we class it as a failure. */ if(state->flags & TBIT_STATE_FLAG_RST_SEEN) { if(state->pmtud_ptb_c >= 2) tbit_result(task, SCAMPER_TBIT_RESULT_PMTUD_FAIL); else tbit_result(task, SCAMPER_TBIT_RESULT_TCP_RST); } else if(state->mode == MODE_ZEROWIN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_ZEROWIN); /* if we haven't seen any data */ else if((state->flags & TBIT_STATE_FLAG_SEEN_DATA) == 0) tbit_result(task, SCAMPER_TBIT_RESULT_PMTUD_NODATA); /* if we were trying to solicit a fragmentation header but couldn't */ else if(state->pmtud_ptb_c == 0 && ipv6 && bh == 0 && pmtud->mtu < 1280) tbit_result(task, SCAMPER_TBIT_RESULT_NONE); /* if we sent any PTBs but didn't see an appropriate reduction, fail */ else if(state->pmtud_ptb_c > 0) tbit_result(task, SCAMPER_TBIT_RESULT_PMTUD_FAIL); /* if the IP DF was not set on sufficiently large packets */ else if(ipv6 == 0 && state->flags & TBIT_STATE_FLAG_NODF) tbit_result(task, SCAMPER_TBIT_RESULT_PMTUD_NODF); /* faking a blackhole */ else if(state->mode == MODE_BLACKHOLE) tbit_result(task, SCAMPER_TBIT_RESULT_PMTUD_FAIL); /* otherwise, we just didn't see a sufficiently large packet */ else tbit_result(task, SCAMPER_TBIT_RESULT_PMTUD_TOOSMALL); } else if(tbit->type == SCAMPER_TBIT_TYPE_ECN) { if(state->ecn_flags & TBIT_STATE_ECN_FLAG_ECE_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_ECN_SUCCESS); else if(state->flags & TBIT_STATE_FLAG_RST_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_RST); else if(state->mode == MODE_ZEROWIN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_ZEROWIN); else if(state->ecn_flags & TBIT_STATE_ECN_FLAG_CE_SENT) tbit_result(task, SCAMPER_TBIT_RESULT_ECN_NOECE); else if((state->flags & TBIT_STATE_FLAG_SEEN_DATA) == 0) tbit_result(task, SCAMPER_TBIT_RESULT_ECN_NODATA); return; } else if(tbit->type == SCAMPER_TBIT_TYPE_NULL) { if(state->flags & TBIT_STATE_FLAG_RST_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_RST); else if(state->mode == MODE_ZEROWIN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_ZEROWIN); else if((state->flags & TBIT_STATE_FLAG_SEEN_DATA) == 0) tbit_result(task, SCAMPER_TBIT_RESULT_NULL_NODATA); else tbit_result(task, SCAMPER_TBIT_RESULT_NULL_SUCCESS); } else if(tbit->type == SCAMPER_TBIT_TYPE_SACK_RCVR) { if(state->sackr_flags & TBIT_STATE_SACKR_FLAG_INCAPABLE) tbit_result(task, SCAMPER_TBIT_RESULT_SACK_INCAPABLE); else if(state->sackr_flags & TBIT_STATE_SACKR_FLAG_SHIFTED) tbit_result(task, SCAMPER_TBIT_RESULT_SACK_RCVR_SHIFTED); else if(state->flags & TBIT_STATE_FLAG_RST_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_RST); else if(state->mode == MODE_ZEROWIN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_ZEROWIN); else if(state->flags & TBIT_STATE_FLAG_FIN_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_FIN); else if(state->sackr_rx[0] > 3) tbit_result(task, SCAMPER_TBIT_RESULT_SACK_RCVR_NOSACK); else if(state->sackr_flags & TBIT_STATE_SACKR_FLAG_BADOPT) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_BADOPT); else if(state->sackr_timeout > 2) tbit_result(task, SCAMPER_TBIT_RESULT_SACK_RCVR_TIMEOUT); else tbit_result(task, SCAMPER_TBIT_RESULT_SACK_RCVR_SUCCESS); } else if(tbit->type == SCAMPER_TBIT_TYPE_ICW) { if(state->flags & TBIT_STATE_FLAG_RST_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_RST); else if(state->flags & TBIT_STATE_FLAG_FIN_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_FIN); else tbit_result(task, SCAMPER_TBIT_RESULT_NONE); } else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA || tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN) { if(state->blind_flags & TBIT_STATE_BLIND_FLAG_ACCEPTED) tbit_result(task, SCAMPER_TBIT_RESULT_BLIND_ACCEPTED); else if(state->blind_flags & TBIT_STATE_BLIND_FLAG_CHALLENGE) tbit_result(task, SCAMPER_TBIT_RESULT_BLIND_CHALLENGE); else if(state->blind_flags & TBIT_STATE_BLIND_FLAG_SILENCE) tbit_result(task, SCAMPER_TBIT_RESULT_BLIND_IGNORED); else if(state->blind_flags & TBIT_STATE_BLIND_FLAG_RST) tbit_result(task, SCAMPER_TBIT_RESULT_BLIND_RST); else if(state->flags & TBIT_STATE_FLAG_RST_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_RST); else if(state->flags & TBIT_STATE_FLAG_FIN_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_FIN); else tbit_result(task, SCAMPER_TBIT_RESULT_NONE); } else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_RST) { blind = tbit->data; if(state->blind_flags & TBIT_STATE_BLIND_FLAG_CHALLENGE) tbit_result(task, SCAMPER_TBIT_RESULT_BLIND_CHALLENGE); else if(state->blind_c >= blind->retx) tbit_result(task, SCAMPER_TBIT_RESULT_BLIND_IGNORED); else if(state->blind_flags & TBIT_STATE_BLIND_FLAG_FIN || state->flags & TBIT_STATE_FLAG_FIN_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_FIN); else if(state->flags & TBIT_STATE_FLAG_RST_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_RST); else if(state->blind_c == 1 && state->blind_ignored == 0) tbit_result(task, SCAMPER_TBIT_RESULT_BLIND_ACCEPTED); else tbit_result(task, SCAMPER_TBIT_RESULT_NONE); } else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_SYN) { blind = tbit->data; if(state->blind_flags & TBIT_STATE_BLIND_FLAG_RST) tbit_result(task, SCAMPER_TBIT_RESULT_BLIND_RST); else if(state->blind_flags & TBIT_STATE_BLIND_FLAG_CHALLENGE) tbit_result(task, SCAMPER_TBIT_RESULT_BLIND_CHALLENGE); else if(state->blind_c >= blind->retx) tbit_result(task, SCAMPER_TBIT_RESULT_BLIND_IGNORED); else if(state->blind_flags & TBIT_STATE_BLIND_FLAG_FIN || state->flags & TBIT_STATE_FLAG_FIN_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_FIN); else if(state->flags & TBIT_STATE_FLAG_RST_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_RST); else if(state->flags & TBIT_STATE_FLAG_FIN_SEEN) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_FIN); else tbit_result(task, SCAMPER_TBIT_RESULT_NONE); } else { scamper_debug(__func__, "unhandled type %d", tbit->type); tbit_result(task, SCAMPER_TBIT_RESULT_NONE); } return; } /* * tbit_tcpclosed * * function to see if both ends have exchanged fins. */ static int tbit_tcpclosed(tbit_state_t *state) { if((state->flags & TBIT_STATE_FLAG_FIN_SEEN) != 0 && (state->flags & TBIT_STATE_FLAG_FIN_ACKED) != 0) return 1; return 0; } static void tbit_handleerror(scamper_task_t *task, int error) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); tbit->result = SCAMPER_TBIT_RESULT_ERROR; if(state != NULL) state->mode = MODE_DONE; scamper_task_queue_done(task, 0); return; } static void tbit_frags_free(tbit_frags_t *frags) { int i; if(frags == NULL) return; if(frags->frags != NULL) { for(i=0; ifragc; i++) { free(frags->frags[i]->data); free(frags->frags[i]); } free(frags->frags); } free(frags); return; } static int tbit_frags_cmp(const tbit_frags_t *a, const tbit_frags_t *b) { if(a->id < b->id) return -1; if(a->id > b->id) return 1; return 0; } static int tbit_frag_cmp(const tbit_frag_t *a, const tbit_frag_t *b) { if(a->off < b->off) return -1; if(a->off > b->off) return 1; return 0; } static int tbit_reassemble(scamper_task_t *task, scamper_dl_rec_t **out, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_pmtud_t *pmtud; scamper_dl_rec_t *newp = NULL; tbit_frags_t fmfs, *frags; tbit_frag_t fmf, *frag, *next; uint8_t *data = NULL; size_t off; uint16_t mtu; int i, rc, pos, ipv4 = 0, ipv6 = 0; /* empty fragment? */ if(dl->dl_ip_datalen == 0 || dl->dl_ip_proto != IPPROTO_TCP) { scamper_debug(__func__, "ignoring fragment %d %d", dl->dl_ip_datalen, dl->dl_ip_proto); return 0; } if(dl->dl_af == AF_INET) ipv4 = 1; else ipv6 = 1; /* if we are doing path mtu discovery, the fragment might not be accepted */ if(tbit->type == SCAMPER_TBIT_TYPE_PMTUD) { pmtud = tbit->data; if(ipv4 || pmtud->mtu > 1280) mtu = pmtud->mtu; else mtu = 1280; /* * if the packet is larger than the psuedo mtu, we can't reassemble * it since in theory we didn't receive it. * if the fragment offset is zero, pass it back to trigger a PTB. */ if((ipv6 || SCAMPER_DL_IS_IP_DF(dl)) && dl->dl_ip_size > mtu) { if(dl->dl_ip_off == 0) *out = dl; return 0; } } /* see if we have other fragments for this packet. if not, create new rec */ if(ipv4) fmfs.id = dl->dl_ip_id; else fmfs.id = dl->dl_ip6_id; pos = array_findpos((void **)state->frags, state->fragc, &fmfs, (array_cmp_t)tbit_frags_cmp); if(pos >= 0) { frags = state->frags[pos]; } else { if((frags = malloc_zero(sizeof(tbit_frags_t))) == NULL) { printerror(__func__, "could not malloc frags"); goto err; } frags->id = fmfs.id; rc=array_insert((void ***)&state->frags, &state->fragc, frags, (array_cmp_t)tbit_frags_cmp); if(rc != 0) { printerror(__func__, "could not insert frags"); goto err; } pos = array_findpos((void **)state->frags, state->fragc, frags, (array_cmp_t)tbit_frags_cmp); assert(pos != -1); } /* add the fragment to the collection */ fmf.off = dl->dl_ip_off; frag = array_find((void **)frags->frags, frags->fragc, &fmf, (array_cmp_t)tbit_frag_cmp); if(frag == NULL) { if((frag = malloc_zero(sizeof(tbit_frag_t))) == NULL) { printerror(__func__, "could not malloc frag"); goto err; } frag->off = fmf.off; if((frag->data = memdup(dl->dl_ip_data, dl->dl_ip_datalen)) == NULL) { printerror(__func__, "could not dup %d", dl->dl_ip_datalen); goto err; } frag->datalen = dl->dl_ip_datalen; if(array_insert((void ***)&frags->frags, &frags->fragc, frag, (array_cmp_t)tbit_frag_cmp) != 0) { printerror(__func__, "could not add frag"); goto err; } if(SCAMPER_DL_IS_IP_MF(dl) == 0) frags->gotlast = 1; } /* can't reassemble a packet without the last fragment */ if(frags->gotlast == 0 || frags->fragc < 2) { return 0; } for(i=0; ifragc-1; i++) { frag = frags->frags[i]; next = frags->frags[i+1]; if(frag->off + frag->datalen != next->off) { return 0; } } frag = frags->frags[frags->fragc-1]; if((data = malloc_zero(frag->off + frag->datalen)) == NULL) { printerror(__func__, "could not malloc data"); goto err; } for(i=0, off=0; ifragc; i++) { frag = frags->frags[i]; memcpy(data+off, frag->data, frag->datalen); off += frag->datalen; } array_remove((void **)state->frags, &state->fragc, pos); tbit_frags_free(frags); if((newp = malloc_zero(sizeof(scamper_dl_rec_t))) == NULL) { printerror(__func__, "could not malloc newp"); goto err; } timeval_cpy(&newp->dl_tv, &dl->dl_tv); newp->dl_type = SCAMPER_DL_TYPE_RAW; newp->dl_net_type = SCAMPER_DL_REC_NET_TYPE_IP; newp->dl_ifindex = dl->dl_ifindex; newp->dl_af = dl->dl_af; newp->dl_ip_hl = dl->dl_ip_hl; newp->dl_ip_proto = dl->dl_ip_proto; newp->dl_ip_size = dl->dl_ip_hl + off; newp->dl_ip_id = dl->dl_ip_id; newp->dl_ip6_id = dl->dl_ip6_id; newp->dl_ip_tos = dl->dl_ip_tos; newp->dl_ip_ttl = dl->dl_ip_ttl; newp->dl_ip_src = dl->dl_ip_src; newp->dl_ip_dst = dl->dl_ip_dst; newp->dl_ip_flow = dl->dl_ip_flow; newp->dl_ip_data = data; newp->dl_ip_datalen = off; newp->dl_ip_flags = SCAMPER_DL_IP_FLAG_REASS; if(sizeof(struct tcphdr) > newp->dl_ip_datalen) { free(newp); free(data); return 0; } newp->dl_tcp_sport = bytes_ntohs(data+0); newp->dl_tcp_dport = bytes_ntohs(data+2); newp->dl_tcp_seq = bytes_ntohl(data+4); newp->dl_tcp_ack = bytes_ntohl(data+8); newp->dl_tcp_hl = (data[12] >> 4) * 4; newp->dl_tcp_flags = data[13]; newp->dl_tcp_win = bytes_ntohs(data+14); newp->dl_tcp_datalen = newp->dl_ip_datalen - newp->dl_tcp_hl; if(newp->dl_tcp_datalen > 0) newp->dl_tcp_data = data + newp->dl_tcp_hl; *out = newp; return 0; err: if(newp != NULL) free(newp); if(data != NULL) free(data); return -1; } static void tp_free(tbit_probe_t *tp) { if(tp == NULL) return; free(tp); return; } static tbit_probe_t *tp_alloc(tbit_state_t *state, uint8_t type) { tbit_probe_t *tp; if((tp = malloc_zero(sizeof(tbit_probe_t))) == NULL) { printerror(__func__, "could not malloc tp"); return NULL; } if(slist_tail_push(state->tx, tp) == NULL) { printerror(__func__, "could not queue tp"); free(tp); return NULL; } tp->type = type; return tp; } static tbit_probe_t *tp_tcp(tbit_state_t *state) { tbit_probe_t *tp; if((tp = tp_alloc(state, TBIT_PROBE_TYPE_TCP)) == NULL) return NULL; tp->tp_flags = TH_ACK; tp->tp_seq = state->snd_nxt; tp->tp_ack = state->rcv_nxt; return tp; } static tbit_probe_t *tp_ptb(tbit_state_t *state) { return tp_alloc(state, TBIT_PROBE_TYPE_PTB); } static void tp_flush(tbit_state_t *state, tbit_probe_t *tp_stop) { tbit_probe_t *tp; for(;;) { if((tp = slist_head_item(state->tx)) == NULL || tp == tp_stop) break; slist_head_pop(state->tx); tp_free(tp); } return; } static void tbit_segment_free(tbit_segment_t *seg) { if(seg == NULL) return; if(seg->data != NULL) free(seg->data); free(seg); return; } static int tbit_segment(tbit_state_t *state, const uint8_t *data, uint16_t len) { tbit_segment_t *seg = NULL; if((seg = malloc_zero(sizeof(tbit_segment_t))) == NULL) { printerror(__func__, "could not malloc seg"); goto err; } if((seg->data = memdup(data, len)) == NULL) { printerror(__func__, "could not malloc seg->data"); goto err; } seg->len = len; if(slist_tail_push(state->segments, seg) == NULL) { printerror(__func__, "could not add seg"); goto err; } return 0; err: tbit_segment_free(seg); return -1; } static int tbit_data_inrange(tbit_state_t *state, uint32_t seq, uint32_t len) { if(scamper_tbit_data_inrange(state->rcv_nxt, seq, len) != 0) return 1; scamper_debug(__func__, "out of sequence"); return 0; } static int tbit_rxq(tbit_state_t *state, const scamper_dl_rec_t *dl) { void *data = NULL; assert(dl->dl_ip_proto == IPPROTO_TCP); assert(dl->dl_tcp_datalen > 0 || (dl->dl_tcp_flags & TH_FIN) != 0); if(state->rxq == NULL && (state->rxq = scamper_tbit_tcpq_alloc(state->rcv_nxt)) == NULL) { printerror(__func__, "could not alloc tcpq"); goto err; } if(dl->dl_tcp_datalen > 0 && (data = memdup(dl->dl_tcp_data, dl->dl_tcp_datalen)) == NULL) { printerror(__func__, "could not dup %d bytes", dl->dl_tcp_datalen); goto err; } if(scamper_tbit_tcpq_add(state->rxq, dl->dl_tcp_seq, dl->dl_tcp_flags, dl->dl_tcp_datalen, data) != 0) { printerror(__func__, "could not add %u/%2x/%u", dl->dl_tcp_seq, dl->dl_tcp_flags, dl->dl_tcp_datalen); goto err; } return 0; err: if(data != NULL) free(data); return -1; } #if defined(HAVE_OPENSSL) static int tbit_ssl_wbio_write(tbit_state_t *state) { uint8_t buf[1024]; int pending, rc, size, off = 0; if((pending = BIO_pending(state->wbio)) < 0) return -1; while(off < pending) { if(pending - off > sizeof(buf)) size = sizeof(buf); else size = pending - off; if((rc = BIO_read(state->wbio, buf, size)) <= 0) { if(BIO_should_retry(state->wbio) == 0) scamper_debug(__func__, "BIO_read should not retry"); else scamper_debug(__func__, "BIO_read returned %d", rc); return -1; } off += rc; if(tbit_segment(state, buf, rc) != 0) return -1; } return pending; } static ssize_t tbit_ssl_write(tbit_state_t *state, uint8_t *buf, size_t len) { SSL_write(state->ssl, buf, len); return tbit_ssl_wbio_write(state); } static ssize_t tbit_ssl_init(tbit_state_t *state, char *name) { int rc; /* * the order is important because once the BIOs are associated with * the ssl structure, SSL_free will clean them up. */ if((state->wbio = BIO_new(BIO_s_mem())) == NULL || (state->rbio = BIO_new(BIO_s_mem())) == NULL || (state->ssl = SSL_new(ssl_ctx)) == NULL) return -1; SSL_set_bio(state->ssl, state->rbio, state->wbio); #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME if(name != NULL) SSL_set_tlsext_host_name(state->ssl, name); #endif SSL_set_connect_state(state->ssl); rc = SSL_do_handshake(state->ssl); assert(rc <= 0); if((rc = SSL_get_error(state->ssl, rc)) == SSL_ERROR_WANT_READ) return tbit_ssl_wbio_write(state); scamper_debug(__func__, "SSL_do_handshake error %d", rc); return -1; } #endif static int tbit_app_http_req(scamper_task_t *task) { static const char *http_ua = "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.2) " "Gecko/20090806 Firefox/3.5.2"; scamper_tbit_t *tbit = tbit_getdata(task); scamper_tbit_app_http_t *http = tbit->app_data; tbit_state_t *state = tbit_getstate(task); char buf[512]; size_t off = 0; string_concat(buf, sizeof(buf), &off, "GET %s HTTP/1.0\r\n", http->file); if(http->host != NULL) string_concat(buf, sizeof(buf), &off, "Host: %s\r\n", http->host); string_concat(buf, sizeof(buf), &off, "Connection: Keep-Alive\r\n" "Accept: */*\r\n" "User-Agent: %s\r\n\r\n", http_ua); #if defined(HAVE_OPENSSL) if(state->ssl != NULL) return tbit_ssl_write(state, (uint8_t *)buf, off); #endif if(tbit_segment(state, (uint8_t *)buf, off) != 0) return -1; return off; } static int tbit_app_http_rx(scamper_task_t *task, uint8_t *data, uint16_t dlen) { tbit_state_t *state = tbit_getstate(task); int rc; #if defined(HAVE_OPENSSL) scamper_tbit_t *tbit = tbit_getdata(task); scamper_tbit_app_http_t *http = tbit->app_data; char buf[4096]; #endif if(state->flags & TBIT_STATE_FLAG_NOMOREDATA) return 0; if(state->mode == MODE_SYN || state->mode == MODE_RTSOCK) { #if defined(HAVE_OPENSSL) if(http->type == SCAMPER_TBIT_APP_HTTP_TYPE_HTTPS) return tbit_ssl_init(state, http->host); #endif if((rc = tbit_app_http_req(task)) < 0) return -1; state->flags |= TBIT_STATE_FLAG_NOMOREDATA; return rc; } #if defined(HAVE_OPENSSL) if(dlen > 0 && state->ssl != NULL) { BIO_write(state->rbio, data, dlen); if(state->ssl_mode == TBIT_STATE_SSL_MODE_HANDSHAKE) { if(SSL_is_init_finished(state->ssl) != 0 || (rc = SSL_do_handshake(state->ssl)) > 0) { state->ssl_mode = TBIT_STATE_SSL_MODE_ESTABLISHED; state->flags |= TBIT_STATE_FLAG_NOMOREDATA; return tbit_app_http_req(task); } return tbit_ssl_wbio_write(state); } else if(state->ssl_mode == TBIT_STATE_SSL_MODE_ESTABLISHED) { while((rc = SSL_read(state->ssl, buf, sizeof(buf))) > 0); return tbit_ssl_wbio_write(state); } } #endif return 0; } static int tbit_app_bgp_req(scamper_task_t *task) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_app_bgp_t *bgp = tbit->app_data; uint8_t buf[29]; /* BGP 20B header + 9B OPEN w/o options */ size_t off = 0; /* bgp header */ for(off=0; off<16; off++) buf[off] = 0xff; bytes_htons(buf+off, 29); off += 2; /* length */ buf[off++] = 1; /* type = BGP_OPEN */ buf[off++] = 4; /* version = 4 */ /* bgp open */ bytes_htons(buf+off, (uint16_t)bgp->asn); off += 2; bytes_htons(buf+off, 180); off += 2; /* hold time */ bytes_htonl(buf+off, 12345); off += 4; /* id */ buf[off++] = 0; /* options length */ if(tbit_segment(state, (uint8_t *)buf, off) != 0) return -1; return off; } static int tbit_app_bgp_rx(scamper_task_t *task, uint8_t *data, uint16_t dlen) { tbit_state_t *state = tbit_getstate(task); int rc; if(state->flags & TBIT_STATE_FLAG_NOMOREDATA) return 0; if(state->mode == MODE_SYN || state->mode == MODE_RTSOCK) { if((rc = tbit_app_bgp_req(task)) < 0) return -1; state->flags |= TBIT_STATE_FLAG_NOMOREDATA; return rc; } return 0; } static int tbit_app_rx(scamper_task_t *task, uint8_t *data, uint16_t len) { static int (* const func[])(scamper_task_t *, uint8_t *, uint16_t) = { NULL, tbit_app_http_rx, NULL, NULL, NULL, tbit_app_bgp_rx, }; scamper_tbit_t *tbit = tbit_getdata(task); assert(tbit->app_proto == SCAMPER_TBIT_APP_HTTP || tbit->app_proto == SCAMPER_TBIT_APP_BGP); return func[tbit->app_proto](task, data, len); } static void timeout_generic_error(scamper_task_t *task) { tbit_result(task, SCAMPER_TBIT_RESULT_ERROR); return; } /* * dl_syn: * * handles the response to a SYN - It should be a SYN/ACK. */ static void dl_syn(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_null_t *null; tbit_segment_t *seg = slist_head_item(state->segments); tbit_probe_t *tp = NULL; uint32_t ab; uint8_t mode = MODE_DATA; int rc; if(SCAMPER_DL_IS_TCP_SYNACK(dl) == 0 || dl->dl_tcp_ack <= state->snd_nxt) { if(dl->dl_tcp_flags & TH_RST) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_NOCONN_RST); else tbit_result(task, SCAMPER_TBIT_RESULT_TCP_NOCONN); return; } /* increment our sequence number, and remember the seq we expect from them */ state->snd_nxt++; state->sa_seq = dl->dl_tcp_seq; state->rcv_nxt = dl->dl_tcp_seq + 1; /* * if the sender appears to be acking data, it might be because we used * TCP fast open */ if((ab = dl->dl_tcp_ack - state->snd_nxt) > 0) { if(seg == NULL || ab > seg->len) { tbit_result(task, SCAMPER_TBIT_RESULT_TCP_NOCONN); return; } if(ab == seg->len) { slist_head_pop(state->segments); tbit_segment_free(seg); } else { memmove(seg->data, seg->data+ab, seg->len-ab); seg->len -= ab; } state->snd_nxt += ab; } if((tbit->options & SCAMPER_TBIT_OPTION_TCPTS) && (dl->dl_tcp_opts & SCAMPER_DL_TCP_OPT_TS) != 0) { state->flags |= TBIT_STATE_FLAG_TCPTS; state->ts_recent = dl->dl_tcp_tsval; } /* check if we got the expected response to an ECN-syn */ if(tbit->type == SCAMPER_TBIT_TYPE_ECN) { if((dl->dl_tcp_flags & (TH_ECE|TH_CWR)) != TH_ECE) { if((dl->dl_tcp_flags & (TH_ECE|TH_CWR)) == 0) tbit_result(task, SCAMPER_TBIT_RESULT_ECN_INCAPABLE); else tbit_result(task, SCAMPER_TBIT_RESULT_ECN_BADSYNACK); } else { state->ecn_flags |= TBIT_STATE_ECN_FLAG_ECT; state->ecn_flags |= TBIT_STATE_ECN_FLAG_CE_SET; } } else if(tbit->type == SCAMPER_TBIT_TYPE_SACK_RCVR) { if((dl->dl_tcp_opts & SCAMPER_DL_TCP_OPT_SACKP) == 0) state->sackr_flags |= TBIT_STATE_SACKR_FLAG_INCAPABLE; } else if(tbit->type == SCAMPER_TBIT_TYPE_NULL) { null = tbit->data; if((tbit->options & SCAMPER_TBIT_OPTION_TCPTS) != 0 && (dl->dl_tcp_opts & SCAMPER_DL_TCP_OPT_TS) != 0) { null->results |= SCAMPER_TBIT_NULL_RESULT_TCPTS; } if((tbit->options & SCAMPER_TBIT_OPTION_SACK) != 0 && (dl->dl_tcp_opts & SCAMPER_DL_TCP_OPT_SACKP) != 0) { null->results |= SCAMPER_TBIT_NULL_RESULT_SACK; state->flags |= TBIT_STATE_FLAG_SACK; } if((((null->options & SCAMPER_TBIT_NULL_OPTION_FO) != 0 && (dl->dl_tcp_opts & SCAMPER_DL_TCP_OPT_FO) != 0) || ((null->options & SCAMPER_TBIT_NULL_OPTION_FO_EXP) != 0 && (dl->dl_tcp_opts & SCAMPER_DL_TCP_OPT_FO_EXP) != 0)) && dl->dl_tcp_fo_cookielen > 0 && tbit->fo_cookielen == 0) { null->results |= SCAMPER_TBIT_NULL_RESULT_FO; } } tbit->server_mss = dl->dl_tcp_mss; if(tbit->fo_cookie != NULL) { rc = 0; if(dl->dl_tcp_datalen > 0) { if((rc = tbit_app_rx(task, dl->dl_tcp_data, dl->dl_tcp_datalen)) < 0) goto err; state->rcv_nxt += dl->dl_tcp_datalen; } } else { if((rc = tbit_app_rx(task, NULL, 0)) < 0) goto err; } /* send a pure ack to their data */ if((tp = tp_tcp(state)) == NULL) goto err; /* send our request if there is one */ if(rc > 0) { /* * handle receivers who advertise a zero window in a syn/ack and * expect the sender to wait until it has issued a window update */ if(dl->dl_tcp_win == 0) { tp->wait = TBIT_TIMEOUT_DEFAULT; state->mode = MODE_ZEROWIN; tbit_queue(task); return; } if((tp = tp_tcp(state)) == NULL) goto err; tp->tp_len = rc; if(tbit->type == SCAMPER_TBIT_TYPE_SACK_RCVR) { /* send one byte of the data in the SACK test */ tp->tp_len = 1; tp->wait = TBIT_TIMEOUT_SACK; } else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA || tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN) { state->blind_part1 = rc / 3; if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA) { state->blind_part2 = state->blind_part1; state->blind_part3 = rc - state->blind_part1 - state->blind_part2; } else { state->blind_part2 = rc - state->blind_part1; state->blind_ack = state->snd_nxt + rc; } tp->tp_len = state->blind_part1; tp->wait = TBIT_TIMEOUT_BLINDDATA; } else { tp->wait = TBIT_TIMEOUT_DEFAULT; } if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_RST || tbit->type == SCAMPER_TBIT_TYPE_BLIND_SYN || tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA || tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN) mode = MODE_BLIND; state->attempt = 0; } state->mode = mode; tbit_queue(task); return; err: tbit_handleerror(task, errno); return; } static void timeout_syn(scamper_task_t *task) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); if(state->attempt >= tbit->syn_retx) tbit_result(task, SCAMPER_TBIT_RESULT_TCP_NOCONN); return; } static void dl_fin(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_tcpqe_t *qe; tbit_probe_t *tp; uint32_t seq; uint16_t datalen; uint8_t flags; int x; timeval_add_ms(&state->timeout, &dl->dl_tv, TBIT_TIMEOUT_LONG); /* see if the remote host has acked our fin */ if(dl->dl_tcp_ack == state->snd_nxt + 1 && (state->flags & TBIT_STATE_FLAG_FIN_ACKED) == 0) { state->flags |= TBIT_STATE_FLAG_FIN_ACKED; state->snd_nxt++; } /* check if the remote host has received our ack to their fin */ if((state->flags & TBIT_STATE_FLAG_FIN_SEEN) && dl->dl_tcp_seq == state->rcv_nxt) { if(tbit_tcpclosed(state)) { if(tbit->result == SCAMPER_TBIT_RESULT_NONE) tbit_classify(task); state->mode = MODE_DONE; tbit_queue(task); } return; } /* if there is nothing to ack, then don't generate an ack */ if(dl->dl_tcp_datalen == 0 && (dl->dl_tcp_flags & TH_FIN) == 0) return; if((tp = tp_tcp(state)) == NULL) goto err; /* is the data in range? */ if(tbit_data_inrange(state, dl->dl_tcp_seq, dl->dl_tcp_datalen) == 0) goto ack; if(tbit_rxq(state, dl) != 0) goto err; while(scamper_tbit_tcpq_seg(state->rxq, &seq, &datalen) == 0) { if(scamper_tbit_data_inrange(state->rcv_nxt, seq, datalen) == 0) { scamper_tbit_tcpqe_free(scamper_tbit_tcpq_pop(state->rxq), free); continue; } /* send an ack for the next packet we want */ if((x = scamper_tbit_data_seqoff(state->rcv_nxt, seq)) > 0) break; qe = scamper_tbit_tcpq_pop(state->rxq); flags = qe->flags; scamper_tbit_tcpqe_free(qe, free); state->rcv_nxt += (datalen - abs(x)); if((flags & TH_FIN) != 0) { state->flags |= TBIT_STATE_FLAG_FIN_SEEN; state->rcv_nxt++; } if((state->flags & TBIT_STATE_FLAG_FIN_ACKED) == 0) tp->tp_flags |= TH_FIN; if(tbit_tcpclosed(state)) { if(tbit->result == SCAMPER_TBIT_RESULT_NONE) tbit_classify(task); state->mode = MODE_DONE; break; } } ack: tp->tp_ack = state->rcv_nxt; if(state->mode != MODE_DONE && (state->flags & TBIT_STATE_FLAG_SACK) != 0) { x = 4; if((state->flags & TBIT_STATE_FLAG_TCPTS) != 0) x--; tp->tp_sackb = scamper_tbit_tcpq_sack(state->rxq, tp->tp_sack, x); } tbit_queue(task); return; err: tbit_handleerror(task, errno); return; } static void timeout_fin(scamper_task_t *task) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); if(tbit->result == SCAMPER_TBIT_RESULT_NONE) tbit_classify(task); state->mode = MODE_DONE; tbit_queue(task); return; } /* * dl_data_pmtud * * this function is tasked with reading data from the end host until * it sends a packet that we can send a PTB for. when that happens, * we send the PTB and then go into a mode where this function will never * be called again. */ static int dl_data_pmtud(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_pmtud_t *pmtud = tbit->data; tbit_probe_t *tp; int rc, bh = 0, ipv4 = 0, ipv6 = 0, skip = 0, frag = 0; uint16_t size; /* if it is out of sequence, then send an ack for what we want */ if(dl->dl_tcp_seq != state->rcv_nxt) { if(tp_tcp(state) == NULL) goto err; return 0; } if(dl->dl_af == AF_INET) ipv4 = 1; else ipv6 = 1; if(SCAMPER_DL_IS_IP_FRAG(dl) != 0) frag = 1; if(pmtud->options & SCAMPER_TBIT_PMTUD_OPTION_BLACKHOLE) bh = 1; size = dl->dl_ip_size; /* * skip over tcp packets without data, packets that were allowed to be * reassembled, data packets without the DF bit set, data packets below * the MTU, and ipv6 packets with the fragmentation header set */ if(dl->dl_tcp_datalen == 0 || SCAMPER_DL_IS_IP_REASS(dl) != 0) skip = 1; else if(ipv4 && SCAMPER_DL_IS_IP_DF(dl) == 0) skip = 1; else if((ipv4 || pmtud->mtu >= 1280) && size <= pmtud->mtu) skip = 1; else if(ipv6 && bh == 0 && pmtud->mtu < 1280 && frag != 0 && size <= 1280) skip = 1; else if(ipv6 && bh == 1 && size <= pmtud->mtu) skip = 1; if(dl->dl_tcp_datalen > 0) state->flags |= TBIT_STATE_FLAG_SEEN_DATA; if(skip) { if(dl->dl_tcp_datalen > 0) { state->rcv_nxt += dl->dl_tcp_datalen; if(ipv4 && SCAMPER_DL_IS_IP_DF(dl) == 0 && size > pmtud->mtu && SCAMPER_DL_IS_IP_REASS(dl) == 0) state->flags |= TBIT_STATE_FLAG_NODF; } if(dl->dl_tcp_datalen > 0 || (dl->dl_tcp_flags & TH_FIN) != 0) { if((rc = tbit_app_rx(task, dl->dl_tcp_data, dl->dl_tcp_datalen)) < 0) goto err; if((tp = tp_tcp(state)) == NULL) goto err; if(rc > 0) { tp->tp_len = rc; tp->wait = TBIT_TIMEOUT_DEFAULT; state->attempt = 0; } if((dl->dl_tcp_flags & TH_FIN) != 0) { tp->tp_flags |= TH_FIN; tp->tp_ack++; state->rcv_nxt++; state->mode = MODE_FIN; state->flags |= TBIT_STATE_FLAG_FIN_SEEN; } } return 0; } /* * we've received a large frame, but we're not sending PTB. see how * the remote host copes. */ if(bh != 0) { state->mode = MODE_BLACKHOLE; return 0; } state->mode = MODE_PMTUD; if(dl->dl_af == AF_INET) state->pmtud_ptb_datalen = dl->dl_ip_hl + 8; else if(size >= 1280-40-8) state->pmtud_ptb_datalen = 1280 - 40 - 8; else state->pmtud_ptb_datalen = size; state->pmtud_ptb_data = memdup(dl->dl_net_raw, state->pmtud_ptb_datalen); if(state->pmtud_ptb_data == NULL) { printerror(__func__, "could not dup quote"); goto err; } if(tp_ptb(state) == NULL) goto err; state->attempt = 0; return 0; err: tbit_handleerror(task, errno); return -1; } static void timeout_data_pmtud(scamper_task_t *task) { tbit_result(task, SCAMPER_TBIT_RESULT_PMTUD_NODATA); return; } /* * dl_data_ecn * * read packets until we get an ECN-echo for our CE packet. */ static int dl_data_ecn(scamper_task_t *task, scamper_dl_rec_t *dl) { tbit_state_t *state = tbit_getstate(task); tbit_probe_t *tp = NULL; int rc, fin = 0; /* * look for the ECN echo bit in the TCP header. * if it is set, then we should set CWR until the host stops sending ECE. */ if(dl->dl_tcp_flags & TH_ECE) { if((state->ecn_flags & TBIT_STATE_ECN_FLAG_ECE_SEEN) == 0) { state->ecn_flags |= TBIT_STATE_ECN_FLAG_ECE_SEEN; if((state->ecn_flags & TBIT_STATE_ECN_FLAG_CWR_SET) == 0) state->ecn_flags |= TBIT_STATE_ECN_FLAG_CWR_SET; } } else { if(state->ecn_flags & TBIT_STATE_ECN_FLAG_CWR_SET) { state->ecn_flags &= ~TBIT_STATE_ECN_FLAG_CWR_SET; state->ecn_flags |= TBIT_STATE_ECN_FLAG_CWR_SENT; } } /* if it is out of sequence, then send an ack for what we want */ if(dl->dl_tcp_seq != state->rcv_nxt) { if(tp_tcp(state) == NULL) goto err; return 0; } /* * if we were sending CE then we can stop now, because they have * received the packet we sent with CE marked. */ if(state->ecn_flags & TBIT_STATE_ECN_FLAG_CE_SET) { state->ecn_flags &= ~TBIT_STATE_ECN_FLAG_CE_SET; state->ecn_flags |= TBIT_STATE_ECN_FLAG_CE_SENT; } if((dl->dl_tcp_flags & TH_FIN) != 0) fin = 1; if(dl->dl_tcp_datalen > 0) { state->flags |= TBIT_STATE_FLAG_SEEN_DATA; state->rcv_nxt += dl->dl_tcp_datalen; } if(dl->dl_tcp_datalen > 0 || fin != 0) { if((rc = tbit_app_rx(task, dl->dl_tcp_data, dl->dl_tcp_datalen)) < 0) goto err; if((tp = tp_tcp(state)) == NULL) goto err; if(rc > 0) { tp->tp_len = rc; tp->wait = TBIT_TIMEOUT_DEFAULT; state->attempt = 0; } if(fin != 0 || (state->ecn_flags & TBIT_STATE_ECN_FLAG_ECT) == 0) { tp->tp_flags |= TH_FIN; state->mode = MODE_FIN; if(fin != 0) { state->flags |= TBIT_STATE_FLAG_FIN_SEEN; state->rcv_nxt++; tp->tp_ack++; } } } return 0; err: tbit_handleerror(task, errno); return -1; } static void timeout_data_generic(scamper_task_t *task) { tbit_state_t *state = tbit_getstate(task); tbit_classify(task); if(state->mode != MODE_FIN) { state->mode = MODE_FIN; scamper_task_queue_probe(task); } return; } /* * dl_data_null * * read packets until FIN. */ static int dl_data_null(scamper_task_t *task, scamper_dl_rec_t *dl) { tbit_state_t *state = tbit_getstate(task); tbit_probe_t *tp = NULL; scamper_tbit_tcpqe_t *qe = NULL; uint32_t seq; uint16_t datalen; int off, rc, fin, tx_fin = 0; /* if we've got no more data to send, transmit a fin */ if((state->flags & TBIT_STATE_FLAG_NOMOREDATA) != 0 && slist_count(state->segments) == 0) tx_fin = 1; /* skip over non-data packets unless we are ready to send a fin */ if(dl->dl_tcp_datalen == 0 && (dl->dl_tcp_flags & TH_FIN) == 0) { if(tx_fin != 0 && (state->flags & TBIT_STATE_FLAG_SEEN_DATA) != 0) { if((tp = tp_tcp(state)) == NULL) goto err; tp->tp_flags |= TH_FIN; state->mode = MODE_FIN; } return 0; } if(tbit_data_inrange(state, dl->dl_tcp_seq, dl->dl_tcp_datalen) == 0) return 0; if(tbit_rxq(state, dl) != 0) goto err; while(scamper_tbit_tcpq_seg(state->rxq, &seq, &datalen) == 0) { if(scamper_tbit_data_inrange(state->rcv_nxt, seq, datalen) == 0) { scamper_tbit_tcpqe_free(scamper_tbit_tcpq_pop(state->rxq), free); continue; } if(datalen > 0) state->flags |= TBIT_STATE_FLAG_SEEN_DATA; /* send an ack for the next packet we want */ if((off = scamper_tbit_data_seqoff(state->rcv_nxt, seq)) > 0) { if((tp = tp_tcp(state)) == NULL) goto err; if(tx_fin != 0) { tp->tp_flags |= TH_FIN; state->mode = MODE_FIN; } return 0; } /* * remove the segment from the list; we will process it. * check if the fin bit is set for later processing. * determine if we have already received a portion of this segment. * move rcv_nxt along by the amount of new data. * pass the new data up to the application. * free the segment once it is no longer required. */ qe = scamper_tbit_tcpq_pop(state->rxq); off = abs(off); fin = (qe->flags & TH_FIN) != 0 ? 1 : 0; if(qe->len > 0) state->rcv_nxt += (qe->len - off); if((rc = tbit_app_rx(task, qe->data+off, qe->len-off)) < 0) goto err; scamper_tbit_tcpqe_free(qe, free); qe = NULL; if((tp = tp_tcp(state)) == NULL) goto err; if(rc > 0) { tp->tp_len = rc; tp->wait = TBIT_TIMEOUT_DEFAULT; state->attempt = 0; } if(tx_fin != 0 || fin != 0) { tp->tp_flags |= TH_FIN; state->mode = MODE_FIN; if(fin != 0) { state->flags |= TBIT_STATE_FLAG_FIN_SEEN; state->rcv_nxt++; tp->tp_ack++; break; } } } return 0; err: if(qe != NULL) scamper_tbit_tcpqe_free(qe, free); tbit_handleerror(task, errno); return -1; } static int sack_rcvr_next(scamper_task_t *task) { tbit_state_t *state = tbit_getstate(task); tbit_probe_t *tp; /* after six sacks, we classify */ if(state->sackr_x == 6) { tbit_classify(task); return 0; } /* send the next out of sequence packet */ if((tp = tp_tcp(state)) == NULL) return -1; tp->tp_len = 1; tp->tp_seq += 1 + (state->sackr_x * 2); tp->wait = TBIT_TIMEOUT_SACK; state->attempt = 0; state->sackr_x++; tbit_queue(task); return 0; } /* * dl_data_sack_rcvr * * send sequence of six packets that are out of sequence to solict SACK * blocks, each time an ack is received. */ static int dl_data_sack_rcvr(scamper_task_t *task, scamper_dl_rec_t *dl) { tbit_state_t *state = tbit_getstate(task); uint32_t edge; int i, x = -1; if(dl->dl_tcp_seq != state->rcv_nxt) return 0; /* if we get an early fin, abort */ if((dl->dl_tcp_flags & TH_FIN) != 0) { state->flags |= TBIT_STATE_FLAG_FIN_SEEN; tbit_classify(task); return 0; } if(dl->dl_tcp_sack_edgec == -1) { state->sackr_flags |= TBIT_STATE_SACKR_FLAG_BADOPT; return 0; } else if(dl->dl_tcp_sack_edgec == 0) { x = 0; } else if(dl->dl_tcp_sack_edgec > 0) { assert(dl->dl_tcp_sack_edgec > 1); edge = dl->dl_tcp_sack_edges[1] - state->snd_nxt; if((edge & 0x1) == 0 && edge != 0 && edge / 2 <= state->sackr_x) x = edge / 2; /* check if any of the edges in the sack block are out of range */ for(i=0; idl_tcp_sack_edgec; i++) { edge = dl->dl_tcp_sack_edges[0] - state->snd_nxt; if(edge == 0 || edge / 2 > state->sackr_x) { state->sackr_flags |= TBIT_STATE_SACKR_FLAG_SHIFTED; break; } } } /* * if we were able to identify the likely probe this is a reply for, * then send the next one only if we haven't already. */ if(x != -1) { state->sackr_rx[x]++; if(state->sackr_rx[x] > 1 && x == 0 && (state->sackr_flags & TBIT_STATE_SACKR_FLAG_INCAPABLE) == 0) return 0; } if(sack_rcvr_next(task) != 0) goto err; return 0; err: tbit_handleerror(task, errno); return -1; } static void timeout_data_sack_rcvr(scamper_task_t *task) { tbit_state_t *state = tbit_getstate(task); state->sackr_timeout++; if(sack_rcvr_next(task) != 0) tbit_handleerror(task, errno); return; } /* * dl_data_icw * * this function reads from the stream until the first segment is seen * again. at that point, the function sends a FIN to accelerate a * classification. a successful classification is made in dl_icw. * */ static int dl_data_icw(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_tcpqe_t *qe; scamper_tbit_icw_t *icw; tbit_probe_t *tp = NULL; uint32_t seq; uint16_t datalen; int rc, off, fin = 0; assert(state->icw_count <= 2); if((dl->dl_tcp_flags & TH_FIN) != 0) { state->flags |= TBIT_STATE_FLAG_FIN_SEEN; fin = 1; } if(tbit_data_inrange(state, dl->dl_tcp_seq, dl->dl_tcp_datalen) == 0) goto done; /* if the packet contains data or is a fin, fail if we cannot queue it */ if((dl->dl_tcp_datalen != 0 || fin) && tbit_rxq(state, dl) != 0) { printerror(__func__, "could not queue packet"); goto err; } if(state->flags & TBIT_STATE_FLAG_NOMOREDATA) { if((state->icw_flags & TBIT_STATE_ICW_FLAG_SEQ) == 0) { icw = tbit->data; icw->start_seq = scamper_tbit_data_seqoff(state->sa_seq, state->rcv_nxt); state->icw_flags |= TBIT_STATE_ICW_FLAG_SEQ; state->icw_seq = state->rcv_nxt; } /* * count the number of times the first segment is seen (with data) * so that we know when the second retransmission is made. */ if(dl->dl_tcp_seq == state->icw_seq && dl->dl_tcp_datalen > 0) state->icw_count++; if(state->icw_count < 2) { /* we're done for now unless the packet is a fin */ if(fin == 0) goto done; /* * if the packet is a fin, we do not have a retransmission * that would allow an ICW to be inferred. */ tbit_result(task, SCAMPER_TBIT_RESULT_ICW_TOOSHORT); state->mode = MODE_FIN; } else { /* * got a second retransmission. make a note of the sequence * number we need to see to be sure we are seeing new data after * the initial flight. shift to MODE_MOREDATA after we have * processed the packets in the rxq. */ state->icw_tail = scamper_tbit_tcpq_tail(state->rxq); state->mode = MODE_MOREDATA; } } if(state->rxq == NULL) goto done; while(scamper_tbit_tcpq_seg(state->rxq, &seq, &datalen) == 0) { /* skip if not in range */ if(scamper_tbit_data_inrange(state->rcv_nxt, seq, datalen) == 0) { scamper_tbit_tcpqe_free(scamper_tbit_tcpq_pop(state->rxq), free); continue; } /* if we have a gap in the rxq, stop processing stream for now */ if((off = scamper_tbit_data_seqoff(state->rcv_nxt, seq)) > 0) { if((tp = tp_tcp(state)) == NULL) goto err; if(state->mode == MODE_MOREDATA) tp->tp_flags |= TH_FIN; break; } /* process the data and free it */ qe = scamper_tbit_tcpq_pop(state->rxq); off = abs(off); fin = (qe->flags & TH_FIN) != 0 ? 1 : 0; if(qe->len > 0) state->rcv_nxt += (qe->len - off); if((rc = tbit_app_rx(task, qe->data+off, qe->len-off)) < 0) goto err; scamper_tbit_tcpqe_free(qe, free); qe = NULL; if((tp = tp_tcp(state)) == NULL) goto err; tp->tp_len = rc; if(state->mode == MODE_MOREDATA) tp->tp_flags |= TH_FIN; if(fin != 0) { tp->tp_ack++; state->rcv_nxt++; break; } } done: tbit_queue(task); return 0; err: tbit_handleerror(task, errno); tbit_queue(task); return -1; } static int dl_data_blinddata(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_blind_t *blind = tbit->data; tbit_segment_t *seg; tbit_probe_t *tp; if(state->mode == MODE_DATA) return dl_data_null(task, dl); if(state->mode != MODE_BLIND) return 0; /* * if we got some data, or the packet is an ack that indicates the * blind data was accepted, then we're done */ if(dl->dl_tcp_datalen > 0 || slist_count(state->segments) == 0) { if(state->blind_step == 2 && slist_count(state->segments) == 0) state->blind_flags |= TBIT_STATE_BLIND_FLAG_ACCEPTED; state->mode = MODE_DATA; tp_flush(state, NULL); return dl_data_null(task, dl); } /* skip over unexpected data */ if(dl->dl_tcp_seq != state->rcv_nxt) return 0; /* if we got a fin while trying to do the measurement, stop */ if((dl->dl_tcp_flags & TH_FIN) != 0) { tbit_result(task, SCAMPER_TBIT_RESULT_TCP_FIN); return 0; } seg = slist_head_item(state->segments); if(state->blind_step == 0) { if(seg->len != state->blind_part2 + state->blind_part3) return 0; state->blind_step++; state->attempt = 0; /* in step 1, we send third segment with wrong ack */ if((tp = tp_tcp(state)) == NULL) goto err; tp->tp_seq += state->blind_part2; tp->tp_len = state->blind_part3; tp->tp_ack += blind->off; tp->wait = TBIT_TIMEOUT_BLINDDATA; } else if(state->blind_step == 1) { state->blind_flags |= TBIT_STATE_BLIND_FLAG_CHALLENGE; if(state->attempt >= blind->retx) { state->blind_step++; state->attempt = 0; } } else if(state->blind_step == 2) { if(seg->len != state->blind_part3) return 0; state->blind_step++; state->attempt = 0; tp_flush(state, NULL); /* in step 3, we send the third segment with correct ack */ if((tp = tp_tcp(state)) == NULL) goto err; tp->tp_len = seg->len; tp->wait = TBIT_TIMEOUT_BLINDDATA; } return 0; err: tbit_handleerror(task, errno); return -1; } /* * dl_data_blindfin * * step 0: send the first part * step 1: send a fin, leaving a hole in receiver's window * step 2: fill the hole * step 3: wait to see if the server ack's the FIN beyond acking the data */ static int dl_data_blindfin(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_blind_t *blind = tbit->data; tbit_segment_t *seg; tbit_probe_t *tp; if(state->mode == MODE_DATA) return dl_data_null(task, dl); if(state->mode != MODE_BLIND) return 0; /* * if the packet does not contain the expected sequence number, but we're in * step 2, we need to check the ack incase it covers the data we've sent */ if(slist_count(state->segments) == 0 && state->blind_step == 2 && dl->dl_tcp_seq != state->rcv_nxt) { /* got an ack covering the request without the FIN */ if(dl->dl_tcp_ack == state->blind_ack) { state->blind_step = 3; return 0; } /* ack indicates the blind FIN was accepted */ if(dl->dl_tcp_ack == state->blind_ack + 1 && (state->flags & TBIT_STATE_FLAG_FIN_ACKED) == 0) { state->blind_flags |= TBIT_STATE_BLIND_FLAG_ACCEPTED; state->flags |= TBIT_STATE_FLAG_FIN_ACKED; state->snd_nxt++; state->mode = MODE_FIN; tp_flush(state, NULL); } return 0; } /* skip over unexpected data */ if(dl->dl_tcp_seq != state->rcv_nxt) { scamper_debug(__func__, "skip %u %u", dl->dl_tcp_seq, state->rcv_nxt); return 0; } seg = slist_head_item(state->segments); if(state->blind_step == 0) { if(seg->len != state->blind_part2) return 0; state->blind_step++; state->attempt = 0; /* in step 1, we send the FIN with wrong ack */ if((tp = tp_tcp(state)) == NULL) goto err; tp->tp_seq += state->blind_part2; tp->tp_ack += blind->off; tp->tp_flags |= TH_FIN; tp->wait = TBIT_TIMEOUT_BLINDDATA; } else if(state->blind_step == 1) { /* if we get an ack in this stage, classify as a challenge ack */ if(dl->dl_tcp_datalen == 0 && (dl->dl_tcp_flags & TH_FIN) == 0) state->blind_flags |= TBIT_STATE_BLIND_FLAG_CHALLENGE; if(state->attempt >= blind->retx) { state->blind_step++; state->attempt = 0; } } else if(state->blind_step == 2 || state->blind_step == 3) { /* waiting for an ACK covering the data we sent */ if(dl->dl_tcp_ack < state->blind_ack) { scamper_debug(__func__, "old ack %u %u", dl->dl_tcp_ack, state->blind_ack); return 0; } //if(state->blind_step == 2) //{ //timeval_add_ms(&state->timeout, &dl->dl_tv, TBIT_TIMEOUT_BLINDDATA); //state->flags |= TBIT_STATE_FLAG_NORESET; //} state->blind_step = 3; /* make sure the ack is one of two possible values */ if(dl->dl_tcp_ack > state->blind_ack + 1) { errno = 0; goto err; } /* pass data up to the application and send an ack for it */ if(dl->dl_tcp_datalen > 0) { if(tbit_app_rx(task, dl->dl_tcp_data, dl->dl_tcp_datalen) < 0) goto err; state->rcv_nxt += dl->dl_tcp_datalen; if((tp = tp_tcp(state)) == NULL) goto err; } /* * if the packet is an ack that indicates the blind fin was accepted, * then we're done */ if(dl->dl_tcp_ack == state->blind_ack + 1 && (state->flags & TBIT_STATE_FLAG_FIN_ACKED) == 0) { state->blind_flags |= TBIT_STATE_BLIND_FLAG_ACCEPTED; state->flags |= TBIT_STATE_FLAG_FIN_ACKED; state->snd_nxt++; state->mode = MODE_FIN; tp_flush(state, NULL); } } return 0; err: tbit_handleerror(task, errno); return -1; } /* * dl_data_blindrst: * * try and reset the connection three times for the first three data packets, * by sending blinded syn/rst. */ static int dl_data_blindrst(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_blind_t *blind = tbit->data; tbit_probe_t *tp; assert(tbit->type == SCAMPER_TBIT_TYPE_BLIND_RST || tbit->type == SCAMPER_TBIT_TYPE_BLIND_SYN); if((state->flags & TBIT_STATE_FLAG_NOMOREDATA) != 0 && state->mode == MODE_BLIND) { /* we do not use the rxq through this stage */ if(state->rxq != NULL) { scamper_tbit_tcpq_free(state->rxq, free); state->rxq = NULL; } if(dl->dl_tcp_datalen == 0 && (dl->dl_tcp_flags & TH_FIN) == 0) { /* infer if the ack could be a challenge ack */ if(state->blind_c > 0 && dl->dl_tcp_ack == state->snd_nxt) state->blind_flags |= TBIT_STATE_BLIND_FLAG_CHALLENGE; return 0; } /* if it is out of sequence, then send an ack for what we want */ if(dl->dl_tcp_seq != state->rcv_nxt) { if(tp_tcp(state) == NULL) goto err; return 0; } /* * make a note that we saw a fin (or data) at some point to help * classify later */ if(dl->dl_tcp_flags & TH_FIN) state->blind_flags |= TBIT_STATE_BLIND_FLAG_FIN; if(dl->dl_tcp_datalen > 0) state->flags |= TBIT_STATE_FLAG_SEEN_DATA; /* * if we've already sent a rst/syn for this packet, accept the data so * we can move on to the next one */ if(state->blind_sent == 1 && dl->dl_tcp_datalen > 0) { state->rcv_nxt += dl->dl_tcp_datalen; if(tbit_app_rx(task, dl->dl_tcp_data, dl->dl_tcp_datalen) < 0) goto err; } if((tp = tp_tcp(state)) == NULL) goto err; /* if the packet is a pure fin, then stop now */ if((dl->dl_tcp_flags & TH_FIN) != 0 && dl->dl_tcp_datalen == 0) { tp->tp_flags |= TH_FIN; tp->tp_ack++; state->rcv_nxt++; state->mode = MODE_FIN; state->flags |= TBIT_STATE_FLAG_FIN_SEEN; return 0; } if(state->blind_sent == 0) { /* * if we haven't sent a blinded rst/syn packet for this piece of * data yet, then send one now */ if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_RST) tp->tp_flags = TH_RST; else tp->tp_flags = TH_SYN; tp->tp_seq += blind->off; state->blind_sent = 1; state->blind_c++; } else { /* * move on to the next piece of data. if we've sent enough * blinded rst/syn packets, then let the connection complete and * move on. */ state->blind_sent = 0; state->blind_ignored++; if(state->blind_c >= blind->retx) state->mode = MODE_DATA; else tp_flush(state, tp); if((dl->dl_tcp_flags & TH_FIN) != 0) { tp->tp_flags |= TH_FIN; tp->tp_ack++; state->rcv_nxt++; state->mode = MODE_FIN; state->flags |= TBIT_STATE_FLAG_FIN_SEEN; } } tp->wait = TBIT_TIMEOUT_LONG; state->attempt = 0; } else if((state->flags & TBIT_STATE_FLAG_NOMOREDATA) == 0 || state->mode == MODE_DATA) { return dl_data_null(task, dl); } return 0; err: tbit_handleerror(task, errno); return -1; } static void dl_data(scamper_task_t *task, scamper_dl_rec_t *dl) { static int (* const func[])(scamper_task_t *, scamper_dl_rec_t *) = { NULL, dl_data_pmtud, dl_data_ecn, dl_data_null, dl_data_sack_rcvr, dl_data_icw, NULL, dl_data_blinddata, dl_data_blindrst, dl_data_blindrst, dl_data_blindfin, }; scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); tbit_segment_t *seg; uint32_t ab; int timeout = TBIT_TIMEOUT_LONG; if((tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA || tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN) && state->mode == MODE_BLIND) timeout = TBIT_TIMEOUT_BLINDDATA; if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_SYN && (dl->dl_tcp_flags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK) && dl->dl_tcp_seq != state->sa_seq) { tbit_result(task, SCAMPER_TBIT_RESULT_BLIND_SYNNEW); return; } if((state->flags & TBIT_STATE_FLAG_NORESET) == 0) timeval_add_ms(&state->timeout, &dl->dl_tv, timeout); /* is the data in range? */ if(tbit_data_inrange(state, dl->dl_tcp_seq, dl->dl_tcp_datalen) == 0) return; /* remove segment data from the send queue */ if(dl->dl_tcp_ack > state->snd_nxt) { if((seg = slist_head_item(state->segments)) == NULL) return; ab = dl->dl_tcp_ack - state->snd_nxt; if(ab >= seg->len) { ab = seg->len; slist_head_pop(state->segments); tbit_segment_free(seg); } else { memmove(seg->data, seg->data+ab, seg->len-ab); seg->len -= ab; } state->snd_nxt += ab; } func[tbit->type](task, dl); tbit_queue(task); return; } static void timeout_data(scamper_task_t *task) { static void (* const func[])(scamper_task_t *) = { NULL, timeout_data_pmtud, timeout_data_generic, /* ecn */ timeout_data_generic, /* null */ timeout_data_sack_rcvr, timeout_data_generic, /* icw */ NULL, /* abc */ timeout_data_generic, /* blind-data */ timeout_data_generic, /* blind-rst */ timeout_data_generic, /* blind-syn */ timeout_data_generic, /* blind-fin */ }; scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); tbit_segment_t *seg; tbit_probe_t *tp; if((seg = slist_head_item(state->segments)) != NULL) { if(state->attempt >= tbit->dat_retx) { func[tbit->type](task); return; } if((tp=tp_tcp(state)) == NULL) goto err; tp->tp_len = seg->len; tp->wait = TBIT_TIMEOUT_DEFAULT; tbit_queue(task); } else { tbit_classify(task); if(tbit->result != SCAMPER_TBIT_RESULT_NONE && state->mode != MODE_FIN) { state->mode = MODE_FIN; scamper_task_queue_probe(task); } } return; err: tbit_handleerror(task, errno); return; } /* * timeout_pmtud * * did not observe remote TCP changing behaviour. */ static void timeout_pmtud(scamper_task_t *task) { tbit_classify(task); return; } /* * Checks the response to a PTB message. */ static void dl_pmtud(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_pmtud_t *pmtud = tbit->data; tbit_probe_t *tp; uint16_t mtu = pmtud->mtu; int ipv4 = SCAMPER_ADDR_TYPE_IS_IPV4(tbit->dst) ? 1 : 0; int success = 0; /* no packet size restriction for IPv6 fragmentation header technique */ if(SCAMPER_ADDR_TYPE_IS_IPV6(tbit->dst) && pmtud->mtu < 1280) mtu = 0; /* if an out of sequence packet is received, ack it */ if(dl->dl_tcp_seq != state->rcv_nxt) { if(dl->dl_ip_size > mtu) return; if(tp_tcp(state) == NULL) goto err; tbit_queue(task); return; } if(mtu != 0) { if(SCAMPER_DL_IS_IP_REASS(dl) || dl->dl_ip_size <= mtu || (ipv4 && SCAMPER_DL_IS_IP_DF(dl) == 0)) success = 1; } else { if(SCAMPER_DL_IS_IP_FRAG(dl) || SCAMPER_DL_IS_IP_REASS(dl)) success = 1; } if(success) { state->rcv_nxt += dl->dl_tcp_datalen; if(ipv4 && SCAMPER_DL_IS_IP_DF(dl) == 0) tbit_result(task, SCAMPER_TBIT_RESULT_PMTUD_CLEARDF); else tbit_result(task, SCAMPER_TBIT_RESULT_PMTUD_SUCCESS); if((tp = tp_tcp(state)) == NULL) { tbit_handleerror(task, errno); return; } if((dl->dl_tcp_flags & TH_FIN) != 0) { tp->tp_flags |= TH_FIN; tp->tp_ack++; state->flags |= TBIT_STATE_FLAG_FIN_SEEN; state->rcv_nxt++; } tbit_queue(task); return; } if(pmtud->ptb_retx != 0 && state->attempt >= pmtud->ptb_retx) { tbit_result(task, SCAMPER_TBIT_RESULT_PMTUD_FAIL); return; } /* send another PTB */ if(tp_ptb(state) == NULL) goto err; tbit_queue(task); return; err: tbit_handleerror(task, errno); return; } static void dl_blackhole(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_pmtud_t *pmtud = tbit->data; tbit_probe_t *tp; uint16_t mtu = pmtud->mtu; int ipv4 = SCAMPER_ADDR_TYPE_IS_IPV4(tbit->dst) ? 1 : 0; int ack = 0; /* if an out of sequence packet is received, ack it */ if(dl->dl_tcp_seq != state->rcv_nxt) { if(dl->dl_ip_size > mtu) return; if(tp_tcp(state) == NULL) goto err; tbit_queue(task); return; } if(mtu != 0) { if(dl->dl_ip_size <= mtu || (ipv4 && SCAMPER_DL_IS_IP_DF(dl) == 0)) ack = 1; } else { if(SCAMPER_DL_IS_IP_FRAG(dl) || SCAMPER_DL_IS_IP_REASS(dl)) ack = 1; } if(ack != 0) { state->rcv_nxt += dl->dl_tcp_datalen; if((tp = tp_tcp(state)) == NULL) { tbit_handleerror(task, errno); return; } /* * if we've received the packet and its a fin, then the remote host * might have completed blackhole detection or some similar process. */ if((dl->dl_tcp_flags & TH_FIN) != 0) { tp->tp_flags |= TH_FIN; tp->tp_ack++; state->flags |= TBIT_STATE_FLAG_FIN_SEEN; state->rcv_nxt++; tbit_result(task, SCAMPER_TBIT_RESULT_PMTUD_SUCCESS); } /* reset the timeout */ timeval_add_ms(&state->timeout, &dl->dl_tv, TBIT_TIMEOUT_LONG); } tbit_queue(task); return; err: tbit_handleerror(task, errno); return; } static void timeout_zerowin(scamper_task_t *task) { tbit_classify(task); return; } /* * dl_zerowin: * * packet received, hopefully advertising a receive window sufficient * to send our data. */ static void dl_zerowin(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); tbit_segment_t *seg; tbit_probe_t *tp; if(dl->dl_tcp_win == 0) return; seg = slist_head_item(state->segments); assert(seg != NULL); if((tp = tp_tcp(state)) == NULL) goto err; if(tbit->type == SCAMPER_TBIT_TYPE_SACK_RCVR) tp->tp_len = 1; else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA || tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN) tp->tp_len = state->blind_part1; else tp->tp_len = seg->len; if(tbit->type == SCAMPER_TBIT_TYPE_SACK_RCVR) { tp->wait = TBIT_TIMEOUT_SACK; state->mode = MODE_DATA; } else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA || tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN) { tp->wait = TBIT_TIMEOUT_BLINDDATA; state->mode = MODE_BLIND; } else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_RST || tbit->type == SCAMPER_TBIT_TYPE_BLIND_SYN) { tp->wait = TBIT_TIMEOUT_DEFAULT; state->mode = MODE_BLIND; } else { tp->wait = TBIT_TIMEOUT_DEFAULT; state->mode = MODE_DATA; } state->attempt = 0; tbit_queue(task); return; err: tbit_handleerror(task, errno); return; } static void timeout_moredata(scamper_task_t *task) { tbit_classify(task); return; } /* * dl_moredata * * this function exists to make note of when a new data packet arrives * from beyond the last flight. dl_data_icw has previously sent * FIN-ack packets to encourage a fast resolution to the measurement. */ static void dl_moredata(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_tcpqe_t *qe; tbit_probe_t *tp = NULL; uint32_t seq; uint16_t datalen; int off, fin = 0; assert(tbit->type == SCAMPER_TBIT_TYPE_ICW); if(tbit->type == SCAMPER_TBIT_TYPE_ICW) assert(state->icw_count == 2); /* see if the remote host has acked our fin */ if(dl->dl_tcp_ack == state->snd_nxt + 1 && (state->flags & TBIT_STATE_FLAG_FIN_ACKED) == 0) { state->flags |= TBIT_STATE_FLAG_FIN_ACKED; state->snd_nxt++; } /* skip over packets that do not occupy sequence number space */ if(dl->dl_tcp_datalen == 0 && (dl->dl_tcp_flags & TH_FIN) == 0) return; /* skip over data that is out of range */ if(tbit_data_inrange(state, dl->dl_tcp_seq, dl->dl_tcp_datalen) == 0) return; /* fail if we cannot queue packet */ if(tbit_rxq(state, dl) != 0) { printerror(__func__, "could not queue packet"); goto err; } while(scamper_tbit_tcpq_seg(state->rxq, &seq, &datalen) == 0) { if(scamper_tbit_data_inrange(state->rcv_nxt, seq, datalen) == 0) { scamper_tbit_tcpqe_free(scamper_tbit_tcpq_pop(state->rxq), free); continue; } if(datalen > 0) { if(tbit->type == SCAMPER_TBIT_TYPE_ICW && scamper_tbit_data_seqoff(state->icw_tail, seq+datalen) >= 0) { state->mode = MODE_FIN; tbit_result(task, SCAMPER_TBIT_RESULT_ICW_SUCCESS); } } else { if(tbit->type == SCAMPER_TBIT_TYPE_ICW && scamper_tbit_data_seqoff(state->icw_tail, seq) == 0) { state->mode = MODE_FIN; tbit_result(task, SCAMPER_TBIT_RESULT_ICW_TOOSHORT); } } if((off = scamper_tbit_data_seqoff(state->rcv_nxt, seq)) > 0) { if((tp = tp_tcp(state)) == NULL) goto err; if((state->flags & TBIT_STATE_FLAG_FIN_ACKED) == 0) tp->tp_flags |= TH_FIN; break; } qe = scamper_tbit_tcpq_pop(state->rxq); off = abs(off); fin = (qe->flags & TH_FIN) != 0 ? 1 : 0; if(qe->len > 0) state->rcv_nxt += (qe->len - off); if(tbit_app_rx(task, qe->data+off, qe->len-off) < 0) goto err; scamper_tbit_tcpqe_free(qe, free); qe = NULL; if((tp = tp_tcp(state)) == NULL) goto err; if((state->flags & TBIT_STATE_FLAG_FIN_ACKED) == 0) tp->tp_flags |= TH_FIN; if(fin != 0) { tp->tp_ack++; state->flags |= TBIT_STATE_FLAG_FIN_SEEN; state->rcv_nxt++; break; } } if(tbit_tcpclosed(state)) { if(tbit->result == SCAMPER_TBIT_RESULT_NONE) tbit_classify(task); state->mode = MODE_DONE; } tbit_queue(task); return; err: tbit_handleerror(task, errno); tbit_queue(task); return; } static void timeout_blinddata(scamper_task_t *task) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_blind_t *blind = tbit->data; tbit_segment_t *seg; tbit_probe_t *tp; seg = slist_head_item(state->segments); assert(seg != NULL); if(state->blind_step == 0 || state->blind_step == 3) { if(state->attempt >= blind->retx) { tbit_result(task, SCAMPER_TBIT_RESULT_NONE); return; } if((tp = tp_tcp(state)) == NULL) goto err; if(state->blind_step == 0) tp->tp_len = state->blind_part1; else tp->tp_len = seg->len; tp->wait = TBIT_TIMEOUT_BLINDDATA; tbit_queue(task); return; } if((tp = tp_tcp(state)) == NULL) goto err; tp->tp_len = seg->len; tp->wait = TBIT_TIMEOUT_BLINDDATA; if(state->attempt >= blind->retx) { if(state->blind_step == 1) { /* * if we did not get a challenge ack during the process of * sending the first packet, then record silence. */ if((state->blind_flags & TBIT_STATE_BLIND_FLAG_CHALLENGE) == 0) state->blind_flags |= TBIT_STATE_BLIND_FLAG_SILENCE; } state->attempt = 0; state->blind_step++; } if(state->blind_step == 1) { /* * if we are still in the process of re-trying data packet * with offset ack field, keep trying */ tp->tp_ack += blind->off; tp->tp_seq += state->blind_part2; tp->tp_len = state->blind_part3; } else { tp->tp_len = state->blind_part2; } tbit_queue(task); return; err: tbit_handleerror(task, errno); return; } /* * timeout_blindfin * * step 0: send the first part * step 1: send a fin, leaving a hole in receiver's window * step 2: fill the hole * step 3: wait to see if the server ack's the FIN beyond acking the data */ static void timeout_blindfin(scamper_task_t *task) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_blind_t *blind = tbit->data; tbit_segment_t *seg = slist_head_item(state->segments); tbit_probe_t *tp; if(state->blind_step == 0) { if(state->attempt >= blind->retx) { tbit_result(task, SCAMPER_TBIT_RESULT_NONE); return; } if((tp = tp_tcp(state)) == NULL) goto err; tp->tp_len = state->blind_part1; tp->wait = TBIT_TIMEOUT_BLINDDATA; } else if(state->blind_step == 3) { tp_flush(state, NULL); state->flags &= (~TBIT_STATE_FLAG_NORESET); state->mode = MODE_DATA; } else { if((tp = tp_tcp(state)) == NULL) goto err; tp->tp_len = seg->len; tp->wait = TBIT_TIMEOUT_BLINDDATA; if(state->attempt >= blind->retx) { if(state->blind_step == 1) { /* * if we did not get a challenge ack during the process of * sending the first packet, then record silence. */ if((state->blind_flags & TBIT_STATE_BLIND_FLAG_CHALLENGE) == 0) state->blind_flags |= TBIT_STATE_BLIND_FLAG_SILENCE; } state->attempt = 0; state->blind_step++; } if(state->blind_step == 1) { /* * if we are still in the process of re-trying packet * with offset ack field, keep trying */ tp->tp_ack += blind->off; tp->tp_seq += state->blind_part2; tp->tp_len = 0; tp->tp_flags |= TH_FIN; } else { tp->tp_len = state->blind_part2; state->flags |= TBIT_STATE_FLAG_NORESET; } } tbit_queue(task); return; err: tbit_handleerror(task, errno); return; } /* * timeout_blind * * a timeout has occured doing a blind-test. figure out which blind * test this corresponds to and take the appropriate action */ static void timeout_blind(scamper_task_t *task) { scamper_tbit_t *tbit = tbit_getdata(task); /* if the timeout is for the reset or syn tests, we're done */ if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_RST || tbit->type == SCAMPER_TBIT_TYPE_BLIND_SYN) { tbit_classify(task); } else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA) { timeout_blinddata(task); } else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN) { timeout_blindfin(task); } return; } static int blind_check_rst(const scamper_task_t *t, const scamper_dl_rec_t *dl) { scamper_tbit_t *tbit = tbit_getdata(t); tbit_state_t *state = tbit_getstate(t); scamper_tbit_blind_t *blind = tbit->data; if(((tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA && dl->dl_tcp_seq == state->rcv_nxt + blind->off) || (tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN && dl->dl_tcp_seq == state->rcv_nxt + blind->off) || (tbit->type == SCAMPER_TBIT_TYPE_BLIND_SYN && dl->dl_tcp_ack == state->snd_nxt + blind->off + 1))) return 1; return 0; } /* * do_tbit_handle_dl * * for each packet received, check that the addresses and ports make sense, * and that the packet is not a reset. */ static void do_tbit_handle_dl(scamper_task_t *task, scamper_dl_rec_t *dl) { static void (* const func[])(scamper_task_t *, scamper_dl_rec_t *) = { NULL, NULL, /* MODE_RTSOCK */ NULL, /* MODE_DLHDR */ NULL, /* MODE_FIREWALL */ NULL, /* MODE_DONE */ dl_syn, /* MODE_SYN */ dl_fin, /* MODE_FIN */ dl_data, /* MODE_DATA */ dl_pmtud, /* MODE_PMTUD */ dl_blackhole, /* MODE_BLACKHOLE */ dl_zerowin, /* MODE_ZEROWIN */ dl_moredata, /* MODE_MOREDATA */ dl_data, /* MODE_BLIND */ }; scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_pkt_t *pkt = NULL; scamper_dl_rec_t *newp = NULL; /* * handle packets that arrive in fragments. fall through if it is able * to be reassembled. */ if(dl->dl_ip_off != 0 || SCAMPER_DL_IS_IP_MF(dl)) { scamper_dl_rec_frag_print(dl); pkt = scamper_tbit_pkt_alloc(SCAMPER_TBIT_PKT_DIR_RX, dl->dl_net_raw, dl->dl_ip_size, &dl->dl_tv); if(pkt == NULL || scamper_tbit_record_pkt(tbit, pkt) != 0) goto err; if(tbit_reassemble(task, &newp, dl) != 0) goto err; if(newp == NULL) return; dl = newp; } /* Unless it is an inbound TCP packet for the flow, ignore it */ if(SCAMPER_DL_IS_TCP(dl) == 0 || dl->dl_tcp_sport != tbit->dport || dl->dl_tcp_dport != tbit->sport || scamper_addr_raw_cmp(tbit->dst, dl->dl_ip_src) != 0 || scamper_addr_raw_cmp(tbit->src, dl->dl_ip_dst) != 0) { goto done; } /* * only record the packet if it was not reassembled. If it was reassembled * from fragments, we have already recorded all the fragments. */ if(newp == NULL) { scamper_dl_rec_tcp_print(dl); pkt = scamper_tbit_pkt_alloc(SCAMPER_TBIT_PKT_DIR_RX, dl->dl_net_raw, dl->dl_ip_size, &dl->dl_tv); if(pkt == NULL || scamper_tbit_record_pkt(tbit, pkt) != 0) { if(pkt != NULL) scamper_tbit_pkt_free(pkt); goto err; } } /* only continue if we process TCP packets in this mode */ if(func[state->mode] == NULL) goto done; if(state->mode != MODE_SYN) { /* If a reset packet is received, abandon the measurement */ if((dl->dl_tcp_flags & TH_RST) != 0) { if(state->mode == MODE_BLIND && blind_check_rst(task, dl) == 1) state->blind_flags |= TBIT_STATE_BLIND_FLAG_RST; state->flags |= TBIT_STATE_FLAG_RST_SEEN; tbit_classify(task); return; } /* the ACK flag should be set on all packets */ if((dl->dl_tcp_flags & TH_ACK) == 0) goto done; } /* update the timestamp record */ if((state->flags & TBIT_STATE_FLAG_TCPTS) != 0 && dl->dl_tcp_seq <= state->ts_lastack && state->ts_lastack < dl->dl_tcp_seq + dl->dl_tcp_datalen) { state->ts_recent = dl->dl_tcp_tsval; } func[state->mode](task, dl); done: if(newp != NULL && newp != dl) { if(newp->dl_ip_data != NULL) free(newp->dl_ip_data); free(newp); } return; err: tbit_handleerror(task, errno); return; } static void do_tbit_handle_timeout(scamper_task_t *task) { /* Array of timeout functions */ static void (* const func[])(scamper_task_t *) = { NULL, timeout_generic_error, /* MODE_RTSOCK */ timeout_generic_error, /* MODE_DLHDR */ NULL, /* MODE_FIREWALL */ NULL, /* MODE_DONE */ timeout_syn, /* MODE_SYN */ timeout_fin, /* MODE_FIN */ timeout_data, /* MODE_DATA */ timeout_pmtud, /* MODE_PMTUD */ timeout_pmtud, /* MODE_BLACKHOLE */ timeout_zerowin, /* MODE_ZEROWIN */ timeout_moredata, /* MODE_MOREDATA */ timeout_blind, /* MODE_BLIND */ }; tbit_state_t *state = tbit_getstate(task); /* Call the appropriate timeout function */ if(func[state->mode] != NULL) func[state->mode](task); return; } static void tbit_handle_dlhdr(scamper_dlhdr_t *dlhdr) { scamper_task_t *task = dlhdr->param; tbit_state_t *state = tbit_getstate(task); if(dlhdr->error != 0) { scamper_task_queue_done(task, 0); return; } state->mode = MODE_FIREWALL; scamper_task_queue_probe(task); return; } static void tbit_handle_rt(scamper_route_t *rt) { scamper_task_t *task = rt->param; scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_dl_t *dl; uint16_t mtu; if(state->mode != MODE_RTSOCK || state->route != rt) goto done; #ifndef _WIN32 if(state->rtsock != NULL) { scamper_fd_free(state->rtsock); state->rtsock = NULL; } #endif if(rt->error != 0 || rt->ifindex < 0) { printerror(__func__, "could not get ifindex"); tbit_handleerror(task, errno); goto done; } /* * scamper needs the datalink to transmit packets; try and get a * datalink on the ifindex specified. */ if((state->dl = scamper_fd_dl(rt->ifindex)) == NULL) { scamper_debug(__func__, "could not get dl for %d", rt->ifindex); tbit_handleerror(task, errno); goto done; } /* Calculate the MSS to advertise */ if(tbit->client_mss == 0) { if(scamper_if_getmtu(rt->ifindex, &mtu) != 0) { scamper_debug(__func__, "could not get the interface mtu"); tbit_handleerror(task, errno); goto done; } if(tbit->dst->type == SCAMPER_ADDR_TYPE_IPV4) tbit->client_mss = mtu - 40; else if(tbit->dst->type == SCAMPER_ADDR_TYPE_IPV6) tbit->client_mss = mtu - 60; scamper_debug(__func__, "using client mss = %hu", tbit->client_mss); } /* * determine the underlying framing to use with each probe packet that will * be sent on the datalink. */ state->mode = MODE_DLHDR; if((state->dlhdr = scamper_dlhdr_alloc()) == NULL) { tbit_handleerror(task, errno); goto done; } dl = scamper_fd_dl_get(state->dl); state->dlhdr->dst = scamper_addr_use(tbit->dst); state->dlhdr->gw = rt->gw != NULL ? scamper_addr_use(rt->gw) : NULL; state->dlhdr->ifindex = rt->ifindex; state->dlhdr->txtype = scamper_dl_tx_type(dl); state->dlhdr->param = task; state->dlhdr->cb = tbit_handle_dlhdr; if(scamper_dlhdr_get(state->dlhdr) != 0) { tbit_handleerror(task, errno); goto done; } if(state->mode != MODE_FIREWALL && scamper_task_queue_isdone(task) == 0) scamper_task_queue_wait(task, 1000); done: scamper_route_free(rt); if(state->route == rt) state->route = NULL; return; } static void do_tbit_write(scamper_file_t *sf, scamper_task_t *task) { scamper_file_write_tbit(sf, tbit_getdata(task)); return; } static void tbit_state_free(scamper_task_t *task) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); int i; if(state == NULL) return; assert(tbit != NULL); if(state->fw != NULL) scamper_firewall_entry_free(state->fw); #ifndef _WIN32 if(state->rtsock != NULL) scamper_fd_free(state->rtsock); #endif if(state->dl != NULL) scamper_fd_free(state->dl); if(state->dlhdr != NULL) scamper_dlhdr_free(state->dlhdr); if(state->route != NULL) scamper_route_free(state->route); if(tbit->type == SCAMPER_TBIT_TYPE_PMTUD) { if(state->pmtud_ptb_data != NULL) free(state->pmtud_ptb_data); } if(state->segments != NULL) slist_free_cb(state->segments, (slist_free_t)tbit_segment_free); if(state->tx != NULL) slist_free_cb(state->tx, (slist_free_t)tp_free); if(state->rxq != NULL) scamper_tbit_tcpq_free(state->rxq, free); if(state->frags != NULL) { for(i=0; ifragc; i++) tbit_frags_free(state->frags[i]); free(state->frags); } #if defined(HAVE_OPENSSL) if(state->ssl != NULL) { SSL_free(state->ssl); } else { if(state->wbio != NULL) BIO_free(state->wbio); if(state->rbio != NULL) BIO_free(state->rbio); } #endif free(state); return; } static int tbit_state_alloc(scamper_task_t *task) { scamper_tbit_t *tbit = tbit_getdata(task); scamper_tbit_null_t *null; tbit_state_t *state; uint16_t seq; if((state = malloc_zero(sizeof(tbit_state_t))) == NULL) { printerror(__func__, "could not malloc state"); goto err; } state->mode = MODE_RTSOCK; scamper_task_setstate(task, state); if((state->segments = slist_alloc()) == NULL) { printerror(__func__, "could not create segments list"); goto err; } if((state->tx = slist_alloc()) == NULL) { printerror(__func__, "could not create tx list"); goto err; } /* * generate a random 16 bit sequence number so we don't have to deal * with sequence number wrapping for now. */ if(random_u16(&seq) != 0) { printerror(__func__, "could not get random isn"); goto err; } state->snd_nxt = seq; if(tbit->dst->type == SCAMPER_ADDR_TYPE_IPV4) random_u16(&state->ipid); #ifndef _WIN32 if((state->rtsock = scamper_fd_rtsock()) == NULL) { printerror(__func__, "could not get rtsock"); goto err; } #endif if(tbit->type == SCAMPER_TBIT_TYPE_SACK_RCVR) state->flags |= TBIT_STATE_FLAG_NORESET; if(tbit->type == SCAMPER_TBIT_TYPE_NULL) { null = tbit->data; if(null->options & SCAMPER_TBIT_NULL_OPTION_IPQS_SYN) { random_u32(&state->qs_nonce); state->qs_nonce &= 0x3fffffff; /* 30 bit value */ random_u8(&state->qs_ttl); } /* if we are using the fast-open cookie, get the payload to include */ if(tbit->fo_cookielen > 0 && tbit_app_rx(task, NULL, 0) <= 0) { scamper_debug(__func__, "could not get payload"); goto err; } } return 0; err: return -1; } static void do_tbit_halt(scamper_task_t *task) { tbit_result(task, SCAMPER_TBIT_RESULT_HALTED); return; } static void do_tbit_free(scamper_task_t *task) { scamper_tbit_t *tbit = tbit_getdata(task); if(tbit == NULL) return; tbit_state_free(task); scamper_tbit_free(tbit); return; } static int tbit_tx_tcp(scamper_task_t *task, scamper_probe_t *pr, tbit_probe_t *tp) { static scamper_probe_ipopt_t opt; scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_null_t *null; struct timeval tv; tbit_segment_t *seg; pr->pr_ip_proto = IPPROTO_TCP; pr->pr_tcp_sport = tbit->sport; pr->pr_tcp_dport = tbit->dport; pr->pr_tcp_seq = state->snd_nxt; pr->pr_tcp_win = 65535; if(state->mode == MODE_SYN) { pr->pr_tcp_flags = TH_SYN; pr->pr_tcp_mss = tbit->client_mss; pr->pr_tcp_wscale = tbit->wscale; if(tbit->options & SCAMPER_TBIT_OPTION_TCPTS) { gettimeofday_wrap(&tv); pr->pr_tcp_opts |= SCAMPER_PROBE_TCPOPT_TS; pr->pr_tcp_tsval = timeval_diff_ms(&tv, &tbit->start); } if(tbit->options & SCAMPER_TBIT_OPTION_SACK) pr->pr_tcp_opts |= SCAMPER_PROBE_TCPOPT_SACK; switch(tbit->type) { case SCAMPER_TBIT_TYPE_ECN: pr->pr_tcp_flags |= (TH_ECE|TH_CWR); break; case SCAMPER_TBIT_TYPE_SACK_RCVR: pr->pr_tcp_opts |= SCAMPER_PROBE_TCPOPT_SACK; break; case SCAMPER_TBIT_TYPE_NULL: null = tbit->data; if((null->options & SCAMPER_TBIT_NULL_OPTION_FO) || (null->options & SCAMPER_TBIT_NULL_OPTION_FO_EXP)) { if(null->options & SCAMPER_TBIT_NULL_OPTION_FO) pr->pr_tcp_opts |= SCAMPER_PROBE_TCPOPT_FO; else pr->pr_tcp_opts |= SCAMPER_PROBE_TCPOPT_FO_EXP; pr->pr_tcp_fo_cookielen = tbit->fo_cookielen; if(tbit->fo_cookielen > 0) { pr->pr_tcp_fo_cookie = tbit->fo_cookie; if((seg = slist_head_item(state->segments)) != NULL) { pr->pr_data = seg->data; pr->pr_len = seg->len; } } } if(null->options & SCAMPER_TBIT_NULL_OPTION_IPTS_SYN) { opt.type = SCAMPER_PROBE_IPOPTS_V4TSO; pr->pr_ipopts = &opt; pr->pr_ipoptc = 1; } if(null->options & SCAMPER_TBIT_NULL_OPTION_IPRR_SYN) { opt.type = SCAMPER_PROBE_IPOPTS_V4RR; pr->pr_ipopts = &opt; pr->pr_ipoptc = 1; } if(null->options & SCAMPER_TBIT_NULL_OPTION_IPQS_SYN) { opt.type = SCAMPER_PROBE_IPOPTS_QUICKSTART; opt.opt_qs_func = 0; opt.opt_qs_rate = 2; opt.opt_qs_ttl = state->qs_ttl; opt.opt_qs_nonce = state->qs_nonce; pr->pr_ipopts = &opt; pr->pr_ipoptc = 1; } break; } state->attempt++; return 1; } if(tp != NULL) { if(tp->tp_len > 0) { if((seg = slist_head_item(state->segments)) == NULL) return 0; pr->pr_data = seg->data + (tp->tp_seq - state->snd_nxt); pr->pr_len = tp->tp_len; state->attempt++; } else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN && state->mode == MODE_BLIND && state->blind_step == 1 && (tp->tp_flags & TH_FIN) != 0) { state->attempt++; } pr->pr_tcp_seq = tp->tp_seq; pr->pr_tcp_ack = tp->tp_ack; pr->pr_tcp_flags = tp->tp_flags; if(tp->tp_sackb > 0) { pr->pr_tcp_sackb = tp->tp_sackb; memcpy(pr->pr_tcp_sack, tp->tp_sack, 32); } } else { pr->pr_tcp_ack = state->rcv_nxt; pr->pr_tcp_flags = TH_ACK; if(state->mode == MODE_FIN) pr->pr_tcp_flags |= TH_FIN; } if(state->flags & TBIT_STATE_FLAG_TCPTS) { gettimeofday_wrap(&tv); pr->pr_tcp_opts |= SCAMPER_PROBE_TCPOPT_TS; pr->pr_tcp_tsval = timeval_diff_ms(&tv, &tbit->start); pr->pr_tcp_tsecr = state->ts_recent; state->ts_lastack = pr->pr_tcp_ack; } /* only set ECN bits on data packets */ if(tbit->type == SCAMPER_TBIT_TYPE_ECN && (pr->pr_tcp_flags & TH_FIN) == 0 && pr->pr_len > 0) { if((state->ecn_flags & TBIT_STATE_ECN_FLAG_CE_SET) != 0) pr->pr_ip_tos = IPTOS_ECN_CE; else if((state->ecn_flags & TBIT_STATE_ECN_FLAG_ECT) != 0) pr->pr_ip_tos = IPTOS_ECN_ECT1; if(state->ecn_flags & TBIT_STATE_ECN_FLAG_CWR_SET) pr->pr_tcp_flags |= TH_CWR; } return 1; } static int tbit_tx_ptb(scamper_task_t *task, scamper_probe_t *pr, tbit_probe_t *tp) { scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_pmtud_t *pmtud = tbit->data; SCAMPER_PROBE_ICMP_PTB(pr, pmtud->mtu); if(pmtud->ptbsrc != NULL) pr->pr_ip_src = pmtud->ptbsrc; pr->pr_data = state->pmtud_ptb_data; pr->pr_len = state->pmtud_ptb_datalen; state->attempt++; state->pmtud_ptb_c++; return 1; } static void do_tbit_probe(scamper_task_t *task) { scamper_firewall_rule_t sfw; scamper_tbit_t *tbit = tbit_getdata(task); tbit_state_t *state = tbit_getstate(task); scamper_tbit_pkt_t *pkt; scamper_probe_t probe; tbit_probe_t *tp; int wait, rc; if(state == NULL) { /* Fill in the test start time */ gettimeofday_wrap(&tbit->start); /* Allocate space to store task state */ if(tbit_state_alloc(task) != 0) goto err; state = tbit_getstate(task); } if(state->mode == MODE_RTSOCK) { state->route = scamper_route_alloc(tbit->dst, task, tbit_handle_rt); if(state->route == NULL) goto err; #ifndef _WIN32 if(scamper_rtsock_getroute(state->rtsock, state->route) != 0) goto err; #else if(scamper_rtsock_getroute(state->route) != 0) goto err; #endif if(scamper_task_queue_isdone(task)) return; if(state->mode != MODE_FIREWALL) { scamper_task_queue_wait(task, 1000); return; } } if(state->mode == MODE_FIREWALL) { sfw.type = SCAMPER_FIREWALL_RULE_TYPE_5TUPLE; sfw.sfw_5tuple_proto = IPPROTO_TCP; sfw.sfw_5tuple_src = tbit->dst; sfw.sfw_5tuple_dst = tbit->src; sfw.sfw_5tuple_sport = tbit->dport; sfw.sfw_5tuple_dport = tbit->sport; if((state->fw = scamper_firewall_entry_get(&sfw)) == NULL) { scamper_debug(__func__, "could not get firewall entry"); goto err; } state->mode = MODE_SYN; } memset(&probe, 0, sizeof(probe)); /* Common to all probes */ probe.pr_dl = scamper_fd_dl_get(state->dl); probe.pr_dl_buf = state->dlhdr->buf; probe.pr_dl_len = state->dlhdr->len; probe.pr_ip_src = tbit->src; probe.pr_ip_dst = tbit->dst; probe.pr_ip_ttl = tbit->ttl; if(tbit->dst->type == SCAMPER_ADDR_TYPE_IPV4) { probe.pr_ip_id = state->ipid++; probe.pr_ip_off = IP_DF; } /* if there are specific packets to be sent, then do so */ if((tp = slist_head_pop(state->tx)) != NULL) { if(tp->type == TBIT_PROBE_TYPE_TCP) rc = tbit_tx_tcp(task, &probe, tp); else if(tp->type == TBIT_PROBE_TYPE_PTB) rc = tbit_tx_ptb(task, &probe, tp); else rc = 0; wait = tp->wait; tp_free(tp); } else { rc = tbit_tx_tcp(task, &probe, NULL); wait = TBIT_TIMEOUT_DEFAULT; } if(rc == 0) { tbit_queue(task); return; } /* Send the probe */ if(scamper_probe(&probe) != 0) { errno = probe.pr_errno; printerror(__func__, "could not send probe"); goto err; } if((pkt = scamper_tbit_pkt_alloc(SCAMPER_TBIT_PKT_DIR_TX, probe.pr_tx_raw, probe.pr_tx_rawlen, &probe.pr_tx))==NULL || scamper_tbit_record_pkt(tbit, pkt) != 0) { printerror(__func__, "could not record packet"); goto err; } if(wait > 0) timeval_add_ms(&state->timeout, &probe.pr_tx, wait); tbit_queue(task); return; err: tbit_handleerror(task, errno); return; } static int tbit_arg_param_validate(int optid, char *param, long *out) { long tmp; switch(optid) { case TBIT_OPT_TYPE: if(strcasecmp(param, "pmtud") == 0) tmp = SCAMPER_TBIT_TYPE_PMTUD; else if(strcasecmp(param, "ecn") == 0) tmp = SCAMPER_TBIT_TYPE_ECN; else if(strcasecmp(param, "null") == 0) tmp = SCAMPER_TBIT_TYPE_NULL; else if(strcasecmp(param, "sack-rcvr") == 0) tmp = SCAMPER_TBIT_TYPE_SACK_RCVR; else if(strcasecmp(param, "icw") == 0) tmp = SCAMPER_TBIT_TYPE_ICW; else if(strcasecmp(param, "blind-data") == 0) tmp = SCAMPER_TBIT_TYPE_BLIND_DATA; else if(strcasecmp(param, "blind-rst") == 0) tmp = SCAMPER_TBIT_TYPE_BLIND_RST; else if(strcasecmp(param, "blind-syn") == 0) tmp = SCAMPER_TBIT_TYPE_BLIND_SYN; else if(strcasecmp(param, "blind-fin") == 0) tmp = SCAMPER_TBIT_TYPE_BLIND_FIN; else goto err; break; case TBIT_OPT_APP: if(strcasecmp(param, "http") == 0) tmp = SCAMPER_TBIT_APP_HTTP; else if(strcasecmp(param, "bgp") == 0) tmp = SCAMPER_TBIT_APP_BGP; else goto err; break; case TBIT_OPT_SPORT: case TBIT_OPT_DPORT: case TBIT_OPT_MSS: case TBIT_OPT_MTU: case TBIT_OPT_ASN: if(string_tolong(param, &tmp) != 0 || tmp < 0 || tmp > 65535) goto err; break; case TBIT_OPT_USERID: if(string_tolong(param, &tmp) != 0 || tmp < 0) goto err; break; case TBIT_OPT_FO: tmp = strlen(param); if((tmp % 8) != 0) return -1; tmp = tmp / 2; if(tmp < 4 || tmp > 16) return -1; break; case TBIT_OPT_WSCALE: if(string_tolong(param, &tmp) != 0 || tmp > 14 || tmp < 0) goto err; break; case TBIT_OPT_ATTEMPTS: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 4) goto err; break; case TBIT_OPT_OFFSET: if(string_tolong(param, &tmp) != 0) goto err; #if SIZEOF_LONG > 4 if(tmp > 2147483647 || tmp < -2147483647) goto err; #endif break; case TBIT_OPT_TTL: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 255) goto err; break; case TBIT_OPT_PTBSRC: case TBIT_OPT_OPTION: case TBIT_OPT_URL: case TBIT_OPT_SRCADDR: tmp = 0; break; default: return -1; } /* valid parameter */ if(out != NULL) *out = tmp; return 0; err: return -1; } int scamper_do_tbit_arg_validate(int argc, char *argv[], int *stop) { return scamper_options_validate(opts, opts_cnt, argc, argv, stop, tbit_arg_param_validate); } static int tbit_app_smtp(scamper_tbit_t *tbit, tbit_options_t *o) { if(tbit->dport == 0) tbit->dport = 25; return 0; } static int tbit_app_dns(scamper_tbit_t *tbit, tbit_options_t *o) { if(tbit->dport == 0) tbit->dport = 53; return 0; } static int tbit_app_ftp(scamper_tbit_t *tbit, tbit_options_t *o) { if(tbit->dport == 0) tbit->dport = 21; return 0; } static int tbit_app_bgp(scamper_tbit_t *tbit, tbit_options_t *o) { scamper_tbit_app_bgp_t *bgp; if(tbit->dport == 0) tbit->dport = 179; if((bgp = scamper_tbit_app_bgp_alloc()) == NULL) return -1; if(o->asn == 0) bgp->asn = 1; else bgp->asn = o->asn; tbit->app_data = bgp; return 0; } static int tbit_app_http(scamper_tbit_t *tbit, tbit_options_t *o) { uint8_t type = SCAMPER_TBIT_APP_HTTP_TYPE_HTTP; char *file = NULL, *host, *port, *ptr; uint16_t dport = 80; long lo; if(o->url == NULL) { host = NULL; file = "/"; goto done; } if(strncasecmp(o->url, "http://", 7) == 0) { host = o->url+7; } #if defined(HAVE_OPENSSL) else if(strncasecmp(o->url, "https://", 8) == 0) { if(scamper_option_notls() != 0) return -1; dport = 443; host = o->url+8; type = SCAMPER_TBIT_APP_HTTP_TYPE_HTTPS; } #endif else { return -1; } /* extract the domain */ ptr = host; while(*ptr != '\0') { if(*ptr == '/' || *ptr == ':') break; if(isalnum((int)*ptr) == 0 && *ptr != '-' && *ptr != '.') return -1; ptr++; } if(ptr == host) return -1; if(*ptr == '\0') goto done; if(*ptr == ':') { *ptr = '\0'; ptr++; port = ptr; while(*ptr != '\0') { if(*ptr == '/') break; ptr++; } if(*ptr == '\0') goto done; *ptr = '\0'; if(string_tolong(port, &lo) != 0 || lo < 1 || lo > 65535) return -1; dport = (uint16_t)lo; *ptr = '/'; } memmove(host-1, host, ptr-host); host--; *(ptr-1) = '\0'; file = ptr; done: if(file == NULL) file = "/"; if(tbit->dport == 0) tbit->dport = dport; if((tbit->app_data = scamper_tbit_app_http_alloc(type, host, file)) == NULL) return -1; return 0; } static int tbit_alloc_pmtud(scamper_tbit_t *tbit, tbit_options_t *o) { scamper_tbit_pmtud_t *pmtud; int af; if((pmtud = scamper_tbit_pmtud_alloc()) == NULL) return -1; tbit->data = pmtud; if(o->mtu == 0) pmtud->mtu = 1280; else pmtud->mtu = o->mtu; if(o->ptbsrc != NULL) { af = scamper_addr_af(tbit->dst); if(af != AF_INET && af != AF_INET6) return -1; pmtud->ptbsrc = scamper_addrcache_resolve(addrcache, af, o->ptbsrc); if(pmtud->ptbsrc == NULL || pmtud->ptbsrc->type != tbit->dst->type) return -1; } /* if we're in blackhole mode, we don't send PTB messages */ if(o->options & TBIT_OPT_OPTION_BLACKHOLE) pmtud->options |= SCAMPER_TBIT_PMTUD_OPTION_BLACKHOLE; else if(o->attempts == 0) pmtud->ptb_retx = 4; else pmtud->ptb_retx = o->attempts; return 0; } static int tbit_alloc_icw(scamper_tbit_t *tbit, tbit_options_t *o) { if((tbit->data = scamper_tbit_icw_alloc()) == NULL) return -1; if(o->options & TBIT_OPT_OPTION_TCPTS) tbit->options |= SCAMPER_TBIT_OPTION_TCPTS; if(o->options & TBIT_OPT_OPTION_SACK) tbit->options |= SCAMPER_TBIT_OPTION_SACK; return 0; } static int tbit_alloc_blind(scamper_tbit_t *tbit, tbit_options_t *o) { scamper_tbit_blind_t *blind; if((blind = scamper_tbit_blind_alloc()) == NULL) return -1; tbit->data = blind; if(o->attempts == 0) blind->retx = 3; else blind->retx = o->attempts; if(o->offset == 0) { if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_SYN || tbit->type == SCAMPER_TBIT_TYPE_BLIND_RST) blind->off = 10; else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA || tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN) blind->off = -70000; else return -1; } else blind->off = o->offset; return 0; } static int tbit_alloc_null(scamper_tbit_t *tbit, tbit_options_t *o) { scamper_tbit_null_t *null; uint16_t u; /* ensure that only one IP option is set on the SYN packet */ u = (o->options & TBIT_OPT_OPTION_IPOPT_SYN_MASK); if(u != 0 && countbits32(u) != 1) return -1; if((null = scamper_tbit_null_alloc()) == NULL) return -1; tbit->data = null; if(o->options & TBIT_OPT_OPTION_TCPTS) tbit->options |= SCAMPER_TBIT_OPTION_TCPTS; if(o->options & TBIT_OPT_OPTION_SACK) tbit->options |= SCAMPER_TBIT_OPTION_SACK; if(o->options & TBIT_OPT_OPTION_IPQS_SYN) null->options |= SCAMPER_TBIT_NULL_OPTION_IPQS_SYN; if(o->options & TBIT_OPT_OPTION_FO) null->options |= SCAMPER_TBIT_NULL_OPTION_FO; else if(o->options & TBIT_OPT_OPTION_FO_EXP) null->options |= SCAMPER_TBIT_NULL_OPTION_FO_EXP; if(o->fo_cookielen > 0) { if(scamper_tbit_fo_setcookie(tbit, o->fo_cookie, o->fo_cookielen) != 0) return -1; if((o->options & (TBIT_OPT_OPTION_FO|TBIT_OPT_OPTION_FO_EXP)) == 0) null->options = SCAMPER_TBIT_NULL_OPTION_FO; } if(o->options & (TBIT_OPT_OPTION_IPTS_SYN | TBIT_OPT_OPTION_IPRR_SYN)) { if(SCAMPER_ADDR_TYPE_IS_IPV4(tbit->dst) == 0) return -1; if(o->options & TBIT_OPT_OPTION_IPTS_SYN) null->options |= SCAMPER_TBIT_NULL_OPTION_IPTS_SYN; if(o->options & TBIT_OPT_OPTION_IPRR_SYN) null->options |= SCAMPER_TBIT_NULL_OPTION_IPRR_SYN; } return 0; } /* * scamper_do_tbit_alloc * * Given a string representing a tbit task, parse the parameters and assemble * a tbit. Return the tbit structure so that it is all ready to go. */ void *scamper_do_tbit_alloc(char *str) { static int (* const type_func[])(scamper_tbit_t *, tbit_options_t *) = { NULL, tbit_alloc_pmtud, /* pmtud */ NULL, /* ecn */ tbit_alloc_null, /* null */ NULL, /* sack-rcvr */ tbit_alloc_icw, /* icw */ NULL, /* abc */ tbit_alloc_blind, /* blind-data */ tbit_alloc_blind, /* blind-rst */ tbit_alloc_blind, /* blind-syn */ tbit_alloc_blind, /* blind-fin */ }; static int (* const app_func[])(scamper_tbit_t *, tbit_options_t *) = { NULL, tbit_app_http, tbit_app_smtp, tbit_app_dns, tbit_app_ftp, tbit_app_bgp, }; scamper_option_out_t *opts_out = NULL, *opt; scamper_tbit_t *tbit = NULL; tbit_options_t o; uint8_t type = SCAMPER_TBIT_TYPE_NULL; uint8_t wscale = 0; uint8_t ttl = 255; uint32_t userid = 0; char *addr; long tmp = 0; int i; memset(&o, 0, sizeof(o)); /* Parse the options */ if(scamper_options_parse(str, opts, opts_cnt, &opts_out, &addr) != 0) { scamper_debug(__func__, "could not parse options"); goto err; } /* If there is no IP address after the options string, then stop now */ if(addr == NULL) { scamper_debug(__func__, "no address parameter"); goto err; } /* Parse the options, do preliminary sanity checks */ for(opt = opts_out; opt != NULL; opt = opt->next) { if(opt->type != SCAMPER_OPTION_TYPE_NULL && tbit_arg_param_validate(opt->id, opt->str, &tmp) != 0) { scamper_debug(__func__, "validation of optid %d failed", opt->id); goto err; } switch(opt->id) { case TBIT_OPT_TYPE: type = (uint8_t)tmp; break; case TBIT_OPT_APP: o.app = (uint8_t)tmp; break; case TBIT_OPT_DPORT: o.dport = (uint16_t)tmp; break; case TBIT_OPT_SPORT: o.sport = (uint16_t)tmp; break; case TBIT_OPT_MSS: o.mss = (uint16_t)tmp; break; case TBIT_OPT_MTU: o.mtu = (uint16_t)tmp; break; case TBIT_OPT_SRCADDR: o.src = opt->str; break; case TBIT_OPT_URL: o.url = opt->str; break; case TBIT_OPT_USERID: userid = (uint32_t)tmp; break; case TBIT_OPT_PTBSRC: o.ptbsrc = opt->str; break; case TBIT_OPT_FO: for(i=0; istr[i*2], opt->str[(i*2)+1]); o.fo_cookielen = (uint8_t)tmp; break; case TBIT_OPT_WSCALE: wscale = (uint8_t)tmp; break; case TBIT_OPT_ATTEMPTS: o.attempts = (uint8_t)tmp; break; case TBIT_OPT_OFFSET: o.offset = (int32_t)tmp; break; case TBIT_OPT_ASN: o.asn = (uint16_t)tmp; break; case TBIT_OPT_TTL: ttl = (uint8_t)tmp; break; case TBIT_OPT_OPTION: if(strcasecmp(opt->str, "blackhole") == 0) o.options |= TBIT_OPT_OPTION_BLACKHOLE; else if(strcasecmp(opt->str, "tcpts") == 0) o.options |= TBIT_OPT_OPTION_TCPTS; else if(strcasecmp(opt->str, "ipts-syn") == 0) o.options |= TBIT_OPT_OPTION_IPTS_SYN; else if(strcasecmp(opt->str, "iprr-syn") == 0) o.options |= TBIT_OPT_OPTION_IPRR_SYN; else if(strcasecmp(opt->str, "ipqs-syn") == 0) o.options |= TBIT_OPT_OPTION_IPQS_SYN; else if(strcasecmp(opt->str, "sack") == 0) o.options |= TBIT_OPT_OPTION_SACK; else if(strcasecmp(opt->str, "fo") == 0) o.options |= TBIT_OPT_OPTION_FO; else if(strcasecmp(opt->str, "fo-exp") == 0) o.options |= TBIT_OPT_OPTION_FO_EXP; else goto err; break; } } scamper_options_free(opts_out); opts_out = NULL; if(type == SCAMPER_TBIT_TYPE_SACK_RCVR) { if(o.dat_retx != 0 && o.dat_retx != 1) goto err; if(o.dat_retx == 0) o.dat_retx = 1; } if((tbit = scamper_tbit_alloc()) == NULL) { printerror(__func__, "could not alloc tbit"); goto err; } if((tbit->dst = scamper_addrcache_resolve(addrcache,AF_UNSPEC,addr)) == NULL) { printerror(__func__, "could not resolve %s", addr); goto err; } tbit->type = type; tbit->userid = userid; tbit->wscale = wscale; tbit->ttl = ttl; tbit->client_mss = o.mss; tbit->dport = o.dport; tbit->sport = (o.sport != 0) ? o.sport : scamper_sport_default(); tbit->syn_retx = (o.syn_retx != 0) ? o.syn_retx : TBIT_RETX_DEFAULT; tbit->dat_retx = (o.dat_retx != 0) ? o.dat_retx : TBIT_RETX_DEFAULT; if(o.src != NULL) { i = scamper_addr_af(tbit->dst); if(i != AF_INET && i != AF_INET6) goto err; if((tbit->src = scamper_addrcache_resolve(addrcache, i, o.src)) == NULL) goto err; } if(o.app == 0) o.app = SCAMPER_TBIT_APP_HTTP; tbit->app_proto = o.app; if(app_func[o.app] != NULL && app_func[o.app](tbit, &o) != 0) goto err; if(type_func[type] != NULL && type_func[type](tbit, &o) != 0) goto err; return tbit; err: if(tbit != NULL) scamper_tbit_free(tbit); if(opts_out != NULL) scamper_options_free(opts_out); return NULL; } void scamper_do_tbit_free(void *data) { scamper_tbit_t *tbit = (scamper_tbit_t *)data; scamper_tbit_free(tbit); return; } scamper_task_t *scamper_do_tbit_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle) { scamper_tbit_t *tbit = (scamper_tbit_t *)data; scamper_task_sig_t *sig = NULL; scamper_task_t *task = NULL; /* allocate a task structure and store the tbit with it */ if((task = scamper_task_alloc(data, &tbit_funcs)) == NULL) goto err; /* declare the signature of the tbit task */ if((sig = scamper_task_sig_alloc(SCAMPER_TASK_SIG_TYPE_TX_IP)) == NULL) goto err; sig->sig_tx_ip_dst = scamper_addr_use(tbit->dst); if(tbit->src == NULL && (tbit->src = scamper_getsrc(tbit->dst,0)) == NULL) goto err; sig->sig_tx_ip_src = scamper_addr_use(tbit->src); if(scamper_task_sig_add(task, sig) != 0) goto err; sig = NULL; /* associate the list and cycle with the tbit */ tbit->list = scamper_list_use(list); tbit->cycle = scamper_cycle_use(cycle); return task; err: if(sig != NULL) scamper_task_sig_free(sig); if(task != NULL) { scamper_task_setdatanull(task); scamper_task_free(task); } return NULL; } void scamper_do_tbit_cleanup(void) { #if defined(HAVE_OPENSSL) if(ssl_ctx != NULL) { SSL_CTX_free(ssl_ctx); ssl_ctx = NULL; } #endif return; } int scamper_do_tbit_init(void) { #if defined(HAVE_OPENSSL) if(scamper_option_notls() == 0) { if((ssl_ctx = SSL_CTX_new(SSLv23_client_method())) == NULL) return -1; SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_NONE, NULL); } #endif tbit_funcs.probe = do_tbit_probe; tbit_funcs.handle_icmp = NULL; tbit_funcs.handle_dl = do_tbit_handle_dl; tbit_funcs.handle_timeout = do_tbit_handle_timeout; tbit_funcs.write = do_tbit_write; tbit_funcs.task_free = do_tbit_free; tbit_funcs.halt = do_tbit_halt; return 0; } scamper-cvs-20171204/scamper/tbit/scamper_tbit_do.h000644 001751 000000 00000003044 11460723737 022031 0ustar00mjlwheel000000 000000 /* * scamper_do_tbit.h * * $Id: scamper_tbit_do.h,v 1.2 2010/10/24 03:28:31 mjl Exp $ * * Copyright (C) 2009-2010 Ben Stasiewicz * * This file implements algorithms described in the tbit-1.0 source code, * as well as the papers: * * "On Inferring TCP Behaviour" * by Jitendra Padhye and Sally Floyd * "Measuring the Evolution of Transport Protocols in the Internet" by * by Alberto Medina, Mark Allman, and Sally Floyd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DO_TBIT_H #define __SCAMPER_DO_TBIT_H const char *scamper_do_tbit_usage(void); void *scamper_do_tbit_alloc(char *str); void scamper_do_tbit_free(void *data); scamper_task_t *scamper_do_tbit_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle); int scamper_do_tbit_arg_validate(int argc, char *argv[], int *stop); void scamper_do_tbit_cleanup(void); int scamper_do_tbit_init(void); #endif /*__SCAMPER_DO_TBIT_H */ scamper-cvs-20171204/scamper/tbit/scamper_tbit_json.c000644 001751 000000 00000036103 13162602312 022357 0ustar00mjlwheel000000 000000 /* * scamper_tbit_json.c * * Copyright (c) 2014 Matthew Luckie * Copyright (C) 2015 The Regents of the University of California * * Author: Matthew Luckie * * $Id: scamper_tbit_json.c,v 1.25 2017/09/27 01:54:18 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_tbit_json.c,v 1.25 2017/09/27 01:54:18 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_tbit.h" #include "scamper_file.h" #include "scamper_file_json.h" #include "scamper_tbit_json.h" #include "utils.h" typedef struct tbit_state { uint8_t flags; uint32_t client_isn; uint32_t server_isn; } tbit_state_t; #define TBIT_STATE_FLAG_CISN 0x01 #define TBIT_STATE_FLAG_SISN 0x02 static char *tbit_bits_encode(char *buf, size_t len, uint32_t flags, int bits, const char **f2s, int f2sc) { size_t off = 0; int i, f = 0; uint32_t u32; if(flags == 0) return ""; for(i=0; i 0) string_concat(buf, len, &off, ","); if(i < f2sc) string_concat(buf, len, &off, "\"%s\"", f2s[i]); else string_concat(buf, len, &off, "%u", u32); f++; } return buf; } static uint32_t tbit_isnoff(uint32_t isn, uint32_t seq) { if(seq >= isn) return seq - isn; return TCP_MAX_SEQNUM - isn + seq + 1; } static char *tbit_header_tostr(const scamper_tbit_t *tbit, const tbit_state_t *state) { static const char *tbit_options[] = {"tcpts", "sack"}; static const char *pmtud_options[] = {"blackhole"}; static const char *null_options[] = {"tcpts", "ipts-syn", "iprr-syn", "ipqs-syn", "sack", "fo", "fo-exp"}; static const char *null_results[] = {"tcpts-ok", "sack-ok", "fo-ok"}; char buf[1024], tmp[128], *str; size_t off = 0; scamper_tbit_pmtud_t *pmtud; scamper_tbit_null_t *null; scamper_tbit_blind_t *blind; scamper_tbit_app_http_t *http; scamper_tbit_app_bgp_t *bgp; uint32_t u32; uint8_t u8; string_concat(buf, sizeof(buf), &off, "{\"type\":\"tbit\", \"tbit_type\":\"%s\", \"userid\":%u", scamper_tbit_type2str(tbit, tmp, sizeof(tmp)), tbit->userid); string_concat(buf, sizeof(buf), &off, ", \"src\":\"%s\"", scamper_addr_tostr(tbit->src, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"dst\":\"%s\"", scamper_addr_tostr(tbit->dst, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"sport\":%u, \"dport\":%u", tbit->sport, tbit->dport); string_concat(buf, sizeof(buf), &off, ", \"start\":{\"sec\":%u,\"usec\":%u}", tbit->start.tv_sec, tbit->start.tv_usec); string_concat(buf, sizeof(buf), &off, ", \"client_mss\":%u, \"server_mss\":%u, \"ttl\":%u", tbit->client_mss, tbit->server_mss, tbit->ttl); string_concat(buf, sizeof(buf), &off, ", \"result\":\"%s\"", scamper_tbit_res2str(tbit, tmp, sizeof(tmp))); if(tbit->options != 0) string_concat(buf, sizeof(buf), &off, ", \"options\":[%s]", tbit_bits_encode(tmp, sizeof(tmp), tbit->options, 16, tbit_options, sizeof(tbit_options) / sizeof(char *))); if(tbit->wscale > 0) string_concat(buf, sizeof(buf), &off, ", \"wscale\":%u", tbit->wscale); if(tbit->fo_cookielen > 0) { string_concat(buf, sizeof(buf), &off, ", \"fo_cookie\":\""); for(u8=0; u8fo_cookielen; u8++) string_concat(buf, sizeof(buf), &off, "%02x", tbit->fo_cookie[u8]); string_concat(buf, sizeof(buf), &off, "\""); } if(state->flags & TBIT_STATE_FLAG_CISN) string_concat(buf, sizeof(buf), &off, ", \"client_isn\":%u", state->client_isn); if(state->flags & TBIT_STATE_FLAG_SISN) string_concat(buf, sizeof(buf), &off, ", \"server_isn\":%u", state->server_isn); if(tbit->type == SCAMPER_TBIT_TYPE_PMTUD) { pmtud = tbit->data; string_concat(buf, sizeof(buf), &off, ", \"mtu\":%u, \"ptb_retx\":%u", pmtud->mtu, pmtud->ptb_retx); if(pmtud->ptbsrc != NULL) string_concat(buf, sizeof(buf), &off, ", \"ptbsrc\":\"%s\"", scamper_addr_tostr(pmtud->ptbsrc, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"pmtud_options\":[%s]", tbit_bits_encode(tmp, sizeof(tmp), pmtud->options, 8, pmtud_options, sizeof(pmtud_options) / sizeof(char *))); } else if(tbit->type == SCAMPER_TBIT_TYPE_NULL) { null = tbit->data; string_concat(buf, sizeof(buf), &off, ", \"null_options\":[%s]", tbit_bits_encode(tmp, sizeof(tmp), null->options, 16, null_options, sizeof(null_options) / sizeof(char *))); string_concat(buf, sizeof(buf), &off, ", \"null_results\":[%s]", tbit_bits_encode(tmp, sizeof(tmp), null->results, 16, null_results, sizeof(null_results) / sizeof(char *))); } else if(tbit->type == SCAMPER_TBIT_TYPE_ICW) { if(tbit->result == SCAMPER_TBIT_RESULT_ICW_SUCCESS && scamper_tbit_icw_size(tbit, &u32) == 0) string_concat(buf, sizeof(buf), &off, ", \"icw_bytes\":%u", u32); } else if(tbit->type == SCAMPER_TBIT_TYPE_BLIND_RST || tbit->type == SCAMPER_TBIT_TYPE_BLIND_SYN || tbit->type == SCAMPER_TBIT_TYPE_BLIND_DATA || tbit->type == SCAMPER_TBIT_TYPE_BLIND_FIN) { blind = tbit->data; string_concat(buf, sizeof(buf), &off, ", \"blind_off\":%d, \"blind_retx\":%u", blind->off, blind->retx); } if(tbit->app_proto == SCAMPER_TBIT_APP_HTTP && tbit->app_data != NULL) { http = tbit->app_data; string_concat(buf, sizeof(buf), &off, ", \"app\":\"http\""); if(http->type == SCAMPER_TBIT_APP_HTTP_TYPE_HTTPS) str = "https"; else str = "http"; if(http->host != NULL && http->file != NULL) string_concat(buf, sizeof(buf), &off, ", \"http_url\":\"%s://%s%s\"", str, http->host, http->file); else if(http->host != NULL) string_concat(buf, sizeof(buf), &off, ", \"http_url\":\"%s://%s\"", str, http->host); } else if(tbit->app_proto == SCAMPER_TBIT_APP_BGP && tbit->app_data != NULL) { bgp = tbit->app_data; string_concat(buf, sizeof(buf), &off, ", \"app\":\"bgp\", \"bgp_asn\":%u", bgp->asn); } return strdup(buf); } static char *tbit_pkt_tostr(const scamper_tbit_t *tbit, const scamper_tbit_pkt_t *pkt, tbit_state_t *state) { static const char *tcpflags_str[] = {"fin", "syn", "rst", "psh", "ack", "urg", "ece", "cwr"}; struct timeval tv; char buf[1024], tmp[128]; size_t off = 0; int frag = 0; uint32_t frag_off = 0, frag_id = 0; uint8_t frag_mf = 0; uint8_t u8, proto, tcpoptc, tcpflags, iphlen, tcphlen, v, ecn, ttl, *pp; uint16_t u16, len, win; uint32_t u32, seq, ack; if(pkt->dir == SCAMPER_TBIT_PKT_DIR_TX) snprintf(tmp, sizeof(tmp), "\"tx\""); else if(pkt->dir == SCAMPER_TBIT_PKT_DIR_RX) snprintf(tmp, sizeof(tmp), "\"rx\""); else snprintf(tmp, sizeof(tmp), "%u", pkt->dir); timeval_diff_tv(&tv, &tbit->start, &pkt->tv); string_concat(buf, sizeof(buf), &off, "{\"dir\":%s, \"tv_sec\":%u, \"tv_usec\":%u, \"len\":%u", tmp, tv.tv_sec, tv.tv_usec, pkt->len); v = (pkt->data[0] >> 4); if(v == 4) { iphlen = (pkt->data[0] & 0xf) * 4; len = bytes_ntohs(pkt->data+2); proto = pkt->data[9]; ecn = pkt->data[1] & 0x3; ttl = pkt->data[8]; if(pkt->data[6] & 0x20) frag_mf = 1; frag_id = bytes_ntohs(pkt->data+4); frag_off = (bytes_ntohs(pkt->data+6) & 0x1fff) * 8; if(frag_mf != 0 || frag_off != 0) frag = 1; } else if(v == 6) { iphlen = 40; len = bytes_ntohs(pkt->data+4) + iphlen; proto = pkt->data[6]; ecn = (pkt->data[1] & 0x30) >> 4; ttl = pkt->data[7]; for(;;) { switch(proto) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: case IPPROTO_ROUTING: proto = pkt->data[iphlen+0]; iphlen += (pkt->data[iphlen+1] * 8) + 8; continue; case IPPROTO_FRAGMENT: if(pkt->data[iphlen+3] & 0x1) frag_mf = 1; frag_off = (bytes_ntohs(pkt->data+iphlen+2) & 0xfff8); frag_id = bytes_ntohl(pkt->data+iphlen+4); proto = pkt->data[iphlen+0]; iphlen += 8; frag = 1; continue; } break; } } else goto done; /* not v4 or v6 */ string_concat(buf, sizeof(buf), &off, ", \"ip_hlen\":%u, \"ip_ecn\":%u, \"ip_ttl\":%u", iphlen, ecn, ttl); if(v == 4 || (v == 6 && frag != 0)) string_concat(buf, sizeof(buf), &off, ", \"frag_id\":%u, \"frag_off\":%u, \"frag_mf\":%u", frag_id, frag_off, frag_mf); if(v == 4) string_concat(buf, sizeof(buf), &off, ", \"frag_df\":%u", (pkt->data[6] & 0x40) >> 7); if(frag_off != 0) goto done; if(proto == IPPROTO_TCP) { seq = bytes_ntohl(pkt->data+iphlen+4); ack = bytes_ntohl(pkt->data+iphlen+8); win = bytes_ntohs(pkt->data+iphlen+14); tcpflags = pkt->data[iphlen+13]; tcphlen = ((pkt->data[iphlen+12] & 0xf0) >> 4) * 4; if((tcpflags & (TH_SYN|TH_ACK)) == TH_SYN && (state->flags & TBIT_STATE_FLAG_CISN) == 0) { state->client_isn = seq; state->flags |= TBIT_STATE_FLAG_CISN; } else if((tcpflags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK) && (state->flags & TBIT_STATE_FLAG_SISN) == 0) { state->server_isn = seq; state->flags |= TBIT_STATE_FLAG_SISN; } string_concat(buf, sizeof(buf), &off, ", \"tcp_hlen\": %u, \"tcp_flags\":[%s]", tcphlen, tbit_bits_encode(tmp, sizeof(tmp), tcpflags, 8, tcpflags_str, sizeof(tcpflags_str) / sizeof(char *))); /* parse TCP header for options */ string_concat(buf, sizeof(buf), &off, ", \"tcp_options\":["); u8 = 20; tcpoptc = 0; while(u8 < tcphlen) { pp = pkt->data + iphlen + u8; if(pp[0] == 0) { string_concat(buf, sizeof(buf), &off, "%s{\"kind\":\"eol\"}", tcpoptc > 0 ? ", " : ""); break; } if(pp[0] == 1) { string_concat(buf, sizeof(buf), &off, "%s{\"kind\":\"nop\"}", tcpoptc > 0 ? ", " : ""); tcpoptc++; u8++; continue; } if(pp[1] == 0 || u8 + pp[1] > tcphlen) break; if(pp[0] == 3 && pp[1] == 3) { string_concat(buf, sizeof(buf), &off, "%s{\"kind\":\"wscale\", \"shift\":%u}", tcpoptc > 0 ? ", " : "", pp[2]); tcpoptc++; } if(pp[0] == 4 && pp[1] == 2) { string_concat(buf, sizeof(buf), &off, "%s{\"kind\":\"sack-ok\"}", tcpoptc > 0 ? ", " : ""); tcpoptc++; } if(pp[0] == 5 && (pp[1]==10 || pp[1]==18 || pp[1]==26 || pp[1]==34)) { if(pkt->dir == SCAMPER_TBIT_PKT_DIR_TX) u32 = state->server_isn; else u32 = state->client_isn; string_concat(buf, sizeof(buf), &off, "%s{\"kind\":\"sack\", \"blocks\":[", tcpoptc > 0 ? ", " : ""); for(u16=0; u16<(pp[1]-2)/8; u16++) string_concat(buf, sizeof(buf), &off, "%s{\"left\":%u, \"right\":%u}", u16 != 0 ? ", " : "", bytes_ntohl(pp+2+(u16*8)) - u32, bytes_ntohl(pp+2+(u16*8)+4) - u32); string_concat(buf, sizeof(buf), &off, "]}"); tcpoptc++; } if(pp[0] == 8 && pp[1] == 10) { string_concat(buf, sizeof(buf), &off, "%s{\"kind\":\"ts\", \"val\":%u, \"ecr\":%u}", tcpoptc > 0 ? ", " : "", bytes_ntohl(pp+2), bytes_ntohl(pp+6)); tcpoptc++; } if(pp[0] == 34 && pp[1] >= 2) { string_concat(buf, sizeof(buf), &off, "%s{\"kind\":\"fo\"", tcpoptc > 0 ? ", " : ""); if(pp[1] > 2) { string_concat(buf, sizeof(buf), &off, ", \"cookie\":\""); for(u16=0; u16= 4 && pp[2] == 0xF9 && pp[3] == 0x89) { string_concat(buf, sizeof(buf), &off, "%s{\"kind\":\"fo-exp\"", tcpoptc > 0 ? ", " : ""); if(pp[1] > 4) { string_concat(buf, sizeof(buf), &off, ", \"cookie\":\""); for(u16=0; u16dir == SCAMPER_TBIT_PKT_DIR_TX) { seq = tbit_isnoff(state->client_isn, seq); ack = tbit_isnoff(state->server_isn, ack); } else { if(!(seq == 0 && (tcpflags & TH_RST) != 0)) seq = tbit_isnoff(state->server_isn, seq); ack = tbit_isnoff(state->client_isn, ack); } string_concat(buf, sizeof(buf), &off, ", \"tcp_seq\":%u", seq); if(tcpflags & TH_ACK) string_concat(buf, sizeof(buf), &off, ", \"tcp_ack\":%u", ack); string_concat(buf, sizeof(buf), &off, ", \"tcp_datalen\":%u", len - iphlen - tcphlen); string_concat(buf, sizeof(buf), &off, ", \"tcp_win\":%u", win); } done: string_concat(buf, sizeof(buf), &off, "}"); return strdup(buf); } int scamper_file_json_tbit_write(const scamper_file_t *sf, const scamper_tbit_t *tbit) { tbit_state_t state; char *str = NULL, *header = NULL, **pkts = NULL; size_t header_len = 0, len = 0, wc = 0, *pkt_lens = NULL; int rc = -1; uint32_t i; memset(&state, 0, sizeof(state)); /* put together packet strings, done first to get state for header string */ len += 11; /* , "pkts":[] */ if(tbit->pktc > 0 && ((pkts = malloc_zero(sizeof(char *) * tbit->pktc)) == NULL || ((pkt_lens = malloc_zero(sizeof(size_t) * tbit->pktc)) == NULL))) goto cleanup; for(i=0; ipktc; i++) { if(i > 0) len += 2; /* , */ if((pkts[i] = tbit_pkt_tostr(tbit, tbit->pkts[i], &state)) == NULL) goto cleanup; pkt_lens[i] = strlen(pkts[i]); len += pkt_lens[i]; } /* get the header string */ if((header = tbit_header_tostr(tbit, &state)) == NULL) goto cleanup; len += (header_len = strlen(header)); len += 2; /* }\n" */ if((str = malloc_zero(len)) == NULL) goto cleanup; memcpy(str+wc, header, header_len); wc += header_len; memcpy(str+wc, ", \"pkts\":[", 10); wc += 10; for(i=0; ipktc; i++) { if(i > 0) { memcpy(str+wc, ", ", 2); wc += 2; } memcpy(str+wc, pkts[i], pkt_lens[i]); wc += pkt_lens[i]; } memcpy(str+wc, "]}\n", 3); wc += 3; assert(wc == len); rc = json_write(sf, str, len); cleanup: if(str != NULL) free(str); if(header != NULL) free(header); if(pkt_lens != NULL) free(pkt_lens); if(pkts != NULL) { for(i=0; ipktc; i++) if(pkts[i] != NULL) free(pkts[i]); free(pkts); } return rc; } scamper-cvs-20171204/scamper/tbit/scamper_tbit_json.h000644 001751 000000 00000001700 12411143211 022351 0ustar00mjlwheel000000 000000 /* * scamper_tbit_json.h * * $Id: scamper_tbit_json.h,v 1.1 2014/09/26 01:51:05 mjl Exp $ * * Copyright (c) 2014 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_TBIT_JSON_H #define __SCAMPER_TBIT_JSON_H int scamper_file_json_tbit_write(const scamper_file_t *sf, const struct scamper_tbit *tbit); #endif scamper-cvs-20171204/scamper/tbit/scamper_tbit_text.c000644 001751 000000 00000017465 12767200555 022421 0ustar00mjlwheel000000 000000 /* * scamper_file_text_tbit.c * * Copyright (C) 2009-2011 The University of Waikato * Authors: Ben Stasiewicz, Matthew Luckie * * $Id: scamper_tbit_text.c,v 1.16 2016/09/17 08:40:13 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_file.h" #include "scamper_tbit.h" #include "scamper_tbit_text.h" #include "utils.h" static uint32_t tbit_isnoff(uint32_t isn, uint32_t seq) { if(seq >= isn) return seq - isn; return TCP_MAX_SEQNUM - isn + seq + 1; } int scamper_file_text_tbit_write(const scamper_file_t *sf, const scamper_tbit_t *tbit) { scamper_tbit_pkt_t *pkt; scamper_tbit_app_http_t *http; char buf[131072], *str; char src[64], dst[64], tmp[256], ipid[12], fstr[32], tfstr[32], sack[128]; struct timeval diff; uint32_t i; uint32_t seq, ack, server_isn, client_isn, off, u32; uint16_t len, u16, datalen; uint8_t proto, flags, iphlen, tcphlen, mf, ecn, u8, *ptr; size_t soff = 0, toff; int frag; int fd = scamper_file_getfd(sf); string_concat(buf, sizeof(buf), &soff, "tbit from %s to %s\n server-mss %d, result: %s\n", scamper_addr_tostr(tbit->src, src, sizeof(src)), scamper_addr_tostr(tbit->dst, dst, sizeof(dst)), tbit->server_mss, scamper_tbit_res2str(tbit, tmp, sizeof(tmp))); if(tbit->app_proto == SCAMPER_TBIT_APP_HTTP && tbit->app_data != NULL) { http = tbit->app_data; string_concat(buf, sizeof(buf), &soff, " app: http"); if(http->type == SCAMPER_TBIT_APP_HTTP_TYPE_HTTPS) str = "https"; else str = "http"; if(http->host != NULL && http->file != NULL) string_concat(buf, sizeof(buf), &soff, ", url: %s://%s%s", str, http->host, http->file); else if(http->host != NULL) string_concat(buf, sizeof(buf), &soff, ", url: %s://%s", str, http->host); else string_concat(buf, sizeof(buf), &soff, ", file: %s", http->file); string_concat(buf, sizeof(buf), &soff, "\n"); } client_isn = 0; server_isn = 0; for(i=0; ipktc; i++) { pkt = tbit->pkts[i]; frag = 0; mf = 0; off = 0; ipid[0] = '\0'; if((pkt->data[0] >> 4) == 4) { iphlen = (pkt->data[0] & 0xf) * 4; len = bytes_ntohs(pkt->data+2); proto = pkt->data[9]; ecn = pkt->data[1] & 0x3; if(pkt->data[6] & 0x20) mf = 1; snprintf(ipid, sizeof(ipid), " %04x", bytes_ntohs(pkt->data+4)); off = (bytes_ntohs(pkt->data+6) & 0x1fff) * 8; if(mf != 0 || off != 0) frag = 1; } else if((pkt->data[0] >> 4) == 6) { iphlen = 40; len = bytes_ntohs(pkt->data+4) + iphlen; proto = pkt->data[6]; ecn = (pkt->data[1] & 0x30) >> 4; for(;;) { switch(proto) { case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: case IPPROTO_ROUTING: proto = pkt->data[iphlen+0]; iphlen += (pkt->data[iphlen+1] * 8) + 8; continue; case IPPROTO_FRAGMENT: if(pkt->data[iphlen+3] & 0x1) mf = 1; snprintf(ipid, sizeof(ipid), "%x", bytes_ntohl(pkt->data+iphlen+4)); off = (bytes_ntohs(pkt->data+iphlen+2) & 0xfff8); proto = pkt->data[iphlen+0]; iphlen += 8; frag = 1; continue; } break; } } else { continue; } timeval_diff_tv(&diff, &tbit->start, &pkt->tv); string_concat(buf, sizeof(buf), &soff, " [%3d.%03d] %s ", (int)diff.tv_sec, (int)(diff.tv_usec / 1000), pkt->dir == SCAMPER_TBIT_PKT_DIR_TX ? "TX" : "RX"); if(frag != 0) snprintf(fstr,sizeof(fstr),":%u%s", off, mf != 0 ? " MF" : ""); else fstr[0] = '\0'; if(off != 0) { string_concat(buf, sizeof(buf), &soff, "%-13s %4dF%22s %s%s", "", len, "", ipid, fstr); } else if(proto == IPPROTO_TCP) { seq = bytes_ntohl(pkt->data+iphlen+4); ack = bytes_ntohl(pkt->data+iphlen+8); flags = pkt->data[iphlen+13]; tcphlen = ((pkt->data[iphlen+12] & 0xf0) >> 4) * 4; toff = 0; tfstr[0] = '\0'; if(flags & 0x2) { if(flags & 0x10) { server_isn = seq; string_concat(tfstr, sizeof(tfstr), &toff, "SYN/ACK"); } else { client_isn = seq; string_concat(tfstr, sizeof(tfstr), &toff, "SYN"); } } else if(flags & 0x1) string_concat(tfstr, sizeof(tfstr), &toff, "FIN"); else if(flags & 0x4) string_concat(tfstr, sizeof(tfstr), &toff, "RST"); if(flags & 0x40) string_concat(tfstr, sizeof(tfstr), &toff, "%sECE", toff != 0 ? "/" : ""); if(flags & 0x80) string_concat(tfstr, sizeof(tfstr), &toff, "%sCWR", toff != 0 ? "/" : ""); /* parse TCP options for sack blocks */ u8 = 20; toff = 0; sack[0] = '\0'; while(u8 < tcphlen) { ptr = pkt->data + iphlen + u8; if(ptr[0] == 0) /* end of option list */ break; if(ptr[0] == 1) /* nop */ { u8++; continue; } if(ptr[1] == 0 || u8 + ptr[1] > tcphlen) break; /* sack edges */ if(ptr[0] == 5 && (ptr[1]==10 || ptr[1]==18 || ptr[1]==26 || ptr[1]==34)) { if(pkt->dir == SCAMPER_TBIT_PKT_DIR_TX) u32 = server_isn; else u32 = client_isn; string_concat(sack, sizeof(sack), &toff, " {"); for(u16=0; u16<(ptr[1]-2)/8; u16++) string_concat(sack, sizeof(sack), &toff, "%s%u:%u", u16 != 0 ? "," : "", bytes_ntohl(ptr+2+(u16*8)) - u32, bytes_ntohl(ptr+2+(u16*8)+4) - u32); string_concat(sack, sizeof(sack), &toff, "}"); } u8 += ptr[1]; } if(pkt->dir == SCAMPER_TBIT_PKT_DIR_TX) { seq = tbit_isnoff(client_isn, seq); ack = tbit_isnoff(server_isn, ack); } else { seq = tbit_isnoff(server_isn, seq); ack = tbit_isnoff(client_isn, ack); } datalen = len - iphlen - tcphlen; string_concat(buf, sizeof(buf), &soff, "%-13s %4d%s", tfstr, len, frag != 0 ? "F" : " "); toff = 0; string_concat(tmp, sizeof(tmp), &toff, " seq = %u:%u", seq, ack); if(datalen != 0) string_concat(tmp, sizeof(tmp), &toff, "(%d)", datalen); string_concat(tmp, sizeof(tmp), &toff, sack); string_concat(buf, sizeof(buf), &soff, "%-23s%s", tmp, ipid); if(frag != 0) string_concat(buf, sizeof(buf), &soff, "%s", fstr); if(datalen > 0 && (pkt->data[0] >> 4) == 4 && pkt->data[6] & 0x40) string_concat(buf, sizeof(buf), &soff, " DF"); if(ecn == 3) string_concat(buf, sizeof(buf), &soff, " CE"); else if(ecn != 0) string_concat(buf, sizeof(buf), &soff, " ECT"); } else if(proto == IPPROTO_ICMP) { if(pkt->data[iphlen+0] == 3 && pkt->data[iphlen+1] == 4) { u16 = bytes_ntohs(pkt->data+iphlen+6); string_concat(buf, sizeof(buf), &soff, "%-13s %4d mtu = %d", "PTB", len, u16); } } else if(proto == IPPROTO_ICMPV6) { if(pkt->data[iphlen+0] == 2) { u32 = bytes_ntohl(pkt->data+iphlen+4); string_concat(buf, sizeof(buf), &soff, "%-13s %4d mtu = %d", "PTB", len, u32); } } string_concat(buf, sizeof(buf), &soff, "\n"); } write_wrap(fd, buf, NULL, soff); return 0; } scamper-cvs-20171204/scamper/tbit/scamper_tbit_text.h000644 001751 000000 00000002464 11452510530 022402 0ustar00mjlwheel000000 000000 /* * scamper_file_text_tbit.h * * Copyright (C) 2009-2010 Ben Stasiewicz * Copyright (C) 2010 University of Waikato * * $Id: scamper_tbit_text.h,v 1.1 2010/10/05 02:45:44 mjl Exp $ * * This file implements algorithms described in the tbit-1.0 source code, * as well as the papers: * * "On Inferring TCP Behaviour" * by Jitendra Padhye and Sally Floyd * "Measuring the Evolution of Transport Protocols in the Internet" by * by Alberto Medina, Mark Allman, and Sally Floyd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the replye that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_FILE_TEXT_TBIT_H #define __SCAMPER_FILE_TEXT_TBIT_H int scamper_file_text_tbit_write(const scamper_file_t *sf, const scamper_tbit_t *tbit); #endif scamper-cvs-20171204/scamper/tbit/scamper_tbit_warts.c000644 001751 000000 00000106163 13162602312 022552 0ustar00mjlwheel000000 000000 /* * scamper_tbit_warts.c * * Copyright (C) 2009-2010 Ben Stasiewicz * Copyright (C) 2010-2011 The University of Waikato * Copyright (C) 2012-2015 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Authors: Matthew Luckie, Ben Stasiewicz * * $Id: scamper_tbit_warts.c,v 1.28 2017/09/27 01:54:18 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_tbit_warts.c,v 1.28 2017/09/27 01:54:18 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_tbit.h" #include "scamper_file.h" #include "scamper_file_warts.h" #include "scamper_tbit_warts.h" #include "utils.h" /* * tbit structures conditionally included. * the first 2 bytes are the type, the second 2 bytes are the length */ #define WARTS_TBIT_STRUCT_EOF 0x0000 #define WARTS_TBIT_STRUCT_TYPE 0x0001 #define WARTS_TBIT_STRUCT_APP 0x0002 #define WARTS_TBIT_LIST 1 #define WARTS_TBIT_CYCLE 2 #define WARTS_TBIT_USERID 3 #define WARTS_TBIT_SRC 4 #define WARTS_TBIT_DST 5 #define WARTS_TBIT_SPORT 6 #define WARTS_TBIT_DPORT 7 #define WARTS_TBIT_START 8 #define WARTS_TBIT_RESULT 9 #define WARTS_TBIT_TYPE 10 #define WARTS_TBIT_APPPROTO 11 #define WARTS_TBIT_CMSS 12 #define WARTS_TBIT_SMSS 13 #define WARTS_TBIT_SYNRETX 14 #define WARTS_TBIT_DATARETX 15 #define WARTS_TBIT_PKTC16 16 #define WARTS_TBIT_PKTC 17 #define WARTS_TBIT_COOKIE 18 #define WARTS_TBIT_WSCALE 19 #define WARTS_TBIT_OPTIONS 20 #define WARTS_TBIT_TTL 21 static const warts_var_t tbit_vars[] = { {WARTS_TBIT_LIST, 4, -1}, {WARTS_TBIT_CYCLE, 4, -1}, {WARTS_TBIT_USERID, 4, -1}, {WARTS_TBIT_SRC, -1, -1}, {WARTS_TBIT_DST, -1, -1}, {WARTS_TBIT_SPORT, 2, -1}, {WARTS_TBIT_DPORT, 2, -1}, {WARTS_TBIT_START, 8, -1}, {WARTS_TBIT_RESULT, 2, -1}, {WARTS_TBIT_TYPE, 1, -1}, {WARTS_TBIT_APPPROTO, 1, -1}, {WARTS_TBIT_CMSS, 2, -1}, {WARTS_TBIT_SMSS, 2, -1}, {WARTS_TBIT_SYNRETX, 1, -1}, {WARTS_TBIT_DATARETX, 1, -1}, {WARTS_TBIT_PKTC16, 2, -1}, {WARTS_TBIT_PKTC, 4, -1}, {WARTS_TBIT_COOKIE, -1, -1}, {WARTS_TBIT_WSCALE, 1, -1}, {WARTS_TBIT_OPTIONS, 4, -1}, {WARTS_TBIT_TTL, 1, -1}, }; #define tbit_vars_mfb WARTS_VAR_MFB(tbit_vars) #define WARTS_TBIT_PKT_DIR 1 #define WARTS_TBIT_PKT_TIME 2 #define WARTS_TBIT_PKT_DATALEN 3 #define WARTS_TBIT_PKT_DATA 4 static const warts_var_t tbit_pkt_vars[] = { {WARTS_TBIT_PKT_DIR, 1, -1}, {WARTS_TBIT_PKT_TIME, 8, -1}, {WARTS_TBIT_PKT_DATALEN, 2, -1}, {WARTS_TBIT_PKT_DATA, -1, -1}, }; #define tbit_pkt_vars_mfb WARTS_VAR_MFB(tbit_pkt_vars) #define WARTS_TBIT_PMTUD_MTU 1 #define WARTS_TBIT_PMTUD_PTBRETX 2 #define WARTS_TBIT_PMTUD_OPTIONS 3 #define WARTS_TBIT_PMTUD_PTBSRC 4 static const warts_var_t tbit_pmtud_vars[] = { {WARTS_TBIT_PMTUD_MTU, 2, -1}, {WARTS_TBIT_PMTUD_PTBRETX, 1, -1}, {WARTS_TBIT_PMTUD_OPTIONS, 1, -1}, {WARTS_TBIT_PMTUD_PTBSRC, -1, -1}, }; #define tbit_pmtud_vars_mfb WARTS_VAR_MFB(tbit_pmtud_vars) #define WARTS_TBIT_NULL_OPTIONS 1 #define WARTS_TBIT_NULL_RESULTS 2 static const warts_var_t tbit_null_vars[] = { {WARTS_TBIT_NULL_OPTIONS, 2, -1}, {WARTS_TBIT_NULL_RESULTS, 2, -1}, }; #define tbit_null_vars_mfb WARTS_VAR_MFB(tbit_null_vars) #define WARTS_TBIT_ICW_FIRSTSEQ 1 static const warts_var_t tbit_icw_vars[] = { {WARTS_TBIT_ICW_FIRSTSEQ, 4, -1}, }; #define tbit_icw_vars_mfb WARTS_VAR_MFB(tbit_icw_vars) #define WARTS_TBIT_BLIND_OFF 1 #define WARTS_TBIT_BLIND_RETX 2 static const warts_var_t tbit_blind_vars[] = { {WARTS_TBIT_BLIND_OFF, 4, -1}, {WARTS_TBIT_BLIND_RETX, 1, -1}, }; #define tbit_blind_vars_mfb WARTS_VAR_MFB(tbit_blind_vars) #define WARTS_TBIT_APP_HTTP_HOST 1 #define WARTS_TBIT_APP_HTTP_FILE 2 #define WARTS_TBIT_APP_HTTP_TYPE 3 static const warts_var_t tbit_app_http_vars[] = { {WARTS_TBIT_APP_HTTP_HOST, -1, -1}, {WARTS_TBIT_APP_HTTP_FILE, -1, -1}, {WARTS_TBIT_APP_HTTP_TYPE, 1, -1}, }; #define tbit_app_http_vars_mfb WARTS_VAR_MFB(tbit_app_http_vars) #define WARTS_TBIT_APP_BGP_ASN 1 static const warts_var_t tbit_app_bgp_vars[] = { {WARTS_TBIT_APP_BGP_ASN, 4, -1}, }; #define tbit_app_bgp_vars_mfb WARTS_VAR_MFB(tbit_app_bgp_vars) typedef struct warts_tbit_pkt { uint8_t flags[tbit_pkt_vars_mfb]; uint16_t flags_len; uint16_t params_len; } warts_tbit_pkt_t; typedef struct warts_tbit_pmtud { uint8_t flags[WARTS_VAR_MFB(tbit_pmtud_vars)]; uint16_t flags_len; uint16_t params_len; uint32_t len; } warts_tbit_pmtud_t; typedef struct warts_tbit_null { uint8_t flags[WARTS_VAR_MFB(tbit_null_vars)]; uint16_t flags_len; uint16_t params_len; uint32_t len; } warts_tbit_null_t; typedef struct warts_tbit_icw { uint8_t flags[WARTS_VAR_MFB(tbit_icw_vars)]; uint16_t flags_len; uint16_t params_len; uint32_t len; } warts_tbit_icw_t; typedef struct warts_tbit_blind { uint8_t flags[WARTS_VAR_MFB(tbit_blind_vars)]; uint16_t flags_len; uint16_t params_len; uint32_t len; } warts_tbit_blind_t; typedef struct warts_tbit_app_http { uint8_t flags[WARTS_VAR_MFB(tbit_app_http_vars)]; uint16_t flags_len; uint16_t params_len; uint32_t len; } warts_tbit_app_http_t; typedef struct warts_tbit_app_bgp { uint8_t flags[WARTS_VAR_MFB(tbit_app_bgp_vars)]; uint16_t flags_len; uint16_t params_len; uint32_t len; } warts_tbit_app_bgp_t; static void warts_tbit_blind_params(const scamper_tbit_t *tbit, warts_tbit_blind_t *state) { scamper_tbit_blind_t *blind = tbit->data; const warts_var_t *var; int i, max_id = 0; /* unset all the flags possible */ memset(state->flags, 0, tbit_blind_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_TBIT_BLIND_OFF && blind->off == 0) || (var->id == WARTS_TBIT_BLIND_RETX && blind->retx == 0)) continue; flag_set(state->flags, var->id, &max_id); assert(var->size >= 0); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); state->len = state->flags_len + state->params_len; if(state->params_len != 0) state->len += 2; return; } static void warts_tbit_icw_params(const scamper_tbit_t *tbit, warts_tbit_icw_t *state) { scamper_tbit_icw_t *icw = tbit->data; const warts_var_t *var; int i, max_id = 0; /* unset all the flags possible */ memset(state->flags, 0, tbit_icw_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_TBIT_ICW_FIRSTSEQ && icw->start_seq == 0) continue; flag_set(state->flags, var->id, &max_id); assert(var->size >= 0); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); state->len = state->flags_len + state->params_len; if(state->params_len != 0) state->len += 2; return; } static void warts_tbit_null_params(const scamper_tbit_t *tbit, warts_tbit_null_t *state) { scamper_tbit_null_t *null = tbit->data; const warts_var_t *var; int i, max_id = 0; /* unset all the flags possible */ memset(state->flags, 0, tbit_null_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_TBIT_NULL_OPTIONS && null->options == 0) continue; if(var->id == WARTS_TBIT_NULL_RESULTS && null->results == 0) continue; flag_set(state->flags, var->id, &max_id); assert(var->size >= 0); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); state->len = state->flags_len + state->params_len; if(state->params_len != 0) state->len += 2; return; } static void warts_tbit_pmtud_params(const scamper_tbit_t *tbit, warts_addrtable_t *table, warts_tbit_pmtud_t *state) { scamper_tbit_pmtud_t *pmtud = tbit->data; const warts_var_t *var; int i, max_id = 0; /* unset all the flags possible */ memset(state->flags, 0, tbit_pmtud_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_TBIT_PMTUD_MTU && pmtud->mtu == 0) continue; if(var->id == WARTS_TBIT_PMTUD_PTBRETX && pmtud->ptb_retx == 0) continue; if(var->id == WARTS_TBIT_PMTUD_OPTIONS && pmtud->options == 0) continue; if(var->id == WARTS_TBIT_PMTUD_PTBSRC && pmtud->ptbsrc == NULL) continue; flag_set(state->flags, var->id, &max_id); if(var->id == WARTS_TBIT_PMTUD_PTBSRC) { state->params_len += warts_addr_size(table, pmtud->ptbsrc); continue; } assert(var->size >= 0); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); state->len = state->flags_len + state->params_len; if(state->params_len != 0) state->len += 2; return; } static int warts_tbit_null_read(scamper_tbit_t *tbit, const uint8_t *buf, uint32_t *off, uint32_t len) { scamper_tbit_null_t *null = tbit->data; uint16_t options = 0; uint16_t results = 0; warts_param_reader_t handlers[] = { {&options, (wpr_t)extract_uint16, NULL}, {&results, (wpr_t)extract_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) goto err; null->options = options; null->results = results; return 0; err: return -1; } static void warts_tbit_null_write(const scamper_tbit_t *tbit, uint8_t *buf, uint32_t *off, uint32_t len, warts_tbit_null_t *state) { scamper_tbit_null_t *null = tbit->data; warts_param_writer_t handlers[] = { {&null->options, (wpw_t)insert_uint16, NULL}, {&null->results, (wpw_t)insert_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static int warts_tbit_pmtud_read(scamper_tbit_t *tbit, warts_addrtable_t *table, const uint8_t *buf, uint32_t *off, uint32_t len) { scamper_tbit_pmtud_t *pmtud = tbit->data; scamper_addr_t *ptbsrc = NULL; uint16_t mtu = 0; uint8_t ptb_retx = 0; uint8_t options = 0; warts_param_reader_t handlers[] = { {&mtu, (wpr_t)extract_uint16, NULL}, {&ptb_retx, (wpr_t)extract_byte, NULL}, {&options, (wpr_t)extract_byte, NULL}, {&ptbsrc, (wpr_t)extract_addr, table}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) goto err; pmtud->mtu = mtu; pmtud->ptb_retx = ptb_retx; pmtud->options = options; pmtud->ptbsrc = ptbsrc; return 0; err: return -1; } static void warts_tbit_pmtud_write(const scamper_tbit_t *tbit, uint8_t *buf, uint32_t *off, uint32_t len, warts_addrtable_t *table, warts_tbit_pmtud_t *state) { scamper_tbit_pmtud_t *pmtud = tbit->data; warts_param_writer_t handlers[] = { {&pmtud->mtu, (wpw_t)insert_uint16, NULL}, {&pmtud->ptb_retx, (wpw_t)insert_byte, NULL}, {&pmtud->options, (wpw_t)insert_byte, NULL}, {pmtud->ptbsrc, (wpw_t)insert_addr, table}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static int warts_tbit_icw_read(scamper_tbit_t *tbit, const uint8_t *buf, uint32_t *off, uint32_t len) { scamper_tbit_icw_t *icw = tbit->data; warts_param_reader_t handlers[] = { {&icw->start_seq, (wpr_t)extract_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); return warts_params_read(buf, off, len, handlers, handler_cnt); } static void warts_tbit_icw_write(const scamper_tbit_t *tbit, uint8_t *buf, uint32_t *off, uint32_t len, warts_tbit_icw_t *state) { scamper_tbit_icw_t *icw = tbit->data; warts_param_writer_t handlers[] = { {&icw->start_seq, (wpw_t)insert_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static int warts_tbit_blind_read(scamper_tbit_t *tbit, const uint8_t *buf, uint32_t *off, uint32_t len) { scamper_tbit_blind_t *blind = tbit->data; warts_param_reader_t handlers[] = { {&blind->off, (wpr_t)extract_int32, NULL}, {&blind->retx, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); return warts_params_read(buf, off, len, handlers, handler_cnt); } static void warts_tbit_blind_write(const scamper_tbit_t *tbit, uint8_t *buf, uint32_t *off, uint32_t len, warts_tbit_blind_t *state) { scamper_tbit_blind_t *blind = tbit->data; warts_param_writer_t handlers[] = { {&blind->off, (wpw_t)insert_int32, NULL}, {&blind->retx, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static void warts_tbit_app_http_params(const scamper_tbit_t *tbit, warts_tbit_app_http_t *state) { scamper_tbit_app_http_t *http = tbit->app_data; const warts_var_t *var; int i, max_id = 0; /* unset all the flags possible */ memset(state->flags, 0, tbit_app_http_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_TBIT_APP_HTTP_HOST && http->host == NULL) continue; if(var->id == WARTS_TBIT_APP_HTTP_FILE && http->file == NULL) continue; if(var->id == WARTS_TBIT_APP_HTTP_TYPE && http->type == 0) continue; flag_set(state->flags, var->id, &max_id); if(var->size < 0) { if(var->id == WARTS_TBIT_APP_HTTP_HOST) state->params_len += warts_str_size(http->host); else if(var->id == WARTS_TBIT_APP_HTTP_FILE) state->params_len += warts_str_size(http->file); continue; } assert(var->size >= 0); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); state->len = state->flags_len + state->params_len; if(state->params_len != 0) state->len += 2; return; } static int warts_tbit_app_http_read(scamper_tbit_t *tbit, const uint8_t *buf, uint32_t *off, uint32_t len) { scamper_tbit_app_http_t *http; char *host = NULL, *file = NULL; uint8_t type = SCAMPER_TBIT_APP_HTTP_TYPE_HTTP; warts_param_reader_t handlers[] = { {&host, (wpr_t)extract_string, NULL}, {&file, (wpr_t)extract_string, NULL}, {&type, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) goto err; if((http = scamper_tbit_app_http_alloc(type, host, file)) == NULL) goto err; if(host != NULL) { free(host); host = NULL; } if(file != NULL) { free(file); file = NULL; } tbit->app_data = http; return 0; err: if(host != NULL) free(host); if(file != NULL) free(file); return -1; } static void warts_tbit_app_http_write(const scamper_tbit_t *tbit, uint8_t *buf, uint32_t *off, uint32_t len, warts_tbit_app_http_t *state) { scamper_tbit_app_http_t *http = tbit->app_data; warts_param_writer_t handlers[] = { {http->host, (wpw_t)insert_string, NULL}, {http->file, (wpw_t)insert_string, NULL}, {&http->type, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static void warts_tbit_app_bgp_params(const scamper_tbit_t *tbit, warts_tbit_app_bgp_t *state) { scamper_tbit_app_bgp_t *bgp = tbit->app_data; const warts_var_t *var; int i, max_id = 0; /* unset all the flags possible */ memset(state->flags, 0, tbit_app_bgp_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_TBIT_APP_BGP_ASN && bgp->asn == 0) continue; flag_set(state->flags, var->id, &max_id); assert(var->size >= 0); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); state->len = state->flags_len + state->params_len; if(state->params_len != 0) state->len += 2; return; } static int warts_tbit_app_bgp_read(scamper_tbit_t *tbit, const uint8_t *buf, uint32_t *off, uint32_t len) { scamper_tbit_app_bgp_t *bgp; uint32_t asn = 0; warts_param_reader_t handlers[] = { {&asn, (wpr_t)extract_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; if((bgp = scamper_tbit_app_bgp_alloc()) == NULL) return -1; bgp->asn = asn; tbit->app_data = bgp; return 0; } static void warts_tbit_app_bgp_write(const scamper_tbit_t *tbit, uint8_t *buf, uint32_t *off, uint32_t len, warts_tbit_app_bgp_t *state) { scamper_tbit_app_bgp_t *bgp = tbit->app_data; warts_param_writer_t handlers[] = { {&bgp->asn, (wpw_t)insert_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static void warts_tbit_pkt_params(const scamper_tbit_pkt_t *pkt, warts_tbit_pkt_t *state, uint32_t *len) { const warts_var_t *var; int max_id = 0; uint16_t i; memset(state->flags, 0, tbit_pkt_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_TBIT_PKT_DATA) { if(pkt->len == 0) continue; state->params_len += pkt->len; flag_set(state->flags, var->id, &max_id); continue; } assert(var->size >= 0); state->params_len += var->size; flag_set(state->flags, var->id, &max_id); } state->flags_len = fold_flags(state->flags, max_id); *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return; } static scamper_tbit_pkt_t *warts_tbit_pkt_read(warts_state_t *state, uint8_t *buf, uint32_t *off, uint32_t len) { scamper_tbit_pkt_t *pkt = NULL; uint8_t dir, *data = NULL; struct timeval tv; uint16_t plen; warts_param_reader_t handlers[] = { {&dir, (wpr_t)extract_byte, NULL}, {&tv, (wpr_t)extract_timeval, NULL}, {&plen, (wpr_t)extract_uint16, NULL}, {&data, (wpr_t)extract_bytes_ptr, &plen}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0 || (pkt = scamper_tbit_pkt_alloc(dir, data, plen, &tv)) == NULL) goto err; return pkt; err: if(pkt != NULL) scamper_tbit_pkt_free(pkt); return NULL; } static int warts_tbit_pkt_write(const scamper_tbit_pkt_t *pkt, const scamper_file_t *sf, uint8_t *buf,uint32_t *off,const uint32_t len, warts_tbit_pkt_t *state) { uint16_t dl = pkt->len; warts_param_writer_t handlers[] = { {&pkt->dir, (wpw_t)insert_byte, NULL}, {&pkt->tv, (wpw_t)insert_timeval, NULL}, {&pkt->len, (wpw_t)insert_uint16, NULL}, {pkt->data, (wpw_t)insert_bytes_uint16, &dl}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return 0; } void insert_cookie(uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *cookie, uint8_t *count) { assert(len - *off >= ((*count) + 1)); buf[(*off)++] = *count; memcpy(buf + *off, cookie, *count); *off += *count; return; } int extract_cookie(const uint8_t *buf, uint32_t *off, const uint32_t len, uint8_t *out, void *param) { uint8_t cookielen; if(*off >= len || len - *off < 1) return -1; out[0] = cookielen = buf[(*off)++]; if(cookielen > 16 || cookielen > len - *off) return -1; memcpy(out+1, buf + *off, cookielen); *off += cookielen; return 0; } static void warts_tbit_params(const scamper_tbit_t *tbit, warts_addrtable_t *table, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { const warts_var_t *var; int i, max_id = 0; /* Unset all flags */ memset(flags, 0, tbit_vars_mfb); *params_len = 0; for(i=0; iid == WARTS_TBIT_PKTC16 || (var->id == WARTS_TBIT_LIST && tbit->list == NULL) || (var->id == WARTS_TBIT_CYCLE && tbit->cycle == NULL) || (var->id == WARTS_TBIT_USERID && tbit->userid == 0) || (var->id == WARTS_TBIT_SRC && tbit->src == NULL) || (var->id == WARTS_TBIT_DST && tbit->dst == NULL) || (var->id == WARTS_TBIT_COOKIE && tbit->fo_cookielen == 0) || (var->id == WARTS_TBIT_WSCALE && tbit->wscale == 0) || (var->id == WARTS_TBIT_OPTIONS && tbit->options == 0) || (var->id == WARTS_TBIT_TTL && tbit->ttl == 255)) continue; /* Set the flag for the rest of the variables */ flag_set(flags, var->id, &max_id); /* Variables that don't have a fixed size */ if(var->id == WARTS_TBIT_SRC) { *params_len += warts_addr_size(table, tbit->src); continue; } else if(var->id == WARTS_TBIT_DST) { *params_len += warts_addr_size(table, tbit->dst); continue; } else if(var->id == WARTS_TBIT_COOKIE) { *params_len += (1 + tbit->fo_cookielen); continue; } /* The rest of the variables have a fixed size */ *params_len += var->size; } *flags_len = fold_flags(flags, max_id); return; } static int warts_tbit_params_read(scamper_tbit_t *tbit, warts_addrtable_t *table, warts_state_t *state, uint8_t *buf, uint32_t *off, uint32_t len) { uint16_t pktc16 = 0; uint32_t pktc32 = 0; uint8_t cookie[17]; uint32_t o = *off; warts_param_reader_t handlers[] = { {&tbit->list, (wpr_t)extract_list, state}, {&tbit->cycle, (wpr_t)extract_cycle, state}, {&tbit->userid, (wpr_t)extract_uint32, NULL}, {&tbit->src, (wpr_t)extract_addr, table}, {&tbit->dst, (wpr_t)extract_addr, table}, {&tbit->sport, (wpr_t)extract_uint16, NULL}, {&tbit->dport, (wpr_t)extract_uint16, NULL}, {&tbit->start, (wpr_t)extract_timeval, NULL}, {&tbit->result, (wpr_t)extract_uint16, NULL}, {&tbit->type, (wpr_t)extract_byte, NULL}, {&tbit->app_proto, (wpr_t)extract_byte, NULL}, {&tbit->client_mss, (wpr_t)extract_uint16, NULL}, {&tbit->server_mss, (wpr_t)extract_uint16, NULL}, {&tbit->syn_retx, (wpr_t)extract_byte, NULL}, {&tbit->dat_retx, (wpr_t)extract_byte, NULL}, {&pktc16, (wpr_t)extract_uint16, NULL}, {&pktc32, (wpr_t)extract_uint32, NULL}, {cookie, (wpr_t)extract_cookie, NULL}, {&tbit->wscale, (wpr_t)extract_byte, NULL}, {&tbit->options, (wpr_t)extract_uint32, NULL}, {&tbit->ttl, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; if(tbit->src == NULL || tbit->dst == NULL) return -1; /* handle the fact the pktc param changed from 16 to 32 bits */ if(pktc32 != 0) tbit->pktc = pktc32; else if(pktc16 != 0) tbit->pktc = pktc16; if(flag_isset(&buf[o], WARTS_TBIT_COOKIE) && scamper_tbit_fo_setcookie(tbit, cookie+1, cookie[0]) != 0) return -1; if(flag_isset(&buf[o], WARTS_TBIT_TTL) == 0) tbit->ttl = 255; return 0; } static int warts_tbit_params_write(const scamper_tbit_t *tbit, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len) { uint32_t list_id, cycle_id; uint8_t cookielen = tbit->fo_cookielen; /* Specifies how to write each variable to the warts file. */ warts_param_writer_t handlers[] = { {&list_id, (wpw_t)insert_uint32, NULL}, {&cycle_id, (wpw_t)insert_uint32, NULL}, {&tbit->userid, (wpw_t)insert_uint32, NULL}, {tbit->src, (wpw_t)insert_addr, table}, {tbit->dst, (wpw_t)insert_addr, table}, {&tbit->sport, (wpw_t)insert_uint16, NULL}, {&tbit->dport, (wpw_t)insert_uint16, NULL}, {&tbit->start, (wpw_t)insert_timeval, NULL}, {&tbit->result, (wpw_t)insert_uint16, NULL}, {&tbit->type, (wpw_t)insert_byte, NULL}, {&tbit->app_proto, (wpw_t)insert_byte, NULL}, {&tbit->client_mss, (wpw_t)insert_uint16, NULL}, {&tbit->server_mss, (wpw_t)insert_uint16, NULL}, {&tbit->syn_retx, (wpw_t)insert_byte, NULL}, {&tbit->dat_retx, (wpw_t)insert_byte, NULL}, {NULL, NULL, NULL}, /* PKTC16 */ {&tbit->pktc, (wpw_t)insert_uint32, NULL}, {tbit->fo_cookie, (wpw_t)insert_cookie, &cookielen}, {&tbit->wscale, (wpw_t)insert_byte, NULL}, {&tbit->options, (wpw_t)insert_uint32, NULL}, {&tbit->ttl, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); if(warts_list_getid(sf, tbit->list, &list_id) == -1) return -1; if(warts_cycle_getid(sf, tbit->cycle, &cycle_id) == -1) return -1; warts_params_write(buf, off, len, flags, flags_len, params_len, handlers, handler_cnt); return 0; } int scamper_file_warts_tbit_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_tbit_t **tbit_out) { scamper_tbit_t *tbit = NULL; warts_addrtable_t *table = NULL; warts_state_t *state = scamper_file_getstate(sf); uint8_t *buf = NULL; uint16_t junk16; uint32_t junk32; uint32_t off = 0; uint32_t i; /* Read in the header */ if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { *tbit_out = NULL; return 0; } /* Allocate space for a tbit object */ if((tbit = scamper_tbit_alloc()) == NULL) { goto err; } if((table = warts_addrtable_alloc_byid()) == NULL) goto err; /* Read in the tbit data from the warts file */ if(warts_tbit_params_read(tbit, table, state, buf, &off, hdr->len) != 0) { goto err; } switch(tbit->type) { case SCAMPER_TBIT_TYPE_PMTUD: if((tbit->data = scamper_tbit_pmtud_alloc()) == NULL) goto err; break; case SCAMPER_TBIT_TYPE_NULL: if((tbit->data = scamper_tbit_null_alloc()) == NULL) goto err; break; case SCAMPER_TBIT_TYPE_ICW: if((tbit->data = scamper_tbit_icw_alloc()) == NULL) goto err; break; case SCAMPER_TBIT_TYPE_BLIND_RST: case SCAMPER_TBIT_TYPE_BLIND_SYN: case SCAMPER_TBIT_TYPE_BLIND_DATA: case SCAMPER_TBIT_TYPE_BLIND_FIN: if((tbit->data = scamper_tbit_blind_alloc()) == NULL) goto err; break; } /* Determine how many tbit_pkts to read */ if(tbit->pktc > 0) { /* Allocate the tbit_pkts array */ if(scamper_tbit_pkts_alloc(tbit, tbit->pktc) != 0) goto err; /* For each tbit packet, read it and insert it into the tbit structure */ for(i=0; ipktc; i++) { tbit->pkts[i] = warts_tbit_pkt_read(state, buf, &off, hdr->len); if(tbit->pkts[i] == NULL) goto err; } } for(;;) { if(extract_uint16(buf, &off, hdr->len, &junk16, NULL) != 0) goto err; if(junk16 == WARTS_TBIT_STRUCT_EOF) break; if(extract_uint32(buf, &off, hdr->len, &junk32, NULL) != 0) goto err; i = off; if(junk16 == WARTS_TBIT_STRUCT_TYPE) { switch(tbit->type) { case SCAMPER_TBIT_TYPE_PMTUD: if(warts_tbit_pmtud_read(tbit, table, buf, &i, hdr->len) != 0) goto err; break; case SCAMPER_TBIT_TYPE_NULL: if(warts_tbit_null_read(tbit, buf, &i, hdr->len) != 0) goto err; break; case SCAMPER_TBIT_TYPE_ICW: if(warts_tbit_icw_read(tbit, buf, &i, hdr->len) != 0) goto err; break; case SCAMPER_TBIT_TYPE_BLIND_RST: case SCAMPER_TBIT_TYPE_BLIND_SYN: case SCAMPER_TBIT_TYPE_BLIND_DATA: case SCAMPER_TBIT_TYPE_BLIND_FIN: if(warts_tbit_blind_read(tbit, buf, &i, hdr->len) != 0) goto err; break; } } else if(junk16 == WARTS_TBIT_STRUCT_APP) { if(tbit->app_proto == SCAMPER_TBIT_APP_HTTP) { if(warts_tbit_app_http_read(tbit, buf, &i, hdr->len) != 0) goto err; } else if(tbit->app_proto == SCAMPER_TBIT_APP_BGP) { if(warts_tbit_app_bgp_read(tbit, buf, &i, hdr->len) != 0) goto err; } } off += junk32; } warts_addrtable_free(table); *tbit_out = tbit; free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(buf != NULL) free(buf); if(tbit != NULL) scamper_tbit_free(tbit); return -1; } /* Write data from a scamper tbit object to a warts file */ int scamper_file_warts_tbit_write(const scamper_file_t *sf, const scamper_tbit_t *tbit) { warts_addrtable_t *table = NULL; warts_tbit_pkt_t *pkts = NULL; warts_tbit_pmtud_t pmtud; warts_tbit_null_t null; warts_tbit_icw_t icw; warts_tbit_blind_t blind; warts_tbit_app_http_t http; warts_tbit_app_bgp_t bgp; uint8_t *buf = NULL; uint8_t flags[tbit_vars_mfb]; uint16_t junk16; uint16_t flags_len, params_len; uint32_t len, i, off = 0; size_t size; if((table = warts_addrtable_alloc_byaddr()) == NULL) goto err; /* Set the tbit data (not including the packets) */ warts_tbit_params(tbit, table, flags, &flags_len, ¶ms_len); len = 8 + flags_len + params_len + 2; if(tbit->pktc > 0) { /* Allocate memory for the state */ size = tbit->pktc * sizeof(warts_tbit_pkt_t); if((pkts = (warts_tbit_pkt_t *)malloc_zero(size)) == NULL) goto err; for(i=0; ipktc; i++) warts_tbit_pkt_params(tbit->pkts[i], &pkts[i], &len); } if(tbit->data != NULL) { switch(tbit->type) { case SCAMPER_TBIT_TYPE_PMTUD: warts_tbit_pmtud_params(tbit, table, &pmtud); len += (2 + 4 + pmtud.len); break; case SCAMPER_TBIT_TYPE_NULL: warts_tbit_null_params(tbit, &null); len += (2 + 4 + null.len); break; case SCAMPER_TBIT_TYPE_ICW: warts_tbit_icw_params(tbit, &icw); len += (2 + 4 + icw.len); break; case SCAMPER_TBIT_TYPE_BLIND_RST: case SCAMPER_TBIT_TYPE_BLIND_SYN: case SCAMPER_TBIT_TYPE_BLIND_DATA: case SCAMPER_TBIT_TYPE_BLIND_FIN: warts_tbit_blind_params(tbit, &blind); len += (2 + 4 + blind.len); break; default: goto err; } } if(tbit->app_data != NULL) { if(tbit->app_proto == SCAMPER_TBIT_APP_HTTP) { warts_tbit_app_http_params(tbit, &http); len += (2 + 4 + http.len); } else if(tbit->app_proto == SCAMPER_TBIT_APP_BGP) { warts_tbit_app_bgp_params(tbit, &bgp); len += (2 + 4 + bgp.len); } else goto err; } /* struct eof */ len += 2; /* Allocate memory to store all of the data (including packets) */ if((buf = malloc_zero(len)) == NULL) goto err; insert_wartshdr(buf, &off, len, SCAMPER_FILE_OBJ_TBIT); /* Write the tbit data (excluding packets) to the buffer */ if(warts_tbit_params_write(tbit, sf, table, buf, &off, len, flags, flags_len, params_len) != 0) { goto err; } if(tbit->pktc > 0) { for(i=0; ipktc; i++) warts_tbit_pkt_write(tbit->pkts[i], sf, buf, &off, len, &pkts[i]); free(pkts); pkts = NULL; } if(tbit->data != NULL) { junk16 = WARTS_TBIT_STRUCT_TYPE; insert_uint16(buf, &off, len, &junk16, NULL); switch(tbit->type) { case SCAMPER_TBIT_TYPE_PMTUD: insert_uint32(buf, &off, len, &pmtud.len, NULL); warts_tbit_pmtud_write(tbit, buf, &off, len, table, &pmtud); break; case SCAMPER_TBIT_TYPE_NULL: insert_uint32(buf, &off, len, &null.len, NULL); warts_tbit_null_write(tbit, buf, &off, len, &null); break; case SCAMPER_TBIT_TYPE_ICW: insert_uint32(buf, &off, len, &icw.len, NULL); warts_tbit_icw_write(tbit, buf, &off, len, &icw); break; case SCAMPER_TBIT_TYPE_BLIND_RST: case SCAMPER_TBIT_TYPE_BLIND_SYN: case SCAMPER_TBIT_TYPE_BLIND_DATA: case SCAMPER_TBIT_TYPE_BLIND_FIN: insert_uint32(buf, &off, len, &blind.len, NULL); warts_tbit_blind_write(tbit, buf, &off, len, &blind); break; default: goto err; } } if(tbit->app_data != NULL) { junk16 = WARTS_TBIT_STRUCT_APP; insert_uint16(buf, &off, len, &junk16, NULL); if(tbit->app_proto == SCAMPER_TBIT_APP_HTTP) { insert_uint32(buf, &off, len, &http.len, NULL); warts_tbit_app_http_write(tbit, buf, &off, len, &http); } else if(tbit->app_proto == SCAMPER_TBIT_APP_BGP) { insert_uint32(buf, &off, len, &bgp.len, NULL); warts_tbit_app_bgp_write(tbit, buf, &off, len, &bgp); } else goto err; } junk16 = WARTS_TBIT_STRUCT_EOF; insert_uint16(buf, &off, len, &junk16, NULL); assert(off == len); /* Write the whole buffer to a warts file */ if(warts_write(sf, buf, len) == -1) goto err; warts_addrtable_free(table); free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(pkts != NULL) free(pkts); if(buf != NULL) free(buf); return -1; } scamper-cvs-20171204/scamper/tbit/scamper_tbit_warts.h000644 001751 000000 00000002651 11452510530 022554 0ustar00mjlwheel000000 000000 /* * scamper_file_warts_tbit.h * * $Id: scamper_tbit_warts.h,v 1.1 2010/10/05 02:45:44 mjl Exp $ * * Copyright (C) 2009-2010 Ben Stasiewicz * Copyright (C) 2010 University of Waikato * * This file implements algorithms described in the tbit-1.0 source code, * as well as the papers: * * "On Inferring TCP Behaviour" * by Jitendra Padhye and Sally Floyd * "Measuring the Evolution of Transport Protocols in the Internet" by * by Alberto Medina, Mark Allman, and Sally Floyd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the replye that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_FILE_WARTS_TBIT_H #define __SCAMPER_FILE_WARTS_TBIT_H int scamper_file_warts_tbit_write(const scamper_file_t *sf, const scamper_tbit_t *tbit); int scamper_file_warts_tbit_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_tbit_t **tbit_out); #endif scamper-cvs-20171204/scamper/sting/.cvsignore000644 001751 000000 00000000034 12415633115 020667 0ustar00mjlwheel000000 000000 .deps .dirstamp .libs *.lo scamper-cvs-20171204/scamper/sting/scamper_sting.c000644 001751 000000 00000006325 12346403264 021705 0ustar00mjlwheel000000 000000 /* * scamper_dealias.c * * $Id: scamper_sting.c,v 1.11 2014/06/12 19:59:48 mjl Exp $ * * Copyright (C) 2008-2011 The University of Waikato * Copyright (C) 2014 The Regents of the University of California * Author: Matthew Luckie * * This file implements algorithms described in the sting-0.7 source code, * as well as the paper: * * Sting: a TCP-based Network Measurement Tool * by Stefan Savage * 1999 USENIX Symposium on Internet Technologies and Systems * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_sting.c,v 1.11 2014/06/12 19:59:48 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_sting.h" #include "utils.h" scamper_sting_pkt_t *scamper_sting_pkt_alloc(uint8_t flags, uint8_t *data, uint16_t len, struct timeval *tv) { scamper_sting_pkt_t *pkt; if((pkt = malloc_zero(sizeof(scamper_sting_pkt_t))) == NULL) goto err; pkt->flags = flags; if(len != 0 && data != NULL) { if((pkt->data = memdup(data, len)) == NULL) goto err; pkt->len = len; } if(tv != NULL) timeval_cpy(&pkt->tv, tv); return pkt; err: free(pkt); return NULL; } void scamper_sting_pkt_free(scamper_sting_pkt_t *pkt) { if(pkt == NULL) return; if(pkt->data != NULL) free(pkt->data); free(pkt); return; } int scamper_sting_data(scamper_sting_t *sting,const uint8_t *data,uint16_t len) { if(len == 0 || (sting->data = memdup(data, len)) == NULL) return -1; sting->datalen = len; return 0; } int scamper_sting_pkt_record(scamper_sting_t *sting, scamper_sting_pkt_t *pkt) { size_t len = (sting->pktc + 1) * sizeof(scamper_sting_pkt_t *); /* Add a new element to the pkts array */ if(realloc_wrap((void**)&sting->pkts, len) != 0) return -1; sting->pkts[sting->pktc++] = pkt; return 0; } int scamper_sting_pkts_alloc(scamper_sting_t *sting, uint32_t pktc) { size_t size = pktc * sizeof(scamper_sting_pkt_t *); if((sting->pkts = (scamper_sting_pkt_t **)malloc_zero(size)) == NULL) return -1; return 0; } void scamper_sting_free(scamper_sting_t *sting) { if(sting == NULL) return; if(sting->src != NULL) scamper_addr_free(sting->src); if(sting->dst != NULL) scamper_addr_free(sting->dst); if(sting->list != NULL) scamper_list_free(sting->list); if(sting->cycle != NULL) scamper_cycle_free(sting->cycle); if(sting->data != NULL) free(sting->data); free(sting); return; } scamper_sting_t *scamper_sting_alloc(void) { return (scamper_sting_t *)malloc_zero(sizeof(scamper_sting_t)); } scamper-cvs-20171204/scamper/sting/scamper_sting.h000644 001751 000000 00000007600 11751034137 021705 0ustar00mjlwheel000000 000000 /* * scamper_sting.h * * Copyright (C) 2008 The University of Waikato * Copyright (C) 2012 The Regents of the University of California * Author: Matthew Luckie * * $Id: scamper_sting.h,v 1.5 2012/05/04 20:13:19 mjl Exp $ * * This file implements algorithms described in the sting-0.7 source code, * as well as the paper: * * Sting: a TCP-based Network Measurement Tool * by Stefan Savage * 1999 USENIX Symposium on Internet Technologies and Systems * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_STING_H #define __SCAMPER_STING_H #define SCAMPER_STING_RESULT_NONE 0 #define SCAMPER_STING_RESULT_COMPLETED 1 #define SCAMPER_STING_DISTRIBUTION_EXPONENTIAL 1 #define SCAMPER_STING_DISTRIBUTION_PERIODIC 2 #define SCAMPER_STING_DISTRIBUTION_UNIFORM 3 typedef struct scamper_sting_pkt { struct timeval tv; uint8_t flags; uint16_t len; uint8_t *data; } scamper_sting_pkt_t; #define SCAMPER_STING_PKT_FLAG_TX 0x01 #define SCAMPER_STING_PKT_FLAG_RX 0x02 #define SCAMPER_STING_PKT_FLAG_DATA 0x04 #define SCAMPER_STING_PKT_FLAG_HOLE 0x08 /* * scamper_sting * * results of a measurement conducted with sting */ typedef struct scamper_sting { /* * management */ scamper_list_t *list; /* list corresponding to task */ scamper_cycle_t *cycle; /* cycle corresponding to task */ uint32_t userid; /* * parameters used in probing */ scamper_addr_t *src; /* source address */ scamper_addr_t *dst; /* destination address */ uint16_t sport; /* source port */ uint16_t dport; /* destination port */ uint16_t count; /* number of probes to send */ uint16_t mean; /* mean inter-packet delay, microseconds */ uint16_t inter; /* inter-phase delay */ uint8_t dist; /* inter-packet delay distribution to tx */ uint8_t synretx; /* number of times to retransmit syn */ uint8_t dataretx; /* number of times to retransmit data */ uint8_t seqskip; /* size of initial hole */ uint8_t *data; /* data to use */ uint16_t datalen; /* length of data */ /* * data collected */ struct timeval start; /* time measurement commenced */ struct timeval hsrtt; /* rtt of syn -> syn/ack */ uint16_t dataackc; /* number of acks rx'd in data-seeding */ uint16_t holec; /* number of holes filled (fwd loss) */ scamper_sting_pkt_t **pkts; /* array of packets in the test */ uint32_t pktc; /* number of packets in the test */ uint8_t result; /* did sting complete? */ } scamper_sting_t; scamper_sting_t *scamper_sting_alloc(void); void scamper_sting_free(scamper_sting_t *); scamper_addr_t *scamper_sting_addr(const void *); int scamper_sting_data(scamper_sting_t *,const uint8_t *,uint16_t); int scamper_sting_pkts_alloc(scamper_sting_t *, uint32_t); int scamper_sting_pkt_record(scamper_sting_t *, scamper_sting_pkt_t *); scamper_sting_pkt_t *scamper_sting_pkt_alloc(uint8_t flags, uint8_t *data, uint16_t len, struct timeval *tv); void scamper_sting_pkt_free(scamper_sting_pkt_t *pkt); #endif scamper-cvs-20171204/scamper/sting/scamper_sting_do.c000644 001751 000000 00000067055 13210743023 022365 0ustar00mjlwheel000000 000000 /* * scamper_do_sting.c * * $Id: scamper_sting_do.c,v 1.47 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2008-2011 The University of Waikato * Copyright (C) 2012 The Regents of the University of California * Author: Matthew Luckie * * This file implements algorithms described in the sting-0.7 source code, * as well as the paper: * * Sting: a TCP-based Network Measurement Tool * by Stefan Savage * 1999 USENIX Symposium on Internet Technologies and Systems * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_sting_do.c,v 1.47 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_sting.h" #include "scamper_task.h" #include "scamper_dl.h" #include "scamper_fds.h" #include "scamper_dlhdr.h" #include "scamper_firewall.h" #include "scamper_rtsock.h" #include "scamper_probe.h" #include "scamper_getsrc.h" #include "scamper_tcp4.h" #include "scamper_tcp6.h" #include "scamper_queue.h" #include "scamper_file.h" #include "scamper_options.h" #include "scamper_debug.h" #include "scamper_sting_do.h" #include "utils.h" #include "mjl_list.h" /* * how many packets to send in data phase: * freebsd net.inet.tcp.reass.maxqlen = 48 * note that this value is different to the hard-coded sting-0.7 default * of 100. */ #define SCAMPER_DO_STING_COUNT_MIN 2 #define SCAMPER_DO_STING_COUNT_DEF 48 #define SCAMPER_DO_STING_COUNT_MAX 65535 /* * mean rate at which to send packets in data phase: * 100ms is the hard-coded number in sting-0.7 */ #define SCAMPER_DO_STING_MEAN_MIN 1 #define SCAMPER_DO_STING_MEAN_DEF 100 #define SCAMPER_DO_STING_MEAN_MAX 1000 /* * inter-phase delay between data seeding and hole filling. * 2000ms is the hard-coded number in sting-0.7 */ #define SCAMPER_DO_STING_INTER_MIN 1 #define SCAMPER_DO_STING_INTER_DEF 2000 #define SCAMPER_DO_STING_INTER_MAX 10000 /* * distribution to apply when determining when to send the next packet * 3 corresponds to uniform distribution */ #define SCAMPER_DO_STING_DIST_MIN 1 #define SCAMPER_DO_STING_DIST_DEF 3 #define SCAMPER_DO_STING_DIST_MAX 3 /* * how many times to retransmit a syn packet before deciding the host is down * 3 is the hard-coded number in sting-0.7 */ #define SCAMPER_DO_STING_SYNRETX_MIN 0 #define SCAMPER_DO_STING_SYNRETX_DEF 3 #define SCAMPER_DO_STING_SYNRETX_MAX 5 /* * number of times to retransmit data packets * 5 is the default number in sting-0.7 */ #define SCAMPER_DO_STING_DATARETX_MIN 0 #define SCAMPER_DO_STING_DATARETX_DEF 5 #define SCAMPER_DO_STING_DATARETX_MAX 10 /* * size of the first hole in the sequence number space * 3 is the default number in sting-0.7 */ #define SCAMPER_DO_STING_SEQSKIP_MIN 1 #define SCAMPER_DO_STING_SEQSKIP_DEF 3 #define SCAMPER_DO_STING_SEQSKIP_MAX 255 typedef struct sting_state { uint8_t mode; struct timeval next_tx; #ifndef _WIN32 scamper_fd_t *rtsock; #endif scamper_fd_t *dl; scamper_firewall_entry_t *fw; scamper_route_t *route; scamper_dlhdr_t *dlhdr; uint32_t isn; /* initial sequence number */ uint32_t ack; /* acknowledgement number to use */ uint32_t off; /* which byte to tx next */ uint8_t attempt; scamper_sting_pkt_t **probes; uint16_t probec; } sting_state_t; static const uint8_t MODE_RTSOCK = 0; static const uint8_t MODE_DLHDR = 1; static const uint8_t MODE_SYN = 2; static const uint8_t MODE_ACK = 3; static const uint8_t MODE_DATA = 4; static const uint8_t MODE_INTER = 5; static const uint8_t MODE_HOLE = 6; static const uint8_t MODE_RST = 7; /* the callback functions registered with the sting task */ static scamper_task_funcs_t sting_funcs; /* address cache used to avoid reallocating the same address multiple times */ extern scamper_addrcache_t *addrcache; #define STING_OPT_COUNT 1 #define STING_OPT_DPORT 2 #define STING_OPT_DIST 3 #define STING_OPT_REQ 4 #define STING_OPT_HOLE 5 #define STING_OPT_INTER 6 #define STING_OPT_MEAN 7 #define STING_OPT_SPORT 8 #define STING_OPT_USERID 9 static const scamper_option_in_t opts[] = { {'c', NULL, STING_OPT_COUNT, SCAMPER_OPTION_TYPE_NUM}, {'d', NULL, STING_OPT_DPORT, SCAMPER_OPTION_TYPE_NUM}, {'f', NULL, STING_OPT_DIST, SCAMPER_OPTION_TYPE_STR}, {'h', NULL, STING_OPT_REQ, SCAMPER_OPTION_TYPE_STR}, {'H', NULL, STING_OPT_HOLE, SCAMPER_OPTION_TYPE_NUM}, {'i', NULL, STING_OPT_INTER, SCAMPER_OPTION_TYPE_NUM}, {'m', NULL, STING_OPT_MEAN, SCAMPER_OPTION_TYPE_STR}, {'s', NULL, STING_OPT_SPORT, SCAMPER_OPTION_TYPE_NUM}, {'U', NULL, STING_OPT_USERID, SCAMPER_OPTION_TYPE_NUM}, }; static const int opts_cnt = SCAMPER_OPTION_COUNT(opts); const char *scamper_do_sting_usage(void) { return "sting [-c count] [-d dport] [-f distribution] [-h request]\n" " [-H hole] [-i inter] [-m mean] [-s sport] [-U userid]"; } /* * this is the default request used when none is specified. it is the same * default request found in sting-0.7, except it uses not * just as per the HTTP specification. */ static const char *defaultrequest = "GET / HTTP/1.0\r\n" "Accept: text/plain\r\n" "Accept: */*\r\n" "User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt; Sting)\r\n" "\r\n"; static scamper_sting_t *sting_getdata(const scamper_task_t *task) { return scamper_task_getdata(task); } static sting_state_t *sting_getstate(const scamper_task_t *task) { return scamper_task_getstate(task); } static void sting_handleerror(scamper_task_t *task, int error) { scamper_task_queue_done(task, 0); return; } /* * handletimeout_syn * * retransmit a syn up to a specified number of times. */ static void handletimeout_syn(scamper_task_t *task) { scamper_sting_t *sting = sting_getdata(task); sting_state_t *state = sting_getstate(task); if(state->attempt == sting->synretx) scamper_task_queue_done(task, 0); else scamper_task_queue_probe(task); return; } /* * handletimeout_inter * * this function is called to signal the end of the inter-phase wait time. * the only point of this function is to shift the sting into the hole-filling * phase. */ static void handletimeout_inter(scamper_task_t *task) { sting_state_t *state = sting_getstate(task); state->attempt = 0; state->off = 0; state->mode = MODE_HOLE; scamper_task_queue_probe(task); return; } /* * handletimeout_hole * * this function is called when a timeout occurs when in the hole-filling * state. it allows a packet in a hole to be retransmitted a number of times * before giving up. */ static void handletimeout_hole(scamper_task_t *task) { scamper_sting_t *sting = sting_getdata(task); sting_state_t *state = sting_getstate(task); /* * when we reach the maximum number of retranmissions, send a reset * and give up */ if(state->attempt == sting->dataretx) state->mode = MODE_RST; scamper_task_queue_probe(task); return; } /* * handletimeout_rst * * this function exists solely to ensure a task makes its way into the * done queue after a reset has been transmitted. */ static void handletimeout_rst(scamper_task_t *task) { scamper_task_queue_done(task, 0); return; } /* * do_sting_handle_timeout * * this function ensures an appropriate action is taken when a timeout * occurs. */ static void do_sting_handle_timeout(scamper_task_t *task) { static void (* const func[])(scamper_task_t *) = { NULL, /* MODE_RTSOCK */ NULL, /* MODE_DLHDR */ handletimeout_syn, /* MODE_SYN */ NULL, /* MODE_ACK */ NULL, /* MODE_DATA */ handletimeout_inter, /* MODE_INTER */ handletimeout_hole, /* MODE_HOLE */ handletimeout_rst, /* MODE_RST */ }; sting_state_t *state = sting_getstate(task); if(func[state->mode] != NULL) { func[state->mode](task); } return; } /* * handletcp_syn * * this function checks the response to a syn */ static void handletcp_syn(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_sting_t *sting = sting_getdata(task); sting_state_t *state = sting_getstate(task); struct timeval tv; /* * wait for the SYN/ACK to come in; make a note of the sequence number * used by the receiver, and take an RTT measurement if possible. */ if((dl->dl_tcp_flags & (TH_SYN|TH_ACK)) != (TH_SYN|TH_ACK)) { /* we got a reply, but it was not a SYN/ACK; halt the measurement */ scamper_task_queue_done(task, 0); return; } /* * the initial syn occupies one byte in the sequence space; data is * going to have this offset */ state->isn++; /* if the sequence number in response did not make sense, abandon */ if(dl->dl_tcp_ack != state->isn) { scamper_task_queue_done(task, 0); return; } /* if we get a syn/ack on the first probe, take an RTT measurement */ if(state->attempt == 1) { tv.tv_sec = state->next_tx.tv_sec - 5; tv.tv_usec = state->next_tx.tv_usec; timeval_diff_tv(&sting->hsrtt, &tv, &dl->dl_tv); } /* send a token acknowledgement */ state->ack = dl->dl_tcp_seq + 1; state->mode = MODE_ACK; /* leave a hole in the sequence space */ state->off = sting->seqskip; scamper_task_queue_probe(task); return; } /* * handletcp_data * * for each acknowledgement received, check that it makes sense. * count the number of acknowledgements received in the data phase */ static void handletcp_data(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_sting_t *sting = sting_getdata(task); sting_state_t *state = sting_getstate(task); /* if the acknowledgement number is not what is expected, abandon */ if(dl->dl_tcp_ack != state->isn) { scamper_task_queue_done(task, 0); return; } sting->dataackc++; return; } /* * handletcp_hole * * for each acknowledgement received in the hole-filling phase, figure out * if all probes have been accounted for */ static void handletcp_hole(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_sting_t *sting = sting_getdata(task); sting_state_t *state = sting_getstate(task); uint16_t u16; /* * this handles the case where the receiver lost our ACK to * their SYN/ACK and the data request. */ if(state->isn >= dl->dl_tcp_ack) goto err; /* check to see if all holes are now full */ if(state->isn + sting->seqskip + sting->count == dl->dl_tcp_ack) { state->off = sting->seqskip + sting->count - 1; state->mode = MODE_RST; sting->result = SCAMPER_STING_RESULT_COMPLETED; scamper_task_queue_probe(task); return; } state->off = dl->dl_tcp_ack - state->isn; u16 = state->off - sting->seqskip; if(u16 >= state->probec) goto err; state->probes[u16]->flags |= SCAMPER_STING_PKT_FLAG_HOLE; sting->holec++; state->attempt = 0; scamper_task_queue_probe(task); return; err: state->mode = MODE_RST; scamper_task_queue_probe(task); return; } /* * do_sting_handle_dl * * for each packet received, check that the addresses and ports make sense, * and that the packet is not a reset */ static void do_sting_handle_dl(scamper_task_t *task, scamper_dl_rec_t *dl) { static void (* const func[])(scamper_task_t *, scamper_dl_rec_t *) = { NULL, /* MODE_RTSOCK */ NULL, /* MODE_DLHDR */ handletcp_syn, /* MODE_SYN */ NULL, /* MODE_ACK */ handletcp_data, /* MODE_DATA */ handletcp_data, /* MODE_INTER */ handletcp_hole, /* MODE_HOLE */ NULL, /* MODE_RST */ }; scamper_sting_t *sting = sting_getdata(task); sting_state_t *state = sting_getstate(task); scamper_sting_pkt_t *pkt; /* unless the packet is an inbound TCP packet for the flow, ignore it */ if(SCAMPER_DL_IS_TCP(dl) == 0 || dl->dl_tcp_sport != sting->dport || dl->dl_tcp_dport != sting->sport || scamper_addr_raw_cmp(sting->src, dl->dl_ip_dst) != 0 || scamper_addr_raw_cmp(sting->dst, dl->dl_ip_src) != 0) { return; } scamper_dl_rec_tcp_print(dl); pkt = scamper_sting_pkt_alloc(SCAMPER_STING_PKT_FLAG_RX, dl->dl_net_raw, dl->dl_ip_size, &dl->dl_tv); if(pkt == NULL || scamper_sting_pkt_record(sting, pkt) != 0) { if(pkt != NULL) scamper_sting_pkt_free(pkt); sting_handleerror(task, errno); return; } /* if a reset packet is received, abandon the measurement */ if((dl->dl_tcp_flags & TH_RST) != 0) { scamper_task_queue_done(task, 0); return; } if(func[state->mode] != NULL) { func[state->mode](task, dl); } return; } static void sting_handle_dlhdr(scamper_dlhdr_t *dlhdr) { scamper_task_t *task = dlhdr->param; sting_state_t *state = sting_getstate(task); if(dlhdr->error != 0) { scamper_task_queue_done(task, 0); return; } state->mode = MODE_SYN; scamper_task_queue_probe(task); return; } static void sting_handle_rt(scamper_route_t *rt) { scamper_task_t *task = rt->param; scamper_sting_t *sting = sting_getdata(task); sting_state_t *state = sting_getstate(task); scamper_dl_t *dl; if(state->mode != MODE_RTSOCK || state->route != rt) goto done; #ifndef _WIN32 if(state->rtsock != NULL) { scamper_fd_free(state->rtsock); state->rtsock = NULL; } #endif if(rt->error != 0 || rt->ifindex < 0) { printerror(__func__, "could not get ifindex"); sting_handleerror(task, errno); goto done; } if((state->dl = scamper_fd_dl(rt->ifindex)) == NULL) { scamper_debug(__func__, "could not get dl for %d", rt->ifindex); sting_handleerror(task, errno); goto done; } /* * determine the underlying framing to use with each probe packet that will * be sent on the datalink. */ state->mode = MODE_DLHDR; if((state->dlhdr = scamper_dlhdr_alloc()) == NULL) { sting_handleerror(task, errno); goto done; } dl = scamper_fd_dl_get(state->dl); state->dlhdr->dst = scamper_addr_use(sting->dst); state->dlhdr->gw = rt->gw != NULL ? scamper_addr_use(rt->gw) : NULL; state->dlhdr->ifindex = rt->ifindex; state->dlhdr->txtype = scamper_dl_tx_type(dl); state->dlhdr->param = task; state->dlhdr->cb = sting_handle_dlhdr; if(scamper_dlhdr_get(state->dlhdr) != 0) { sting_handleerror(task, errno); goto done; } if(state->mode != MODE_SYN && scamper_task_queue_isdone(task) == 0) scamper_task_queue_wait(task, 1000); done: scamper_route_free(rt); if(state->route == rt) state->route = NULL; return; } static void do_sting_write(scamper_file_t *sf, scamper_task_t *task) { scamper_file_write_sting(sf, sting_getdata(task)); return; } static void sting_state_free(sting_state_t *state) { if(state == NULL) return; if(state->fw != NULL) scamper_firewall_entry_free(state->fw); #ifndef _WIN32 if(state->rtsock != NULL) scamper_fd_free(state->rtsock); #endif if(state->dl != NULL) scamper_fd_free(state->dl); if(state->dlhdr != NULL) scamper_dlhdr_free(state->dlhdr); if(state->route != NULL) scamper_route_free(state->route); free(state); return; } static int sting_state_alloc(scamper_task_t *task) { scamper_sting_t *sting = sting_getdata(task); sting_state_t *state; uint16_t u16; size_t size; if((state = malloc_zero(sizeof(sting_state_t))) == NULL) { printerror(__func__, "could not malloc state"); goto err; } scamper_task_setstate(task, state); size = (sting->seqskip + sting->count) * sizeof(scamper_sting_pkt_t *); if((state->probes = malloc_zero(size)) == NULL) goto err; if(random_u16(&u16) != 0) { printerror(__func__, "could not get random isn"); goto err; } state->isn = u16; #ifndef _WIN32 if((state->rtsock = scamper_fd_rtsock()) == NULL) { goto err; } #endif state->mode = MODE_RTSOCK; return 0; err: return -1; } static void do_sting_halt(scamper_task_t *task) { scamper_task_queue_done(task, 0); return; } static void do_sting_free(scamper_task_t *task) { scamper_sting_t *sting; sting_state_t *state; /* free any state kept */ if((state = sting_getstate(task)) != NULL) { sting_state_free(state); } /* free any sting data collected */ if((sting = sting_getdata(task)) != NULL) { scamper_sting_free(sting); } return; } static void do_sting_probe(scamper_task_t *task) { scamper_firewall_rule_t sfw; scamper_sting_pkt_t *pkt; scamper_sting_t *sting = sting_getdata(task); sting_state_t *state = sting_getstate(task); scamper_probe_t probe; uint32_t wait; uint8_t data[3]; if(state == NULL) { gettimeofday_wrap(&sting->start); if(sting_state_alloc(task) != 0) goto err; state = sting_getstate(task); } if(state->mode == MODE_RTSOCK) { state->route = scamper_route_alloc(sting->dst, task, sting_handle_rt); if(state->route == NULL) goto err; #ifndef _WIN32 if(scamper_rtsock_getroute(state->rtsock, state->route) != 0) goto err; #else if(scamper_rtsock_getroute(state->route) != 0) goto err; #endif if(scamper_task_queue_isdone(task)) return; if(state->mode != MODE_SYN) { scamper_task_queue_wait(task, 1000); return; } } memset(&probe, 0, sizeof(probe)); probe.pr_dl = scamper_fd_dl_get(state->dl); probe.pr_dl_buf = state->dlhdr->buf; probe.pr_dl_len = state->dlhdr->len; probe.pr_ip_src = sting->src; probe.pr_ip_dst = sting->dst; probe.pr_ip_ttl = 255; probe.pr_ip_proto = IPPROTO_TCP; probe.pr_tcp_sport = sting->sport; probe.pr_tcp_dport = sting->dport; if(state->mode == MODE_SYN) { if(state->attempt == 0) { /* * add a firewall rule to block the kernel from interfering with * the measurement */ sfw.type = SCAMPER_FIREWALL_RULE_TYPE_5TUPLE; sfw.sfw_5tuple_proto = IPPROTO_TCP; sfw.sfw_5tuple_src = sting->dst; sfw.sfw_5tuple_dst = sting->src; sfw.sfw_5tuple_sport = sting->dport; sfw.sfw_5tuple_dport = sting->sport; if((state->fw = scamper_firewall_entry_get(&sfw)) == NULL) { goto err; } } probe.pr_tcp_seq = state->isn; probe.pr_tcp_ack = 0; probe.pr_tcp_flags = TH_SYN; probe.pr_tcp_win = 0; probe.pr_len = 0; /* wait five seconds */ wait = 5000; } else if(state->mode == MODE_ACK) { probe.pr_tcp_seq = state->isn; probe.pr_tcp_ack = state->ack; probe.pr_tcp_flags = TH_ACK; probe.pr_tcp_win = 0; probe.pr_len = 0; /* wait for 50 msec until sending the first data probe */ wait = 50; state->mode = MODE_DATA; } else if(state->mode == MODE_DATA) { data[0] = sting->data[state->off]; probe.pr_tcp_seq = state->isn + state->off; probe.pr_tcp_ack = state->ack; probe.pr_tcp_flags = TH_PUSH | TH_ACK; probe.pr_tcp_win = 0; probe.pr_len = 1; probe.pr_data = data; state->off++; wait = sting->mean; } else if(state->mode == MODE_HOLE) { data[0] = sting->data[state->off]; probe.pr_tcp_seq = state->isn + state->off; probe.pr_tcp_ack = state->ack; probe.pr_tcp_flags = TH_PUSH | TH_ACK; probe.pr_tcp_win = 0; probe.pr_data = data; if(state->off == 0) { data[1] = sting->data[1]; data[2] = sting->data[2]; probe.pr_len = 3; } else { probe.pr_len = 1; } /* wait 2 seconds before trying to retransmit */ wait = 2000; } else if(state->mode == MODE_RST) { probe.pr_tcp_seq = state->isn + state->off; probe.pr_tcp_ack = state->ack; probe.pr_tcp_flags = TH_RST; probe.pr_tcp_win = 0; probe.pr_len = 0; /* wait a second */ wait = 1000; } else { goto err; } /* send the probe */ if(scamper_probe(&probe) == -1) { errno = probe.pr_errno; printerror(__func__, "could not send probe"); goto err; } if((pkt = scamper_sting_pkt_alloc(SCAMPER_STING_PKT_FLAG_TX, probe.pr_tx_raw, probe.pr_tx_rawlen, &probe.pr_tx)) == NULL || scamper_sting_pkt_record(sting, pkt) != 0) { printerror(__func__, "could not record packet"); goto err; } if(state->mode == MODE_DATA) { pkt->flags |= SCAMPER_STING_PKT_FLAG_DATA; state->probes[state->probec] = pkt; if(state->probec == sting->count) { /* wait 2 seconds */ wait = sting->inter; state->mode = MODE_INTER; } state->probec++; } /* figure out when the next probe may be sent */ timeval_add_ms(&state->next_tx, &probe.pr_tx, wait); /* put in the queue for waiting */ scamper_task_queue_wait(task, wait); state->attempt++; return; err: scamper_debug(__func__, "error mode %d", state != NULL ? state->mode : -1); sting_handleerror(task, errno); return; } static int sting_arg_param_validate(int optid, char *param, long *out) { long tmp; switch(optid) { case STING_OPT_COUNT: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_STING_COUNT_MIN || tmp > SCAMPER_DO_STING_COUNT_MAX) { goto err; } break; case STING_OPT_SPORT: case STING_OPT_DPORT: if(string_tolong(param, &tmp) != 0 || tmp < 0 || tmp > 65535) goto err; break; case STING_OPT_DIST: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_STING_DIST_MIN || tmp > SCAMPER_DO_STING_DIST_MAX) goto err; break; case STING_OPT_REQ: return -1; case STING_OPT_MEAN: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_STING_MEAN_MIN || tmp > SCAMPER_DO_STING_MEAN_MAX) goto err; break; case STING_OPT_HOLE: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_STING_SEQSKIP_MIN || tmp > SCAMPER_DO_STING_SEQSKIP_MAX) goto err; break; case STING_OPT_INTER: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_STING_INTER_MIN || tmp > SCAMPER_DO_STING_INTER_MAX) goto err; break; case STING_OPT_USERID: if(string_tolong(param, &tmp) != 0 || tmp < 0) goto err; break; default: return -1; } /* valid parameter */ if(out != NULL) *out = tmp; return 0; err: return -1; } /* * scamper_do_sting_alloc * * given a string representing a sting task, parse the parameters and * assemble a sting. return the sting structure so that it is all ready to * go. */ void *scamper_do_sting_alloc(char *str) { uint16_t sport = scamper_sport_default(); uint16_t dport = 80; uint16_t count = SCAMPER_DO_STING_COUNT_DEF; uint16_t mean = SCAMPER_DO_STING_MEAN_DEF; uint16_t inter = SCAMPER_DO_STING_INTER_DEF; uint8_t seqskip = SCAMPER_DO_STING_SEQSKIP_DEF; uint8_t dist = SCAMPER_DO_STING_DIST_DEF; uint8_t synretx = SCAMPER_DO_STING_SYNRETX_DEF; uint8_t dataretx = SCAMPER_DO_STING_DATARETX_DEF; uint32_t userid = 0; scamper_option_out_t *opts_out = NULL, *opt; scamper_sting_t *sting = NULL; char *addr; long tmp = 0; /* try and parse the string passed in */ if(scamper_options_parse(str, opts, opts_cnt, &opts_out, &addr) != 0) { scamper_debug(__func__, "could not parse options"); goto err; } /* if there is no IP address after the options string, then stop now */ if(addr == NULL) { scamper_debug(__func__, "no address parameter"); goto err; } /* parse the options, do preliminary sanity checks */ for(opt = opts_out; opt != NULL; opt = opt->next) { if(opt->type != SCAMPER_OPTION_TYPE_NULL && sting_arg_param_validate(opt->id, opt->str, &tmp) != 0) { scamper_debug(__func__, "validation of optid %d failed", opt->id); goto err; } switch(opt->id) { case STING_OPT_DPORT: dport = (uint16_t)tmp; break; case STING_OPT_SPORT: sport = (uint16_t)tmp; break; case STING_OPT_COUNT: count = (uint16_t)tmp; break; case STING_OPT_MEAN: mean = (uint16_t)tmp; break; case STING_OPT_DIST: dist = (uint8_t)tmp; break; case STING_OPT_HOLE: seqskip = (uint8_t)tmp; break; case STING_OPT_INTER: inter = (uint16_t)tmp; break; case STING_OPT_USERID: userid = (uint32_t)tmp; break; } } scamper_options_free(opts_out); opts_out = NULL; if((sting = scamper_sting_alloc()) == NULL) { printerror(__func__, "could not alloc sting"); goto err; } if((sting->dst=scamper_addrcache_resolve(addrcache,AF_UNSPEC,addr)) == NULL) { printerror(__func__, "could not resolve %s", addr); goto err; } sting->sport = sport; sting->dport = dport; sting->count = count; sting->mean = mean; sting->inter = inter; sting->dist = dist; sting->synretx = synretx; sting->dataretx = dataretx; sting->seqskip = seqskip; sting->userid = userid; /* take a copy of the data to be used in the measurement */ if(scamper_sting_data(sting, (const uint8_t *)defaultrequest, seqskip + count) != 0) { goto err; } return sting; err: if(sting != NULL) scamper_sting_free(sting); if(opts_out != NULL) scamper_options_free(opts_out); return NULL; } /* * scamper_do_sting_arg_validate * * */ int scamper_do_sting_arg_validate(int argc, char *argv[], int *stop) { return scamper_options_validate(opts, opts_cnt, argc, argv, stop, sting_arg_param_validate); } void scamper_do_sting_free(void *data) { scamper_sting_free((scamper_sting_t *)data); return; } /* * scamper_do_sting_alloctask * */ scamper_task_t *scamper_do_sting_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle) { scamper_sting_t *sting = (scamper_sting_t *)data; scamper_task_sig_t *sig = NULL; scamper_task_t *task = NULL; /* allocate a task structure and store the sting with it */ if((task = scamper_task_alloc(sting, &sting_funcs)) == NULL) goto err; /* declare the signature of the sting task */ if((sig = scamper_task_sig_alloc(SCAMPER_TASK_SIG_TYPE_TX_IP)) == NULL) goto err; sig->sig_tx_ip_dst = scamper_addr_use(sting->dst); if(sting->src == NULL && (sting->src = scamper_getsrc(sting->dst,0)) == NULL) goto err; sig->sig_tx_ip_src = scamper_addr_use(sting->src); if(scamper_task_sig_add(task, sig) != 0) goto err; sig = NULL; /* associate the list and cycle with the sting */ sting->list = scamper_list_use(list); sting->cycle = scamper_cycle_use(cycle); return task; err: if(sig != NULL) scamper_task_sig_free(sig); if(task != NULL) { scamper_task_setdatanull(task); scamper_task_free(task); } return NULL; } void scamper_do_sting_cleanup(void) { return; } int scamper_do_sting_init(void) { sting_funcs.probe = do_sting_probe; sting_funcs.handle_icmp = NULL; sting_funcs.handle_dl = do_sting_handle_dl; sting_funcs.handle_timeout = do_sting_handle_timeout; sting_funcs.write = do_sting_write; sting_funcs.task_free = do_sting_free; sting_funcs.halt = do_sting_halt; return 0; } scamper-cvs-20171204/scamper/sting/scamper_sting_do.h000644 001751 000000 00000003012 11737356726 022377 0ustar00mjlwheel000000 000000 /* * scamper_do_sting.h * * $Id: scamper_sting_do.h,v 1.4 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2008-2010 The University of Waikato * Author: Matthew Luckie * * This file implements algorithms described in the sting-0.7 source code, * as well as the paper: * * Sting: a TCP-based Network Measurement Tool * by Stefan Savage * 1999 USENIX Symposium on Internet Technologies and Systems * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DO_STING_H #define __SCAMPER_DO_STING_H void *scamper_do_sting_alloc(char *str); scamper_task_t *scamper_do_sting_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle); int scamper_do_sting_arg_validate(int argc, char *argv[], int *stop); void scamper_do_sting_free(void *); const char *scamper_do_sting_usage(void); void scamper_do_sting_cleanup(void); int scamper_do_sting_init(void); #endif /*__SCAMPER_DO_STING_H */ scamper-cvs-20171204/scamper/sting/scamper_sting_text.c000644 001751 000000 00000004157 11456770441 022757 0ustar00mjlwheel000000 000000 /* * scamper_sting_text.c * * Copyright (C) 2008-2010 The University of Waikato * Author: Matthew Luckie * * $Id: scamper_sting_text.c,v 1.2 2010/10/18 07:02:57 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_sting_text.c,v 1.2 2010/10/18 07:02:57 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_sting.h" #include "scamper_file.h" #include "scamper_sting_text.h" #include "utils.h" int scamper_file_text_sting_write(const scamper_file_t *sf, const scamper_sting_t *sting) { int fd = scamper_file_getfd(sf); char buf[192], src[64], dst[64]; size_t len; uint32_t i, txc = 0; snprintf(buf, sizeof(buf), "sting from %s:%d to %s:%d, %d probes, %dms mean\n" " data-ack count %d, holec %d\n", scamper_addr_tostr(sting->src, src, sizeof(src)), sting->sport, scamper_addr_tostr(sting->dst, dst, sizeof(dst)), sting->dport, sting->count, sting->mean, sting->dataackc, sting->holec); len = strlen(buf); write_wrap(fd, buf, NULL, len); if(sting->holec > 0) { for(i=0; ipktc; i++) { if((sting->pkts[i]->flags & SCAMPER_STING_PKT_FLAG_DATA) == 0) continue; txc++; if(sting->pkts[i]->flags & SCAMPER_STING_PKT_FLAG_HOLE) { snprintf(buf, sizeof(buf), " probe %d hole\n", txc); len = strlen(buf); write_wrap(fd, buf, NULL, len); } } } return 0; } scamper-cvs-20171204/scamper/sting/scamper_sting_text.h000644 001751 000000 00000002011 11452510530 022732 0ustar00mjlwheel000000 000000 /* * scamper_sting_text.h * * Copyright (C) 2008-2010 The University of Waikato * Author: Matthew Luckie * * $Id: scamper_sting_text.h,v 1.1 2010/10/05 02:45:44 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_STING_TEXT_H #define __SCAMPER_STING_TEXT_H int scamper_file_text_sting_write(const scamper_file_t *sf, const scamper_sting_t *sting); #endif /* __SCAMPER_STING_TEXT_H */ scamper-cvs-20171204/scamper/sting/scamper_sting_warts.c000644 001751 000000 00000034607 13020235506 023121 0ustar00mjlwheel000000 000000 /* * scamper_sting_warts.c * * Copyright (C) 2010-2011 The University of Waikato * Copyright (C) 2012-2014 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * $Id: scamper_sting_warts.c,v 1.9 2016/12/02 09:13:42 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_sting_warts.c,v 1.9 2016/12/02 09:13:42 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_sting.h" #include "scamper_file.h" #include "scamper_file_warts.h" #include "scamper_sting_warts.h" #include "utils.h" #define WARTS_STING_LIST 1 #define WARTS_STING_CYCLE 2 #define WARTS_STING_USERID 3 #define WARTS_STING_SRC 4 #define WARTS_STING_DST 5 #define WARTS_STING_SPORT 6 #define WARTS_STING_DPORT 7 #define WARTS_STING_COUNT 8 #define WARTS_STING_MEAN 9 #define WARTS_STING_INTER 10 #define WARTS_STING_DIST 11 #define WARTS_STING_SYNRETX 12 #define WARTS_STING_DATARETX 13 #define WARTS_STING_SEQSKIP 14 #define WARTS_STING_DATALEN 15 #define WARTS_STING_DATA 16 #define WARTS_STING_START 17 #define WARTS_STING_HSRTT 18 #define WARTS_STING_DATAACKC 19 #define WARTS_STING_HOLEC 20 #define WARTS_STING_PKTC 21 #define WARTS_STING_RESULT 22 static const warts_var_t sting_vars[] = { {WARTS_STING_LIST, 4, -1}, {WARTS_STING_CYCLE, 4, -1}, {WARTS_STING_USERID, 4, -1}, {WARTS_STING_SRC, -1, -1}, {WARTS_STING_DST, -1, -1}, {WARTS_STING_SPORT, 2, -1}, {WARTS_STING_DPORT, 2, -1}, {WARTS_STING_COUNT, 2, -1}, {WARTS_STING_MEAN, 2, -1}, {WARTS_STING_INTER, 2, -1}, {WARTS_STING_DIST, 1, -1}, {WARTS_STING_SYNRETX, 1, -1}, {WARTS_STING_DATARETX, 1, -1}, {WARTS_STING_SEQSKIP, 1, -1}, {WARTS_STING_DATALEN, 2, -1}, {WARTS_STING_DATA, -1, -1}, {WARTS_STING_START, 8, -1}, {WARTS_STING_HSRTT, 8, -1}, {WARTS_STING_DATAACKC, 2, -1}, {WARTS_STING_HOLEC, 2, -1}, {WARTS_STING_PKTC, 4, -1}, {WARTS_STING_RESULT, 1, -1}, }; #define sting_vars_mfb WARTS_VAR_MFB(sting_vars) #define WARTS_STING_PKT_FLAGS 1 #define WARTS_STING_PKT_TIME 2 #define WARTS_STING_PKT_DATALEN 3 #define WARTS_STING_PKT_DATA 4 static const warts_var_t sting_pkt_vars[] = { {WARTS_STING_PKT_FLAGS, 1, -1}, {WARTS_STING_PKT_TIME, 8, -1}, {WARTS_STING_PKT_DATALEN, 2, -1}, {WARTS_STING_PKT_DATA, -1, -1}, }; #define sting_pkt_vars_mfb WARTS_VAR_MFB(sting_pkt_vars) typedef struct warts_sting_pkt { uint8_t flags[sting_pkt_vars_mfb]; uint16_t flags_len; uint16_t params_len; } warts_sting_pkt_t; static void warts_sting_pkt_params(const scamper_sting_pkt_t *pkt, warts_sting_pkt_t *state, uint32_t *len) { const warts_var_t *var; int max_id = 0; uint16_t i; memset(state->flags, 0, sting_pkt_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_STING_PKT_DATA) { if(pkt->len == 0) continue; state->params_len += pkt->len; flag_set(state->flags, var->id, &max_id); continue; } assert(var->size >= 0); state->params_len += var->size; flag_set(state->flags, var->id, &max_id); } state->flags_len = fold_flags(state->flags, max_id); *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return; } static scamper_sting_pkt_t *warts_sting_pkt_read(warts_state_t *state, uint8_t *buf, uint32_t *off, uint32_t len) { scamper_sting_pkt_t *pkt = NULL; uint8_t flags, *data = NULL; struct timeval tv; uint16_t plen; warts_param_reader_t handlers[] = { {&flags, (wpr_t)extract_byte, NULL}, {&tv, (wpr_t)extract_timeval, NULL}, {&plen, (wpr_t)extract_uint16, NULL}, {&data, (wpr_t)extract_bytes_ptr, &plen}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0 || (pkt = scamper_sting_pkt_alloc(flags, data, plen, &tv)) == NULL) goto err; return pkt; err: if(pkt != NULL) scamper_sting_pkt_free(pkt); return NULL; } static int warts_sting_pkt_write(const scamper_sting_pkt_t *pkt, const scamper_file_t *sf, uint8_t *buf, uint32_t *off, const uint32_t len, warts_sting_pkt_t *state) { uint16_t dl = pkt->len; warts_param_writer_t handlers[] = { {&pkt->flags, (wpw_t)insert_byte, NULL}, {&pkt->tv, (wpw_t)insert_timeval, NULL}, {&pkt->len, (wpw_t)insert_uint16, NULL}, {pkt->data, (wpw_t)insert_bytes_uint16, &dl}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return 0; } static void warts_sting_params(const scamper_sting_t *sting, warts_addrtable_t *table, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { const warts_var_t *var; int i, max_id = 0; /* Unset all flags */ memset(flags, 0, sting_vars_mfb); *params_len = 0; for(i=0; iid == WARTS_STING_LIST && sting->list == NULL) continue; else if(var->id == WARTS_STING_CYCLE && sting->cycle == NULL) continue; else if(var->id == WARTS_STING_USERID && sting->userid == 0) continue; else if(var->id == WARTS_STING_SRC && sting->src == NULL) continue; else if(var->id == WARTS_STING_DST && sting->dst == NULL) continue; else if(var->id == WARTS_STING_DATA && sting->datalen == 0) continue; else if(var->id == WARTS_STING_RESULT && sting->result == 0) continue; /* Set the flag for the rest of the variables */ flag_set(flags, var->id, &max_id); /* Variables that don't have a fixed size */ if(var->id == WARTS_STING_SRC) { *params_len += warts_addr_size(table, sting->src); continue; } else if(var->id == WARTS_STING_DST) { *params_len += warts_addr_size(table, sting->dst); continue; } else if(var->id == WARTS_STING_DATA) { *params_len += sting->datalen; continue; } /* The rest of the variables have a fixed size */ *params_len += var->size; } *flags_len = fold_flags(flags, max_id); return; } static int warts_sting_params_read(scamper_sting_t *sting, warts_addrtable_t *table, warts_state_t *state, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&sting->list, (wpr_t)extract_list, state}, {&sting->cycle, (wpr_t)extract_cycle, state}, {&sting->userid, (wpr_t)extract_uint32, NULL}, {&sting->src, (wpr_t)extract_addr, table}, {&sting->dst, (wpr_t)extract_addr, table}, {&sting->sport, (wpr_t)extract_uint16, NULL}, {&sting->dport, (wpr_t)extract_uint16, NULL}, {&sting->count, (wpr_t)extract_uint16, NULL}, {&sting->mean, (wpr_t)extract_uint16, NULL}, {&sting->inter, (wpr_t)extract_uint16, NULL}, {&sting->dist, (wpr_t)extract_byte, NULL}, {&sting->synretx, (wpr_t)extract_byte, NULL}, {&sting->dataretx, (wpr_t)extract_byte, NULL}, {&sting->seqskip, (wpr_t)extract_byte, NULL}, {&sting->datalen, (wpr_t)extract_uint16, NULL}, {&sting->data, (wpr_t)extract_bytes_alloc, &sting->datalen}, {&sting->start, (wpr_t)extract_timeval, NULL}, {&sting->hsrtt, (wpr_t)extract_timeval, NULL}, {&sting->dataackc, (wpr_t)extract_uint16, NULL}, {&sting->holec, (wpr_t)extract_uint16, NULL}, {&sting->pktc, (wpr_t)extract_uint32, NULL}, {&sting->result, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); int rc; if((rc = warts_params_read(buf, off, len, handlers, handler_cnt)) != 0) return rc; if(sting->src == NULL || sting->dst == NULL) return -1; return 0; } static int warts_sting_params_write(const scamper_sting_t *sting, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len) { uint32_t list_id, cycle_id; uint16_t dl = sting->datalen; /* Specifies how to write each variable to the warts file. */ warts_param_writer_t handlers[] = { {&list_id, (wpw_t)insert_uint32, NULL}, {&cycle_id, (wpw_t)insert_uint32, NULL}, {&sting->userid, (wpw_t)insert_uint32, NULL}, {sting->src, (wpw_t)insert_addr, table}, {sting->dst, (wpw_t)insert_addr, table}, {&sting->sport, (wpw_t)insert_uint16, NULL}, {&sting->dport, (wpw_t)insert_uint16, NULL}, {&sting->count, (wpw_t)insert_uint16, NULL}, {&sting->mean, (wpw_t)insert_uint16, NULL}, {&sting->inter, (wpw_t)insert_uint16, NULL}, {&sting->dist, (wpw_t)insert_byte, NULL}, {&sting->synretx, (wpw_t)insert_byte, NULL}, {&sting->dataretx, (wpw_t)insert_byte, NULL}, {&sting->seqskip, (wpw_t)insert_byte, NULL}, {&sting->datalen, (wpw_t)insert_uint16, NULL}, {&sting->data, (wpw_t)insert_bytes_uint16, &dl}, {&sting->start, (wpw_t)insert_timeval, NULL}, {&sting->hsrtt, (wpw_t)insert_timeval, NULL}, {&sting->dataackc, (wpw_t)insert_uint16, NULL}, {&sting->holec, (wpw_t)insert_uint16, NULL}, {&sting->pktc, (wpw_t)insert_uint32, NULL}, {&sting->result, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); if(warts_list_getid(sf, sting->list, &list_id) == -1) return -1; if(warts_cycle_getid(sf, sting->cycle, &cycle_id) == -1) return -1; warts_params_write(buf, off, len, flags, flags_len, params_len, handlers, handler_cnt); return 0; } int scamper_file_warts_sting_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_sting_t **sting_out) { scamper_sting_t *sting = NULL; warts_addrtable_t *table = NULL; warts_state_t *state = scamper_file_getstate(sf); uint8_t *buf = NULL; uint32_t off = 0; uint32_t i; /* Read in the header */ if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { *sting_out = NULL; return 0; } /* Allocate space for a sting object */ if((sting = scamper_sting_alloc()) == NULL) { goto err; } if((table = warts_addrtable_alloc_byid()) == NULL) goto err; /* Read in the sting data from the warts file */ if(warts_sting_params_read(sting, table, state, buf, &off, hdr->len) != 0) { goto err; } /* Determine how many sting pkts to read */ if(sting->pktc > 0) { /* Allocate the sting pkts array */ if(scamper_sting_pkts_alloc(sting, sting->pktc) != 0) { goto err; } /* * for each sting packet, read it and insert it into the sting * structure */ for(i=0; ipktc; i++) { sting->pkts[i] = warts_sting_pkt_read(state, buf, &off, hdr->len); if(sting->pkts[i] == NULL) { goto err; } } } warts_addrtable_free(table); *sting_out = sting; free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(buf != NULL) free(buf); if(sting != NULL) scamper_sting_free(sting); return -1; } /* Write data from a scamper sting object to a warts file */ int scamper_file_warts_sting_write(const scamper_file_t *sf, const scamper_sting_t *sting) { warts_addrtable_t *table = NULL; warts_sting_pkt_t *pkts = NULL; uint8_t *buf = NULL; uint8_t flags[sting_vars_mfb]; uint16_t flags_len, params_len; uint32_t len, i, off = 0; size_t size; if((table = warts_addrtable_alloc_byaddr()) == NULL) goto err; /* Set the sting data (not including the packets) */ warts_sting_params(sting, table, flags, &flags_len, ¶ms_len); len = 8 + flags_len + params_len + 2; if(sting->pktc > 0) { /* Allocate memory for the state */ size = sting->pktc * sizeof(warts_sting_pkt_t); if((pkts = (warts_sting_pkt_t *)malloc_zero(size)) == NULL) goto err; for(i=0; ipktc; i++) warts_sting_pkt_params(sting->pkts[i], &pkts[i], &len); } /* Allocate memory to store all of the data (including packets) */ if((buf = malloc_zero(len)) == NULL) goto err; insert_wartshdr(buf, &off, len, SCAMPER_FILE_OBJ_STING); /* Write the sting data (excluding packets) to the buffer */ if(warts_sting_params_write(sting, sf, table, buf, &off, len, flags, flags_len, params_len) != 0) { goto err; } if(sting->pktc > 0) { for(i=0; ipktc; i++) warts_sting_pkt_write(sting->pkts[i], sf, buf, &off, len, &pkts[i]); free(pkts); pkts = NULL; } assert(off == len); /* Write the whole buffer to a warts file */ if(warts_write(sf, buf, len) == -1) goto err; warts_addrtable_free(table); free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(pkts != NULL) free(pkts); if(buf != NULL) free(buf); return -1; } scamper-cvs-20171204/scamper/sting/scamper_sting_warts.h000644 001751 000000 00000002105 11456770441 023127 0ustar00mjlwheel000000 000000 /* * scamper_sting_warts.h * * $Id: scamper_sting_warts.h,v 1.1 2010/10/18 07:02:57 mjl Exp $ * * Copyright (C) 2010 University of Waikato * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the replye that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_STING_WARTS_H #define __SCAMPER_STING_WARTS_H int scamper_file_warts_sting_write(const scamper_file_t *sf, const scamper_sting_t *sting); int scamper_file_warts_sting_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_sting_t **sting_out); #endif scamper-cvs-20171204/scamper/sniff/.cvsignore000644 001751 000000 00000000034 12415633115 020650 0ustar00mjlwheel000000 000000 .deps .dirstamp .libs *.lo scamper-cvs-20171204/scamper/sniff/scamper_sniff.c000644 001751 000000 00000004726 12767153552 021663 0ustar00mjlwheel000000 000000 /* * scamper_sniff.c * * $Id: scamper_sniff.c,v 1.2 2016/09/17 05:40:58 mjl Exp $ * * Copyright (C) 2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_sniff.c,v 1.2 2016/09/17 05:40:58 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_list.h" #include "scamper_addr.h" #include "scamper_sniff.h" #include "utils.h" scamper_sniff_pkt_t *scamper_sniff_pkt_alloc(uint8_t *data, uint16_t len, struct timeval *tv) { scamper_sniff_pkt_t *pkt; if((pkt = malloc_zero(sizeof(scamper_sniff_pkt_t))) == NULL) goto err; if(len != 0 && data != NULL) { if((pkt->data = memdup(data, len)) == NULL) goto err; pkt->len = len; } if(tv != NULL) timeval_cpy(&pkt->tv, tv); return pkt; err: free(pkt); return NULL; } void scamper_sniff_pkt_free(scamper_sniff_pkt_t *pkt) { if(pkt == NULL) return; if(pkt->data != NULL) free(pkt->data); free(pkt); return; } scamper_sniff_t *scamper_sniff_alloc(void) { return malloc_zero(sizeof(scamper_sniff_t)); } void scamper_sniff_free(scamper_sniff_t *sniff) { uint32_t i; if(sniff == NULL) return; if(sniff->list != NULL) scamper_list_free(sniff->list); if(sniff->cycle != NULL) scamper_cycle_free(sniff->cycle); if(sniff->src != NULL) scamper_addr_free(sniff->src); if(sniff->pkts != NULL) { for(i=0; ipktc; i++) if(sniff->pkts[i] != NULL) scamper_sniff_pkt_free(sniff->pkts[i]); free(sniff->pkts); } free(sniff); return; } int scamper_sniff_pkts_alloc(scamper_sniff_t *sniff, int pktc) { size_t size = pktc * sizeof(scamper_sniff_pkt_t *); if((sniff->pkts = (scamper_sniff_pkt_t **)malloc_zero(size)) == NULL) return -1; sniff->pktc = pktc; return 0; } scamper-cvs-20171204/scamper/sniff/scamper_sniff.h000644 001751 000000 00000003774 11600524176 021657 0ustar00mjlwheel000000 000000 /* * scamper_sniff.h * * $Id: scamper_sniff.h,v 1.3 2011/06/23 02:44:14 mjl Exp $ * * Copyright (C) 2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_SNIFF_H #define __SCAMPER_SNIFF_H #define SCAMPER_SNIFF_STOP_NONE 0x00 #define SCAMPER_SNIFF_STOP_ERROR 0x01 #define SCAMPER_SNIFF_STOP_LIMIT_TIME 0x02 #define SCAMPER_SNIFF_STOP_LIMIT_PKTC 0x03 #define SCAMPER_SNIFF_STOP_HALTED 0x04 typedef struct scamper_sniff_pkt { struct timeval tv; uint8_t *data; uint16_t len; } scamper_sniff_pkt_t; typedef struct scamper_sniff { scamper_list_t *list; scamper_cycle_t *cycle; uint32_t userid; struct timeval start; struct timeval finish; uint8_t stop_reason; uint32_t limit_pktc; uint16_t limit_time; scamper_addr_t *src; uint16_t icmpid; scamper_sniff_pkt_t **pkts; uint32_t pktc; } scamper_sniff_t; scamper_sniff_t *scamper_sniff_alloc(void); void scamper_sniff_free(scamper_sniff_t *); scamper_sniff_pkt_t *scamper_sniff_pkt_alloc(uint8_t *data, uint16_t len, struct timeval *tv); void scamper_sniff_pkt_free(scamper_sniff_pkt_t *pkt); int scamper_sniff_pkts_alloc(scamper_sniff_t *sniff, int pktc); #endif /* __SCAMPER_SNIFF_H */ scamper-cvs-20171204/scamper/sniff/scamper_sniff_do.c000644 001751 000000 00000025101 13210743023 022311 0ustar00mjlwheel000000 000000 /* * scamper_sniff_do.c * * $Id: scamper_sniff_do.c,v 1.14 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2011 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_sniff_do.c,v 1.14 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_sniff.h" #include "scamper_fds.h" #include "scamper_dl.h" #include "scamper_task.h" #include "scamper_options.h" #include "scamper_if.h" #include "scamper_queue.h" #include "scamper_file.h" #include "scamper_debug.h" #include "scamper_sniff_do.h" #include "mjl_list.h" #include "utils.h" typedef struct sniff_state { scamper_fd_t *fd; slist_t *list; } sniff_state_t; /* the callback functions registered with the sniff task */ static scamper_task_funcs_t sniff_funcs; /* Address cache used to avoid reallocating the same address multiple times */ extern scamper_addrcache_t *addrcache; #define SNIFF_OPT_LIMIT_PKTC 1 #define SNIFF_OPT_LIMIT_TIME 2 #define SNIFF_OPT_SRCADDR 3 #define SNIFF_OPT_USERID 4 static const scamper_option_in_t opts[] = { {'c', NULL, SNIFF_OPT_LIMIT_PKTC, SCAMPER_OPTION_TYPE_NUM}, {'G', NULL, SNIFF_OPT_LIMIT_TIME, SCAMPER_OPTION_TYPE_NUM}, {'S', NULL, SNIFF_OPT_SRCADDR, SCAMPER_OPTION_TYPE_STR}, {'U', NULL, SNIFF_OPT_USERID, SCAMPER_OPTION_TYPE_NUM}, }; static const int opts_cnt = SCAMPER_OPTION_COUNT(opts); const char *scamper_do_sniff_usage(void) { return "sniff [-c limit-pktc] [-G limit-time] [-S ipaddr] [-U userid] \n"; } static scamper_sniff_t *sniff_getdata(const scamper_task_t *task) { return scamper_task_getdata(task); } static sniff_state_t *sniff_getstate(const scamper_task_t *task) { return scamper_task_getstate(task); } static void sniff_finish(scamper_task_t *task, int reason) { scamper_sniff_t *sniff = sniff_getdata(task); sniff_state_t *state = sniff_getstate(task); scamper_sniff_pkt_t *pkt; int i, rc; gettimeofday_wrap(&sniff->finish); if(state != NULL && state->list != NULL && (rc=slist_count(state->list)) > 0) { if(scamper_sniff_pkts_alloc(sniff, rc) != 0) { sniff->stop_reason = SCAMPER_SNIFF_STOP_ERROR; scamper_task_queue_done(task, 0); return; } i = 0; while((pkt = slist_head_pop(state->list)) != NULL) sniff->pkts[i++] = pkt; assert(i == rc); } sniff->stop_reason = reason; scamper_task_queue_done(task, 0); return; } static void do_sniff_handle_dl(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_sniff_t *sniff = sniff_getdata(task); sniff_state_t *state = sniff_getstate(task); scamper_sniff_pkt_t *pkt; int cap = 0; if(SCAMPER_DL_IS_ICMP(dl)) { if((SCAMPER_DL_IS_ICMP_ECHO(dl) && dl->dl_icmp_id == sniff->icmpid && scamper_addr_raw_cmp(sniff->src, dl->dl_ip_dst) == 0) || (SCAMPER_DL_IS_ICMP_Q_ICMP_ECHO(dl) && dl->dl_icmp_icmp_id == sniff->icmpid && scamper_addr_raw_cmp(sniff->src, dl->dl_icmp_ip_src) == 0)) cap = 1; } if(cap == 0) return; pkt = scamper_sniff_pkt_alloc(dl->dl_net_raw, dl->dl_ip_size, &dl->dl_tv); if(pkt == NULL) { printerror(__func__, "could not alloc pkt"); goto err; } if(slist_tail_push(state->list, pkt) == NULL) { printerror(__func__, "could not push pkt"); goto err; } if(slist_count(state->list) >= sniff->limit_pktc) sniff_finish(task, SCAMPER_SNIFF_STOP_LIMIT_PKTC); return; err: sniff_finish(task, SCAMPER_SNIFF_STOP_ERROR); return; } static void do_sniff_handle_timeout(scamper_task_t *task) { sniff_finish(task, SCAMPER_SNIFF_STOP_LIMIT_TIME); return; } static void sniff_state_free(sniff_state_t *state) { if(state == NULL) return; if(state->fd != NULL) scamper_fd_free(state->fd); if(state->list != NULL) slist_free(state->list); free(state); return; } static int sniff_state_alloc(scamper_task_t *task) { scamper_sniff_t *sniff = sniff_getdata(task); sniff_state_t *state = NULL; struct sockaddr_storage sas; int ifindex; assert(sniff->src != NULL); if(sniff->src->type == SCAMPER_ADDR_TYPE_IPV4) sockaddr_compose((struct sockaddr *)&sas, AF_INET, sniff->src->addr, 0); else if(sniff->src->type == SCAMPER_ADDR_TYPE_IPV6) sockaddr_compose((struct sockaddr *)&sas, AF_INET6, sniff->src->addr, 0); else goto err; if(scamper_if_getifindex_byaddr((struct sockaddr *)&sas, &ifindex) != 0) goto err; if((state = malloc_zero(sizeof(sniff_state_t))) == NULL) goto err; if((state->list = slist_alloc()) == NULL) { printerror(__func__, "could not alloc list"); goto err; } if((state->fd = scamper_fd_dl(ifindex)) == NULL) { printerror(__func__, "could not get dl"); goto err; } scamper_task_setstate(task, state); return 0; err: if(state != NULL) sniff_state_free(state); return -1; } static void do_sniff_probe(scamper_task_t *task) { scamper_sniff_t *sniff = sniff_getdata(task); struct timeval tv; assert(sniff_getstate(task) == NULL); gettimeofday_wrap(&sniff->start); if(sniff_state_alloc(task) != 0) { sniff_finish(task, SCAMPER_SNIFF_STOP_ERROR); return; } timeval_add_s(&tv, &sniff->start, sniff->limit_time); scamper_task_queue_wait_tv(task, &tv); return; } static void do_sniff_write(scamper_file_t *sf, scamper_task_t *task) { scamper_file_write_sniff(sf, sniff_getdata(task)); return; } static int sniff_arg_param_validate(int optid, char *param, long *out) { long tmp = 0; switch(optid) { case SNIFF_OPT_SRCADDR: break; case SNIFF_OPT_LIMIT_PKTC: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 5000) goto err; break; case SNIFF_OPT_LIMIT_TIME: if(string_tolong(param, &tmp) != 0 || tmp < 0 || tmp > 1200) goto err; break; case SNIFF_OPT_USERID: if(string_tolong(param, &tmp) != 0 || tmp < 0) goto err; break; default: return -1; } if(out != NULL) *out = tmp; return 0; err: return -1; } int scamper_do_sniff_arg_validate(int argc, char *argv[], int *stop) { return scamper_options_validate(opts, opts_cnt, argc, argv, stop, sniff_arg_param_validate); } void *scamper_do_sniff_alloc(char *str) { scamper_option_out_t *opts_out = NULL, *opt; scamper_sniff_t *sniff = NULL; uint32_t userid = 0; uint32_t limit_pktc = 100; uint16_t limit_time = 60; long icmpid = -1; char *expr = NULL; char *src = NULL; long tmp = 0; /* try and parse the string passed in */ if(scamper_options_parse(str, opts, opts_cnt, &opts_out, &expr) != 0) goto err; if(expr == NULL) goto err; if(strncasecmp(expr, "icmp[icmpid] == ", 16) != 0 || string_isnumber(expr+16) == 0 || string_tolong(expr+16, &icmpid) != 0 || icmpid < 0 || icmpid > 65535) { scamper_debug(__func__, "icmp[icmpid] not supplied"); goto err; } /* parse the options, do preliminary sanity checks */ for(opt = opts_out; opt != NULL; opt = opt->next) { if(opt->type != SCAMPER_OPTION_TYPE_NULL && sniff_arg_param_validate(opt->id, opt->str, &tmp) != 0) { scamper_debug(__func__, "validation of optid %d failed", opt->id); goto err; } switch(opt->id) { case SNIFF_OPT_SRCADDR: src = opt->str; break; case SNIFF_OPT_USERID: userid = (uint32_t)tmp; break; case SNIFF_OPT_LIMIT_TIME: limit_time = (uint16_t)tmp; break; case SNIFF_OPT_LIMIT_PKTC: limit_pktc = (uint32_t)tmp; break; } } scamper_options_free(opts_out); opts_out = NULL; if(src == NULL) { printerror(__func__, "missing -S parameter"); goto err; } if((sniff = scamper_sniff_alloc()) == NULL) goto err; if((sniff->src = scamper_addrcache_resolve(addrcache,AF_UNSPEC,src)) == NULL) { printerror(__func__, "could not resolve %s", src); goto err; } sniff->limit_pktc = limit_pktc; sniff->limit_time = limit_time; sniff->userid = userid; sniff->icmpid = (uint16_t)icmpid; return sniff; err: if(sniff != NULL) scamper_sniff_free(sniff); if(opts_out != NULL) scamper_options_free(opts_out); return NULL; } static void do_sniff_halt(scamper_task_t *task) { sniff_finish(task, SCAMPER_SNIFF_STOP_HALTED); return; } static void do_sniff_free(scamper_task_t *task) { scamper_sniff_t *sniff; sniff_state_t *state; if((sniff = sniff_getdata(task)) != NULL) scamper_sniff_free(sniff); if((state = sniff_getstate(task)) != NULL) sniff_state_free(state); return; } scamper_task_t *scamper_do_sniff_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle) { scamper_sniff_t *sniff = (scamper_sniff_t *)data; scamper_task_t *task = NULL; scamper_task_sig_t *sig = NULL; /* allocate a task structure and store the sniff with it */ if((task = scamper_task_alloc(sniff, &sniff_funcs)) == NULL) goto err; /* task signature */ if((sig = scamper_task_sig_alloc(SCAMPER_TASK_SIG_TYPE_SNIFF)) == NULL) goto err; sig->sig_sniff_src = scamper_addr_use(sniff->src); sig->sig_sniff_icmp_id = sniff->icmpid; if(scamper_task_sig_add(task, sig) != 0) goto err; sig = NULL; /* associate the list and cycle with the sniff */ sniff->list = scamper_list_use(list); sniff->cycle = scamper_cycle_use(cycle); return task; err: if(sig != NULL) scamper_task_sig_free(sig); if(task != NULL) { scamper_task_setdatanull(task); scamper_task_free(task); } return NULL; } void scamper_do_sniff_free(void *data) { scamper_sniff_free((scamper_sniff_t *)data); return; } void scamper_do_sniff_cleanup() { return; } int scamper_do_sniff_init() { sniff_funcs.probe = do_sniff_probe; sniff_funcs.handle_timeout = do_sniff_handle_timeout; sniff_funcs.handle_dl = do_sniff_handle_dl; sniff_funcs.write = do_sniff_write; sniff_funcs.task_free = do_sniff_free; sniff_funcs.halt = do_sniff_halt; return 0; } scamper-cvs-20171204/scamper/sniff/scamper_sniff_do.h000644 001751 000000 00000002425 11524661325 022334 0ustar00mjlwheel000000 000000 /* * scamper_sniff_do.h * * $Id: scamper_sniff_do.h,v 1.1 2011/02/10 04:00:21 mjl Exp $ * * Copyright (C) 2011 University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DO_SNIFF_H #define __SCAMPER_DO_SNIFF_H const char *scamper_do_sniff_usage(void); void *scamper_do_sniff_alloc(char *str); void scamper_do_sniff_free(void *data); scamper_task_t *scamper_do_sniff_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle); int scamper_do_sniff_arg_validate(int argc, char *argv[], int *stop); void scamper_do_sniff_cleanup(void); int scamper_do_sniff_init(void); #endif /*__SCAMPER_DO_SNIFF_H */ scamper-cvs-20171204/scamper/sniff/scamper_sniff_warts.c000644 001751 000000 00000027275 13022467213 023072 0ustar00mjlwheel000000 000000 /* * scamper_sniff_warts.c * * Copyright (C) 2011 The University of Waikato * Copyright (C) 2014 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * $Id: scamper_sniff_warts.c,v 1.9 2016/12/09 08:42:51 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_sniff_warts.c,v 1.9 2016/12/09 08:42:51 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_sniff.h" #include "scamper_file.h" #include "scamper_file_warts.h" #include "scamper_sniff_warts.h" #include "utils.h" #define WARTS_SNIFF_LIST 1 #define WARTS_SNIFF_CYCLE 2 #define WARTS_SNIFF_USERID 3 #define WARTS_SNIFF_SRC 4 #define WARTS_SNIFF_START 5 #define WARTS_SNIFF_FINISH 6 #define WARTS_SNIFF_STOP_REASON 7 #define WARTS_SNIFF_LIMIT_PKTC 8 #define WARTS_SNIFF_LIMIT_TIME 9 #define WARTS_SNIFF_PKTC 10 #define WARTS_SNIFF_ICMPID 11 static const warts_var_t sniff_vars[] = { {WARTS_SNIFF_LIST, 4, -1}, {WARTS_SNIFF_CYCLE, 4, -1}, {WARTS_SNIFF_USERID, 4, -1}, {WARTS_SNIFF_SRC, -1, -1}, {WARTS_SNIFF_START, 8, -1}, {WARTS_SNIFF_FINISH, 8, -1}, {WARTS_SNIFF_STOP_REASON, 1, -1}, {WARTS_SNIFF_LIMIT_PKTC, 4, -1}, {WARTS_SNIFF_LIMIT_TIME, 2, -1}, {WARTS_SNIFF_PKTC, 4, -1}, {WARTS_SNIFF_ICMPID, 2, -1}, }; #define sniff_vars_mfb WARTS_VAR_MFB(sniff_vars) #define WARTS_SNIFF_PKT_TIME 1 #define WARTS_SNIFF_PKT_DATALEN 2 #define WARTS_SNIFF_PKT_DATA 3 static const warts_var_t sniff_pkt_vars[] = { {WARTS_SNIFF_PKT_TIME, 8, -1}, {WARTS_SNIFF_PKT_DATALEN, 2, -1}, {WARTS_SNIFF_PKT_DATA, -1, -1}, }; #define sniff_pkt_vars_mfb WARTS_VAR_MFB(sniff_pkt_vars) typedef struct warts_sniff_pkt { uint8_t flags[sniff_pkt_vars_mfb]; uint16_t flags_len; uint16_t params_len; } warts_sniff_pkt_t; static void warts_sniff_pkt_params(const scamper_sniff_pkt_t *pkt, warts_sniff_pkt_t *state, uint32_t *len) { const warts_var_t *var; int max_id = 0; uint16_t i; memset(state->flags, 0, sniff_pkt_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_SNIFF_PKT_DATA) { if(pkt->len == 0) continue; state->params_len += pkt->len; flag_set(state->flags, var->id, &max_id); continue; } assert(var->size >= 0); state->params_len += var->size; flag_set(state->flags, var->id, &max_id); } state->flags_len = fold_flags(state->flags, max_id); *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return; } static scamper_sniff_pkt_t *warts_sniff_pkt_read(warts_state_t *state, uint8_t *buf, uint32_t *off, uint32_t len) { scamper_sniff_pkt_t *pkt = NULL; uint8_t *data = NULL; struct timeval tv; uint16_t plen; warts_param_reader_t handlers[] = { {&tv, (wpr_t)extract_timeval, NULL}, {&plen, (wpr_t)extract_uint16, NULL}, {&data, (wpr_t)extract_bytes_ptr, &plen}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0 || plen == 0 || data == NULL || (pkt = scamper_sniff_pkt_alloc(data, plen, &tv)) == NULL) goto err; return pkt; err: if(pkt != NULL) scamper_sniff_pkt_free(pkt); return NULL; } static int warts_sniff_pkt_write(const scamper_sniff_pkt_t *pkt, const scamper_file_t *sf, uint8_t *buf, uint32_t *off, const uint32_t len, warts_sniff_pkt_t *state) { uint16_t dl = pkt->len; warts_param_writer_t handlers[] = { {&pkt->tv, (wpw_t)insert_timeval, NULL}, {&pkt->len, (wpw_t)insert_uint16, NULL}, {pkt->data, (wpw_t)insert_bytes_uint16, &dl}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return 0; } static void warts_sniff_params(const scamper_sniff_t *sniff, warts_addrtable_t *table, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { const warts_var_t *var; int i, max_id = 0; /* Unset all flags */ memset(flags, 0, sniff_vars_mfb); *params_len = 0; for(i=0; iid == WARTS_SNIFF_LIST && sniff->list == NULL) continue; else if(var->id == WARTS_SNIFF_CYCLE && sniff->cycle == NULL) continue; else if(var->id == WARTS_SNIFF_USERID && sniff->userid == 0) continue; else if(var->id == WARTS_SNIFF_SRC && sniff->src == NULL) continue; /* Set the flag for the rest of the variables */ flag_set(flags, var->id, &max_id); /* Variables that don't have a fixed size */ if(var->id == WARTS_SNIFF_SRC) { *params_len += warts_addr_size(table, sniff->src); continue; } /* The rest of the variables have a fixed size */ *params_len += var->size; } *flags_len = fold_flags(flags, max_id); return; } static int warts_sniff_params_read(scamper_sniff_t *sniff, warts_addrtable_t *table, warts_state_t *state, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&sniff->list, (wpr_t)extract_list, state}, {&sniff->cycle, (wpr_t)extract_cycle, state}, {&sniff->userid, (wpr_t)extract_uint32, NULL}, {&sniff->src, (wpr_t)extract_addr, table}, {&sniff->start, (wpr_t)extract_timeval, NULL}, {&sniff->finish, (wpr_t)extract_timeval, NULL}, {&sniff->stop_reason, (wpr_t)extract_byte, NULL}, {&sniff->limit_pktc, (wpr_t)extract_uint32, NULL}, {&sniff->limit_time, (wpr_t)extract_uint16, NULL}, {&sniff->pktc, (wpr_t)extract_uint32, NULL}, {&sniff->icmpid, (wpr_t)extract_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); int rc; if((rc = warts_params_read(buf, off, len, handlers, handler_cnt)) != 0) return rc; if(sniff->src == NULL) return -1; return 0; } static int warts_sniff_params_write(const scamper_sniff_t *sniff, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len) { uint32_t list_id, cycle_id; /* Specifies how to write each variable to the warts file. */ warts_param_writer_t handlers[] = { {&list_id, (wpw_t)insert_uint32, NULL}, {&cycle_id, (wpw_t)insert_uint32, NULL}, {&sniff->userid, (wpw_t)insert_uint32, NULL}, {sniff->src, (wpw_t)insert_addr, table}, {&sniff->start, (wpw_t)insert_timeval, NULL}, {&sniff->finish, (wpw_t)insert_timeval, NULL}, {&sniff->stop_reason, (wpw_t)insert_byte, NULL}, {&sniff->limit_pktc, (wpw_t)insert_uint32, NULL}, {&sniff->limit_time, (wpw_t)insert_uint16, NULL}, {&sniff->pktc, (wpw_t)insert_uint32, NULL}, {&sniff->icmpid, (wpw_t)insert_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); if(warts_list_getid(sf, sniff->list, &list_id) == -1) return -1; if(warts_cycle_getid(sf, sniff->cycle, &cycle_id) == -1) return -1; warts_params_write(buf, off, len, flags, flags_len, params_len, handlers, handler_cnt); return 0; } int scamper_file_warts_sniff_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_sniff_t **sniff_out) { scamper_sniff_t *sniff = NULL; warts_addrtable_t *table = NULL; warts_state_t *state = scamper_file_getstate(sf); uint8_t *buf = NULL; uint32_t off = 0; uint32_t i; /* Read in the header */ if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { *sniff_out = NULL; return 0; } /* Allocate space for a sniff object */ if((sniff = scamper_sniff_alloc()) == NULL) { goto err; } if((table = warts_addrtable_alloc_byid()) == NULL) goto err; /* Read in the sniff data from the warts file */ if(warts_sniff_params_read(sniff, table, state, buf, &off, hdr->len) != 0) { goto err; } /* Determine how many sniff pkts to read */ if(sniff->pktc > 0) { /* Allocate the sniff pkts array */ if(scamper_sniff_pkts_alloc(sniff, sniff->pktc) != 0) { goto err; } /* * for each sniff packet, read it and insert it into the sniff * structure */ for(i=0; ipktc; i++) { sniff->pkts[i] = warts_sniff_pkt_read(state, buf, &off, hdr->len); if(sniff->pkts[i] == NULL) { goto err; } } } warts_addrtable_free(table); *sniff_out = sniff; free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(buf != NULL) free(buf); if(sniff != NULL) scamper_sniff_free(sniff); return -1; } /* Write data from a scamper sniff object to a warts file */ int scamper_file_warts_sniff_write(const scamper_file_t *sf, const scamper_sniff_t *sniff) { warts_addrtable_t *table = NULL; warts_sniff_pkt_t *pkts = NULL; uint8_t *buf = NULL; uint8_t flags[sniff_vars_mfb]; uint16_t flags_len, params_len; uint32_t len, i, off = 0; size_t size; if((table = warts_addrtable_alloc_byaddr()) == NULL) goto err; /* Set the sniff data (not including the packets) */ warts_sniff_params(sniff, table, flags, &flags_len, ¶ms_len); len = 8 + flags_len + params_len + 2; if(sniff->pktc > 0) { /* Allocate memory for the state */ size = sniff->pktc * sizeof(warts_sniff_pkt_t); if((pkts = (warts_sniff_pkt_t *)malloc_zero(size)) == NULL) goto err; for(i=0; ipktc; i++) warts_sniff_pkt_params(sniff->pkts[i], &pkts[i], &len); } /* Allocate memory to store all of the data (including packets) */ if((buf = malloc_zero(len)) == NULL) goto err; insert_wartshdr(buf, &off, len, SCAMPER_FILE_OBJ_SNIFF); /* Write the sniff data (excluding packets) to the buffer */ if(warts_sniff_params_write(sniff, sf, table, buf, &off, len, flags, flags_len, params_len) != 0) { goto err; } if(sniff->pktc > 0) { for(i=0; ipktc; i++) warts_sniff_pkt_write(sniff->pkts[i], sf, buf, &off, len, &pkts[i]); free(pkts); pkts = NULL; } assert(off == len); /* Write the whole buffer to a warts file */ if(warts_write(sf, buf, len) == -1) goto err; warts_addrtable_free(table); free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(pkts != NULL) free(pkts); if(buf != NULL) free(buf); return -1; } scamper-cvs-20171204/scamper/sniff/scamper_sniff_warts.h000644 001751 000000 00000002137 11524661325 023072 0ustar00mjlwheel000000 000000 /* * scamper_sniff_warts.h * * $Id: scamper_sniff_warts.h,v 1.1 2011/02/10 04:00:21 mjl Exp $ * * Copyright (C) 2011 University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the replye that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_SNIFF_WARTS_H #define __SCAMPER_SNIFF_WARTS_H int scamper_file_warts_sniff_write(const scamper_file_t *sf, const scamper_sniff_t *sniff); int scamper_file_warts_sniff_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_sniff_t **sniff_out); #endif scamper-cvs-20171204/scamper/ping/.cvsignore000644 001751 000000 00000000034 12415633115 020500 0ustar00mjlwheel000000 000000 .deps .dirstamp .libs *.lo scamper-cvs-20171204/scamper/ping/scamper_ping.c000644 001751 000000 00000021155 12767155045 021335 0ustar00mjlwheel000000 000000 /* * scamper_ping.c * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2015 The Regents of the University of California * Author: Matthew Luckie * * $Id: scamper_ping.c,v 1.33 2016/09/17 05:52:37 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_ping.c,v 1.33 2016/09/17 05:52:37 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_list.h" #include "scamper_addr.h" #include "scamper_ping.h" #include "utils.h" char *scamper_ping_method2str(const scamper_ping_t *ping, char *buf, size_t len) { static char *m[] = { "icmp-echo", "tcp-ack", "tcp-ack-sport", "udp", "udp-dport", "icmp-time", "tcp-syn", }; if(ping->probe_method > sizeof(m) / sizeof(char *)) { snprintf(buf, len, "%d", ping->probe_method); return buf; } return m[ping->probe_method]; } int scamper_ping_stats(const scamper_ping_t *ping, scamper_ping_stats_t *stats) { scamper_ping_reply_t *reply; uint16_t i; uint32_t us; double d, sum = 0, diff = 0, rtt; int first = 1; uint32_t n; memset(stats, 0, sizeof(scamper_ping_stats_t)); for(i=0; iping_sent; i++) { if((reply = ping->ping_replies[i]) == NULL) { stats->nloss++; continue; } stats->nreplies++; for(;;) { if(first == 0) { if(timeval_cmp(&reply->rtt, &stats->min_rtt) < 0) timeval_cpy(&stats->min_rtt, &reply->rtt); if(timeval_cmp(&reply->rtt, &stats->max_rtt) > 0) timeval_cpy(&stats->max_rtt, &reply->rtt); } else { timeval_cpy(&stats->min_rtt, &reply->rtt); timeval_cpy(&stats->max_rtt, &reply->rtt); first = 0; } sum += ((reply->rtt.tv_sec * 1000000) + reply->rtt.tv_usec); if(reply->next != NULL) { reply = reply->next; stats->ndups++; } else break; } } n = stats->nreplies + stats->ndups; if(n > 0) { /* compute the average */ us = (uint32_t)(sum / n); stats->avg_rtt.tv_sec = us / 1000000; stats->avg_rtt.tv_usec = us % 1000000; /* compute the standard deviation */ d = (sum / n); sum = 0; for(i=0; iping_sent; i++) { for(reply=ping->ping_replies[i]; reply != NULL; reply = reply->next) { rtt = ((reply->rtt.tv_sec * 1000000) + reply->rtt.tv_usec); diff = rtt - d; sum += (diff * diff); } } us = (uint32_t)sqrt(sum/n); stats->stddev_rtt.tv_sec = us / 1000000; stats->stddev_rtt.tv_usec = us % 1000000; } return 0; } int scamper_ping_setdata(scamper_ping_t *ping, uint8_t *bytes, uint16_t len) { uint8_t *dup; /* make a duplicate of the pattern bytes before freeing the old pattern */ if(bytes != NULL && len > 0) { if((dup = memdup(bytes, len)) == NULL) { return -1; } } else { dup = NULL; len = 0; } /* clear out anything there */ if(ping->probe_data != NULL) { free(ping->probe_data); } /* copy in the new pattern */ ping->probe_data = dup; ping->probe_datalen = len; return 0; } scamper_addr_t *scamper_ping_addr(const void *va) { return ((const scamper_ping_t *)va)->dst; } scamper_ping_reply_tsreply_t *scamper_ping_reply_tsreply_alloc(void) { return malloc_zero(sizeof(scamper_ping_reply_tsreply_t)); } void scamper_ping_reply_tsreply_free(scamper_ping_reply_tsreply_t *tsr) { free(tsr); return; } void scamper_ping_v4ts_free(scamper_ping_v4ts_t *ts) { uint8_t i; if(ts == NULL) return; if(ts->ips != NULL) { for(i=0; iipc; i++) if(ts->ips[i] != NULL) scamper_addr_free(ts->ips[i]); free(ts->ips); } free(ts); return; } scamper_ping_v4ts_t *scamper_ping_v4ts_alloc(uint8_t ipc) { scamper_ping_v4ts_t *ts = NULL; if(ipc == 0) goto err; if((ts = malloc_zero(sizeof(scamper_ping_v4ts_t))) == NULL) goto err; ts->ipc = ipc; if((ts->ips = malloc_zero(sizeof(scamper_addr_t *) * ipc)) == NULL) goto err; return ts; err: scamper_ping_v4ts_free(ts); return NULL; } scamper_ping_t *scamper_ping_alloc() { return (scamper_ping_t *)malloc_zero(sizeof(scamper_ping_t)); } void scamper_ping_free(scamper_ping_t *ping) { scamper_ping_reply_t *reply, *reply_next; uint16_t i; if(ping == NULL) return; if(ping->ping_replies != NULL) { for(i=0; iping_sent; i++) { reply = ping->ping_replies[i]; while(reply != NULL) { reply_next = reply->next; scamper_ping_reply_free(reply); reply = reply_next; } } free(ping->ping_replies); } if(ping->dst != NULL) scamper_addr_free(ping->dst); if(ping->src != NULL) scamper_addr_free(ping->src); if(ping->cycle != NULL) scamper_cycle_free(ping->cycle); if(ping->list != NULL) scamper_list_free(ping->list); if(ping->probe_tsps != NULL) scamper_ping_v4ts_free(ping->probe_tsps); if(ping->probe_data != NULL) free(ping->probe_data); free(ping); return; } uint32_t scamper_ping_reply_count(const scamper_ping_t *ping) { scamper_ping_reply_t *reply; uint16_t i; uint32_t count; for(i=0, count=0; iping_sent; i++) { reply = ping->ping_replies[i]; while(reply != NULL) { count++; reply = reply->next; } } return count; } int scamper_ping_reply_append(scamper_ping_t *p, scamper_ping_reply_t *reply) { scamper_ping_reply_t *replies; if(p == NULL || reply == NULL || reply->probe_id >= p->ping_sent) { return -1; } if((replies = p->ping_replies[reply->probe_id]) == NULL) { p->ping_replies[reply->probe_id] = reply; } else { while(replies->next != NULL) { replies = replies->next; } replies->next = reply; } return 0; } int scamper_ping_replies_alloc(scamper_ping_t *ping, int count) { size_t size; size = sizeof(scamper_ping_reply_t *) * count; if((ping->ping_replies = (scamper_ping_reply_t **)malloc_zero(size)) != NULL) { return 0; } return -1; } void scamper_ping_reply_v4ts_free(scamper_ping_reply_v4ts_t *ts) { uint8_t i; if(ts == NULL) return; if(ts->tss != NULL) free(ts->tss); if(ts->ips != NULL) { for(i=0; itsc; i++) if(ts->ips[i] != NULL) scamper_addr_free(ts->ips[i]); free(ts->ips); } free(ts); return; } scamper_ping_reply_v4ts_t *scamper_ping_reply_v4ts_alloc(uint8_t tsc, int ip) { scamper_ping_reply_v4ts_t *ts = NULL; if((ts = malloc_zero(sizeof(scamper_ping_reply_v4ts_t))) == NULL) goto err; ts->tsc = tsc; if(tsc > 0) { if((ts->tss = malloc_zero(sizeof(uint32_t) * tsc)) == NULL) goto err; if(ip != 0 && (ts->ips = malloc_zero(sizeof(scamper_addr_t *) * tsc)) == NULL) goto err; } return ts; err: scamper_ping_reply_v4ts_free(ts); return NULL; } void scamper_ping_reply_v4rr_free(scamper_ping_reply_v4rr_t *rr) { uint8_t i; if(rr == NULL) return; if(rr->rr != NULL) { for(i=0; irrc; i++) if(rr->rr[i] != NULL) scamper_addr_free(rr->rr[i]); free(rr->rr); } free(rr); return; } scamper_ping_reply_v4rr_t *scamper_ping_reply_v4rr_alloc(uint8_t rrc) { scamper_ping_reply_v4rr_t *rr = NULL; if(rrc == 0) goto err; if((rr = malloc_zero(sizeof(scamper_ping_reply_v4rr_t))) == NULL) goto err; rr->rrc = rrc; if((rr->rr = malloc_zero(sizeof(scamper_addr_t *) * rrc)) == NULL) goto err; return rr; err: scamper_ping_reply_v4rr_free(rr); return NULL; } scamper_ping_reply_t *scamper_ping_reply_alloc(void) { return (scamper_ping_reply_t *)malloc_zero(sizeof(scamper_ping_reply_t)); } void scamper_ping_reply_free(scamper_ping_reply_t *reply) { if(reply == NULL) return; if(reply->addr != NULL) scamper_addr_free(reply->addr); if(reply->v4rr != NULL) scamper_ping_reply_v4rr_free(reply->v4rr); if(reply->v4ts != NULL) scamper_ping_reply_v4ts_free(reply->v4ts); if(reply->tsreply != NULL) scamper_ping_reply_tsreply_free(reply->tsreply); free(reply); return; } scamper-cvs-20171204/scamper/ping/scamper_ping.h000644 001751 000000 00000026760 12454655552 021352 0ustar00mjlwheel000000 000000 /* * scamper_ping.h * * $Id: scamper_ping.h,v 1.49 2015/01/12 05:28:10 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2015 The Regents of the University of California * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_PING_H #define __SCAMPER_PING_H #define SCAMPER_PING_REPLY_IS_ICMP(reply) ( \ ((reply)->addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (reply)->reply_proto == 1) || \ ((reply)->addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ (reply)->reply_proto == 58)) #define SCAMPER_PING_REPLY_IS_TCP(reply) ( \ ((reply)->reply_proto == 6)) #define SCAMPER_PING_REPLY_IS_UDP(reply) ( \ ((reply)->reply_proto == 17)) #define SCAMPER_PING_REPLY_IS_ICMP_ECHO_REPLY(reply) ( \ ((reply)->addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (reply)->reply_proto == 1 && (reply)->icmp_type == 0) || \ ((reply)->addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ (reply)->reply_proto == 58 && (reply)->icmp_type == 129)) #define SCAMPER_PING_REPLY_IS_ICMP_UNREACH(reply) ( \ ((reply)->addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (reply)->reply_proto == 1 && (reply)->icmp_type == 3) || \ ((reply)->addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ (reply)->reply_proto == 58 && (reply)->icmp_type == 1)) #define SCAMPER_PING_REPLY_IS_ICMP_UNREACH_PORT(reply) ( \ ((reply)->addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (reply)->reply_proto == 1 && \ (reply)->icmp_type == 3 && (reply)->icmp_code == 3) || \ ((reply)->addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ (reply)->reply_proto == 58 && \ (reply)->icmp_type == 1 && (reply)->icmp_code == 4)) #define SCAMPER_PING_REPLY_IS_ICMP_TTL_EXP(reply) ( \ ((reply)->addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (reply)->reply_proto == 1 && (reply)->icmp_type == 11) || \ ((reply)->addr->type == SCAMPER_ADDR_TYPE_IPV6 && \ (reply)->reply_proto == 58 && (reply)->icmp_type == 3)) #define SCAMPER_PING_REPLY_IS_ICMP_TSREPLY(reply) ( \ ((reply)->addr->type == SCAMPER_ADDR_TYPE_IPV4 && \ (reply)->reply_proto == 1 && (reply)->icmp_type == 14)) #define SCAMPER_PING_METHOD_IS_ICMP(ping) (\ ((ping)->probe_method == SCAMPER_PING_METHOD_ICMP_ECHO) || \ (ping)->probe_method == SCAMPER_PING_METHOD_ICMP_TIME) #define SCAMPER_PING_METHOD_IS_TCP(ping) ( \ ((ping)->probe_method == SCAMPER_PING_METHOD_TCP_ACK || \ (ping)->probe_method == SCAMPER_PING_METHOD_TCP_ACK_SPORT || \ (ping)->probe_method == SCAMPER_PING_METHOD_TCP_SYN)) #define SCAMPER_PING_METHOD_IS_UDP(ping) ( \ ((ping)->probe_method == SCAMPER_PING_METHOD_UDP || \ (ping)->probe_method == SCAMPER_PING_METHOD_UDP_DPORT)) #define SCAMPER_PING_METHOD_IS_ICMP_TIME(ping) (\ ((ping)->probe_method == SCAMPER_PING_METHOD_ICMP_TIME)) #define SCAMPER_PING_METHOD_IS_ICMP_ECHO(ping) (\ ((ping)->probe_method == SCAMPER_PING_METHOD_ICMP_ECHO)) #define SCAMPER_PING_REPLY_FROM_TARGET(ping, reply) ( \ (SCAMPER_PING_METHOD_IS_ICMP_ECHO(ping) && \ SCAMPER_PING_REPLY_IS_ICMP_ECHO_REPLY(reply)) || \ (SCAMPER_PING_METHOD_IS_ICMP_TIME(ping) && \ SCAMPER_PING_REPLY_IS_ICMP_TSREPLY(reply)) || \ (SCAMPER_PING_METHOD_IS_TCP(ping) && \ SCAMPER_PING_REPLY_IS_TCP(reply)) || \ (SCAMPER_PING_METHOD_IS_UDP(ping) && \ SCAMPER_PING_REPLY_IS_ICMP_UNREACH_PORT(reply))) #define SCAMPER_PING_STOP_NONE 0x00 /* null reason */ #define SCAMPER_PING_STOP_COMPLETED 0x01 /* sent all probes */ #define SCAMPER_PING_STOP_ERROR 0x02 /* error occured during ping */ #define SCAMPER_PING_STOP_HALTED 0x03 /* halted */ #define SCAMPER_PING_REPLY_FLAG_REPLY_TTL 0x01 /* reply ttl included */ #define SCAMPER_PING_REPLY_FLAG_REPLY_IPID 0x02 /* reply ipid included */ #define SCAMPER_PING_REPLY_FLAG_PROBE_IPID 0x04 /* probe ipid included */ #define SCAMPER_PING_METHOD_ICMP_ECHO 0x00 #define SCAMPER_PING_METHOD_TCP_ACK 0x01 #define SCAMPER_PING_METHOD_TCP_ACK_SPORT 0x02 #define SCAMPER_PING_METHOD_UDP 0x03 #define SCAMPER_PING_METHOD_UDP_DPORT 0x04 #define SCAMPER_PING_METHOD_ICMP_TIME 0x05 #define SCAMPER_PING_METHOD_TCP_SYN 0x06 #define SCAMPER_PING_FLAG_V4RR 0x01 /* -R: IPv4 record route */ #define SCAMPER_PING_FLAG_SPOOF 0x02 /* -O spoof: spoof src */ #define SCAMPER_PING_FLAG_PAYLOAD 0x04 /* probe_data is payload */ #define SCAMPER_PING_FLAG_TSONLY 0x08 /* -T tsonly */ #define SCAMPER_PING_FLAG_TSANDADDR 0x10 /* -T tsandaddr */ #define SCAMPER_PING_FLAG_ICMPSUM 0x20 /* -C csum */ #define SCAMPER_PING_FLAG_DL 0x40 /* always use datalink socket */ #define SCAMPER_PING_FLAG_TBT 0x80 /* -O tbt: too big trick */ /* * scamper_ping_reply_v4rr * * if the ping probes are using the IP record route option, this structure * contains the interfaces extracted from the response. */ typedef struct scamper_ping_reply_v4rr { scamper_addr_t **rr; uint8_t rrc; } scamper_ping_reply_v4rr_t; /* * scamper_ping_reply_v4ts * * if the ping probes are using the IPv4 timestamp option, this structure * contains data extracted from the response. if the ping->flags field * has SCAMPER_PING_FLAG_TSONLY set, then there are no IP addresses included. * otherwise, if SCAMPER_PING_FLAG_TSANDADDR is set then there are IP * addresses. */ typedef struct scamper_ping_reply_v4ts { scamper_addr_t **ips; /* IP addresses, if SCAMPER_PING_FLAG_TSANDADDR */ uint32_t *tss; /* timestamps */ uint8_t tsc; /* the number of timestamps (ip addresses) */ } scamper_ping_reply_v4ts_t; /* * scamper_ping_reply_tsreply * * if the ping probes are ICMP timestamp requests, these are the timestamps * recorded in the response. */ typedef struct scamper_ping_reply_tsreply { uint32_t tso; uint32_t tsr; uint32_t tst; } scamper_ping_reply_tsreply_t; /* * scamper_ping_v4ts * * if the ping probe is using the IPv4 pre-specified timestamp option, this * structure contains the IP addresses to include. a maximum of four. */ typedef struct scamper_ping_v4ts { scamper_addr_t **ips; uint8_t ipc; } scamper_ping_v4ts_t; /* * scamper_ping_reply * * a ping reply structure keeps track of how a ping packet was responded to. */ typedef struct scamper_ping_reply { /* where the response came from */ scamper_addr_t *addr; /* the TTL / size of the packet that is returned */ uint16_t probe_id; uint16_t probe_ipid; uint8_t reply_proto; uint8_t reply_ttl; uint16_t reply_size; uint16_t reply_ipid; uint32_t reply_ipid32; /* flags defined by SCAMPER_PING_REPLY_FLAG_* */ uint8_t flags; /* the icmp type / code returned */ uint8_t icmp_type; uint8_t icmp_code; /* the tcp flags returned */ uint8_t tcp_flags; /* the time elapsed between sending the probe and getting this response */ struct timeval tx; struct timeval rtt; /* data found in IP options, if any */ scamper_ping_reply_v4rr_t *v4rr; scamper_ping_reply_v4ts_t *v4ts; scamper_ping_reply_tsreply_t *tsreply; /* if a single probe gets more than one response, they get chained */ struct scamper_ping_reply *next; } scamper_ping_reply_t; /* * scamper_ping * * this structure contains details of a ping between a source and a * destination. is specifies the parameters to the ping and the * replies themselves. */ typedef struct scamper_ping { /* the list / cycle that this ping is in relation to */ scamper_list_t *list; scamper_cycle_t *cycle; uint32_t userid; /* source and destination addresses of the ping */ scamper_addr_t *src; /* -S option */ scamper_addr_t *dst; /* when the ping started */ struct timeval start; /* why the ping finished */ uint8_t stop_reason; uint8_t stop_data; /* the data to use inside of a probe. if null then all zeros */ uint8_t *probe_data; uint16_t probe_datalen; /* ping options */ uint16_t probe_count; /* -c */ uint16_t probe_size; /* -s */ uint8_t probe_method; /* -P */ uint8_t probe_ttl; /* -m */ uint8_t probe_tos; /* -z */ uint8_t probe_timeout; /* -W */ uint8_t probe_wait; /* -i */ uint32_t probe_wait_us; /* -i */ uint16_t probe_sport; /* -F */ uint16_t probe_dport; /* -d */ uint16_t probe_icmpsum; /* -C */ uint16_t reply_count; /* -o */ uint16_t reply_pmtu; /* -M */ scamper_ping_v4ts_t *probe_tsps; /* -T */ uint8_t flags; /* actual data collected with the ping */ scamper_ping_reply_t **ping_replies; uint16_t ping_sent; } scamper_ping_t; /* basic routines to allocate and free scamper_ping structures */ scamper_ping_t *scamper_ping_alloc(void); void scamper_ping_free(scamper_ping_t *ping); scamper_addr_t *scamper_ping_addr(const void *va); int scamper_ping_setdata(scamper_ping_t *ping, uint8_t *bytes, uint16_t len); /* utility function for allocating an array for recording replies */ int scamper_ping_replies_alloc(scamper_ping_t *ping, int count); /* basic routines to allocate and free scamper_ping_reply structures */ scamper_ping_reply_t *scamper_ping_reply_alloc(void); void scamper_ping_reply_free(scamper_ping_reply_t *reply); int scamper_ping_reply_append(scamper_ping_t *p, scamper_ping_reply_t *reply); uint32_t scamper_ping_reply_count(const scamper_ping_t *ping); scamper_ping_reply_tsreply_t *scamper_ping_reply_tsreply_alloc(void); void scamper_ping_reply_tsreply_free(scamper_ping_reply_tsreply_t *tsr); scamper_ping_reply_v4rr_t *scamper_ping_reply_v4rr_alloc(uint8_t rrc); void scamper_ping_reply_v4rr_free(scamper_ping_reply_v4rr_t *rr); scamper_ping_reply_v4ts_t *scamper_ping_reply_v4ts_alloc(uint8_t tsc, int ip); void scamper_ping_reply_v4ts_free(scamper_ping_reply_v4ts_t *ts); scamper_ping_v4ts_t *scamper_ping_v4ts_alloc(uint8_t ipc); void scamper_ping_v4ts_free(scamper_ping_v4ts_t *ts); typedef struct scamper_ping_stats { uint32_t nreplies; uint32_t ndups; uint16_t nloss; struct timeval min_rtt; struct timeval max_rtt; struct timeval avg_rtt; struct timeval stddev_rtt; } scamper_ping_stats_t; /* routine to return basic stats for the measurement */ int scamper_ping_stats(const scamper_ping_t *ping,scamper_ping_stats_t *stats); char *scamper_ping_method2str(const scamper_ping_t *, char *, size_t); #endif /* __SCAMPER_PING_H */ scamper-cvs-20171204/scamper/ping/scamper_ping_do.c000644 001751 000000 00000140613 13210743023 021777 0ustar00mjlwheel000000 000000 /* * scamper_do_ping.c * * $Id: scamper_ping_do.c,v 1.150 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2011 The University of Waikato * Copyright (C) 2012-2015 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_ping_do.c,v 1.150 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_ping.h" #include "scamper_getsrc.h" #include "scamper_icmp_resp.h" #include "scamper_fds.h" #include "scamper_rtsock.h" #include "scamper_task.h" #include "scamper_dl.h" #include "scamper_dlhdr.h" #include "scamper_probe.h" #include "scamper_queue.h" #include "scamper_file.h" #include "scamper_debug.h" #include "scamper_ping_do.h" #include "scamper_options.h" #include "scamper_icmp4.h" #include "scamper_icmp6.h" #include "utils.h" #define SCAMPER_DO_PING_PROBECOUNT_MIN 1 #define SCAMPER_DO_PING_PROBECOUNT_DEF 4 #define SCAMPER_DO_PING_PROBECOUNT_MAX 65535 #define SCAMPER_DO_PING_PROBEWAIT_US_MIN 1000 #define SCAMPER_DO_PING_PROBEWAIT_DEF 1 #define SCAMPER_DO_PING_PROBEWAIT_MAX 20 #define SCAMPER_DO_PING_PROBETTL_MIN 1 #define SCAMPER_DO_PING_PROBETTL_DEF 64 #define SCAMPER_DO_PING_PROBETTL_MAX 255 #define SCAMPER_DO_PING_PROBETOS_MIN 0 #define SCAMPER_DO_PING_PROBETOS_DEF 0 #define SCAMPER_DO_PING_PROBETOS_MAX 255 #define SCAMPER_DO_PING_PROBEMETHOD_MIN 0 #define SCAMPER_DO_PING_PROBEMETHOD_DEF 0 #define SCAMPER_DO_PING_PROBEMETHOD_MAX 4 #define SCAMPER_DO_PING_PROBEDPORT_MIN 0 #define SCAMPER_DO_PING_PROBEDPORT_MAX 65535 #define SCAMPER_DO_PING_PROBESPORT_MIN 0 #define SCAMPER_DO_PING_PROBESPORT_MAX 65535 #define SCAMPER_DO_PING_REPLYCOUNT_MIN 0 #define SCAMPER_DO_PING_REPLYCOUNT_DEF 0 #define SCAMPER_DO_PING_REPLYCOUNT_MAX 65535 #define SCAMPER_DO_PING_REPLYPMTU_MIN 0 #define SCAMPER_DO_PING_REPLYPMTU_DEF 0 #define SCAMPER_DO_PING_REPLYPMTU_MAX 65535 #define SCAMPER_DO_PING_PATTERN_MIN 1 #define SCAMPER_DO_PING_PATTERN_DEF 0 #define SCAMPER_DO_PING_PATTERN_MAX 32 #define SCAMPER_DO_PING_PROBETIMEOUT_MIN 1 #define SCAMPER_DO_PING_PROBETIMEOUT_MAX 255 /* the callback functions registered with the ping task */ static scamper_task_funcs_t ping_funcs; /* ICMP ping probes are marked with the process' ID */ #ifndef _WIN32 static pid_t pid; #else static DWORD pid; #endif typedef struct ping_probe { struct timeval tx; uint16_t ipid; } ping_probe_t; typedef struct ping_state { ping_probe_t **probes; scamper_addr_t *last_addr; uint16_t replies; uint16_t seq; uint8_t *payload; uint16_t payload_len; struct in_addr tsps_ips[4]; uint8_t tsps_ipc; uint32_t tcp_seq; uint32_t tcp_ack; uint8_t mode; uint8_t *quote; uint16_t quote_len; } ping_state_t; #define PING_OPT_PAYLOAD 1 #define PING_OPT_PROBECOUNT 2 #define PING_OPT_PROBEICMPSUM 3 #define PING_OPT_PROBESPORT 4 #define PING_OPT_PROBEDPORT 5 #define PING_OPT_PROBEWAIT 6 #define PING_OPT_PROBETTL 7 #define PING_OPT_REPLYCOUNT 8 #define PING_OPT_OPTION 9 #define PING_OPT_PATTERN 10 #define PING_OPT_PROBEMETHOD 11 #define PING_OPT_RECORDROUTE 12 #define PING_OPT_USERID 13 #define PING_OPT_PROBESIZE 14 #define PING_OPT_SRCADDR 15 #define PING_OPT_TIMESTAMP 16 #define PING_OPT_PROBETOS 17 #define PING_OPT_REPLYPMTU 18 #define PING_OPT_PROBETIMEOUT 19 #define PING_MODE_PROBE 0 #define PING_MODE_PTB 1 static const scamper_option_in_t opts[] = { {'B', NULL, PING_OPT_PAYLOAD, SCAMPER_OPTION_TYPE_STR}, {'c', NULL, PING_OPT_PROBECOUNT, SCAMPER_OPTION_TYPE_NUM}, {'C', NULL, PING_OPT_PROBEICMPSUM, SCAMPER_OPTION_TYPE_STR}, {'d', NULL, PING_OPT_PROBEDPORT, SCAMPER_OPTION_TYPE_NUM}, {'F', NULL, PING_OPT_PROBESPORT, SCAMPER_OPTION_TYPE_NUM}, {'i', NULL, PING_OPT_PROBEWAIT, SCAMPER_OPTION_TYPE_STR}, {'m', NULL, PING_OPT_PROBETTL, SCAMPER_OPTION_TYPE_NUM}, {'M', NULL, PING_OPT_REPLYPMTU, SCAMPER_OPTION_TYPE_NUM}, {'o', NULL, PING_OPT_REPLYCOUNT, SCAMPER_OPTION_TYPE_NUM}, {'O', NULL, PING_OPT_OPTION, SCAMPER_OPTION_TYPE_STR}, {'p', NULL, PING_OPT_PATTERN, SCAMPER_OPTION_TYPE_STR}, {'P', NULL, PING_OPT_PROBEMETHOD, SCAMPER_OPTION_TYPE_STR}, {'R', NULL, PING_OPT_RECORDROUTE, SCAMPER_OPTION_TYPE_NULL}, {'s', NULL, PING_OPT_PROBESIZE, SCAMPER_OPTION_TYPE_NUM}, {'S', NULL, PING_OPT_SRCADDR, SCAMPER_OPTION_TYPE_STR}, {'T', NULL, PING_OPT_TIMESTAMP, SCAMPER_OPTION_TYPE_STR}, {'U', NULL, PING_OPT_USERID, SCAMPER_OPTION_TYPE_NUM}, {'W', NULL, PING_OPT_PROBETIMEOUT, SCAMPER_OPTION_TYPE_NUM}, {'z', NULL, PING_OPT_PROBETOS, SCAMPER_OPTION_TYPE_NUM}, }; static const int opts_cnt = SCAMPER_OPTION_COUNT(opts); const char *scamper_do_ping_usage(void) { return "ping [-R] [-B payload] [-c count] [-C icmp-sum] [-d dport]\n" " [-F sport] [-i wait-probe] [-m ttl] [-M pmtu]\n" " [-o reply-count] [-O option] [-p pattern] [-P method]\n" " [-U userid] [-s probe-size] [-S srcaddr]\n" " [-T timestamp-option] [-W timeout] [-z tos]"; } static scamper_ping_t *ping_getdata(const scamper_task_t *task) { return scamper_task_getdata(task); } static ping_state_t *ping_getstate(const scamper_task_t *task) { return scamper_task_getstate(task); } static void ping_stop(scamper_task_t *task, uint8_t reason, uint8_t data) { scamper_ping_t *ping = ping_getdata(task); ping->stop_reason = reason; ping->stop_data = data; scamper_task_queue_done(task, 0); return; } static void ping_handleerror(scamper_task_t *task, int error) { ping_stop(task, SCAMPER_PING_STOP_ERROR, error); return; } static scamper_addr_t *ping_addr(scamper_ping_t *ping, ping_state_t *state, void *addr) { if(scamper_addr_raw_cmp(ping->dst, addr) == 0) return scamper_addr_use(ping->dst); if(state->last_addr != NULL) { if(scamper_addr_raw_cmp(state->last_addr, addr) == 0) return scamper_addr_use(state->last_addr); scamper_addr_free(state->last_addr); } if((state->last_addr = scamper_addr_alloc(ping->dst->type, addr)) == NULL) { printerror(__func__, "could not get reply addr"); return NULL; } return scamper_addr_use(state->last_addr); } static uint16_t match_ipid(scamper_task_t *task, uint16_t ipid) { scamper_ping_t *ping = ping_getdata(task); ping_state_t *state = ping_getstate(task); uint16_t seq; assert(state->seq > 0); for(seq = state->seq-1; state->probes[seq]->ipid != ipid; seq--) { if(seq == 0 || ping->ping_sent - 5 == seq) { seq = state->seq - 1; break; } } return seq; } static void do_ping_handle_dl(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_ping_t *ping = ping_getdata(task); ping_state_t *state = ping_getstate(task); scamper_ping_reply_t *reply = NULL; ping_probe_t *probe; uint16_t u16; int seq = -1; if(state->seq == 0) return; if(dl->dl_ip_off != 0) return; if(SCAMPER_DL_IS_ICMP(dl)) { if((ping->flags & SCAMPER_PING_FLAG_DL) == 0) return; if(SCAMPER_DL_IS_ICMP_ECHO_REPLY(dl) || SCAMPER_DL_IS_ICMP_TIME_REPLY(dl)) { if((SCAMPER_PING_METHOD_IS_ICMP_ECHO(ping) && SCAMPER_DL_IS_ICMP_ECHO_REPLY(dl) == 0) || (SCAMPER_PING_METHOD_IS_ICMP_TIME(ping) && SCAMPER_DL_IS_ICMP_TIME_REPLY(dl) == 0)) return; if(dl->dl_icmp_id != ping->probe_sport) return; seq = dl->dl_icmp_seq; if(seq < ping->probe_dport) seq = seq + 0x10000; seq = seq - ping->probe_dport; /* * keep a quote of an ICMP echo reply if we're trying to get it to * send a fragmented response. */ if(ping->reply_pmtu != 0 && ping->reply_pmtu < dl->dl_ip_size && state->quote == NULL) { if(dl->dl_af == AF_INET) u16 = dl->dl_ip_hl + 8; else if(dl->dl_ip_size >= 1280-40-8) u16 = 1280 - 40 - 8; else u16 = dl->dl_ip_size; if((state->quote = memdup(dl->dl_net_raw, u16)) != NULL) { state->quote_len = u16; state->mode = PING_MODE_PTB; scamper_task_queue_probe(task); } } } else if(SCAMPER_DL_IS_ICMP_UNREACH(dl) || SCAMPER_DL_IS_ICMP_TTL_EXP(dl) || SCAMPER_DL_IS_ICMP_PACKET_TOO_BIG(dl) || SCAMPER_DL_IS_ICMP_PARAMPROB(dl)) { if(SCAMPER_PING_METHOD_IS_ICMP(ping)) { if((SCAMPER_PING_METHOD_IS_ICMP_ECHO(ping) && SCAMPER_DL_IS_ICMP_Q_ICMP_ECHO_REQ(dl) == 0) || (SCAMPER_PING_METHOD_IS_ICMP_TIME(ping) && SCAMPER_DL_IS_ICMP_Q_ICMP_TIME_REQ(dl) == 0)) return; if(dl->dl_icmp_icmp_id != ping->probe_sport) return; seq = dl->dl_icmp_icmp_seq; if(seq < ping->probe_dport) seq = seq + 0x10000; seq = seq - ping->probe_dport; } else if(SCAMPER_PING_METHOD_IS_TCP(ping)) { if(SCAMPER_DL_IS_ICMP_Q_TCP(dl) == 0 || dl->dl_icmp_tcp_dport != ping->probe_dport) return; if(ping->probe_method == SCAMPER_PING_METHOD_TCP_ACK) { if(dl->dl_icmp_tcp_sport != ping->probe_sport) return; if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV4) seq = match_ipid(task, dl->dl_icmp_ip_id); else seq = state->seq - 1; } else { if(dl->dl_icmp_tcp_sport > ping->probe_sport + state->seq || dl->dl_icmp_tcp_sport < ping->probe_sport) return; seq = dl->dl_icmp_tcp_sport - ping->probe_sport; } } else if(SCAMPER_PING_METHOD_IS_UDP(ping)) { if(SCAMPER_DL_IS_ICMP_Q_UDP(dl) == 0 || dl->dl_icmp_udp_sport != ping->probe_sport) return; if(ping->probe_method == SCAMPER_PING_METHOD_UDP) { if(dl->dl_icmp_udp_dport != ping->probe_dport) return; if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV4) seq = match_ipid(task, dl->dl_icmp_ip_id); else seq = state->seq - 1; } else if(ping->probe_method == SCAMPER_PING_METHOD_UDP_DPORT) { if(dl->dl_icmp_udp_dport > ping->probe_dport + state->seq || dl->dl_icmp_udp_dport < ping->probe_dport) return; seq = dl->dl_icmp_udp_dport - ping->probe_dport; } } } } else if(SCAMPER_DL_IS_TCP(dl)) { if(SCAMPER_PING_METHOD_IS_TCP(ping) == 0 || dl->dl_tcp_sport != ping->probe_dport) return; if(ping->probe_method == SCAMPER_PING_METHOD_TCP_ACK || ping->probe_method == SCAMPER_PING_METHOD_TCP_SYN) { /* we send a series of probes using the same src port */ if(dl->dl_tcp_dport != ping->probe_sport) return; /* * for TCP targets that might echo the IPID, use that to match * probes. note that there exists the possibility that replies * might be associated with the wrong probe by random chance. */ if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV4) seq = match_ipid(task, dl->dl_ip_id); else seq = state->seq - 1; } else if(ping->probe_method == SCAMPER_PING_METHOD_TCP_ACK_SPORT) { seq = dl->dl_tcp_dport; if(dl->dl_tcp_dport < ping->probe_sport) seq = seq + 0x10000; seq = seq - ping->probe_sport; } } else if(SCAMPER_DL_IS_UDP(dl)) { if(SCAMPER_PING_METHOD_IS_UDP(ping) == 0) return; if(ping->probe_method == SCAMPER_PING_METHOD_UDP) { if(dl->dl_udp_dport != ping->probe_sport || dl->dl_udp_sport != ping->probe_dport) return; seq = state->seq - 1; } } if(seq < 0 || seq >= state->seq) return; /* this is probably the probe which goes with the reply */ probe = state->probes[seq]; assert(probe != NULL); /* allocate a reply structure for the response */ if((reply = scamper_ping_reply_alloc()) == NULL) { printerror(__func__, "could not alloc ping reply"); goto err; } /* record where the response came from */ if((reply->addr = ping_addr(ping, state, dl->dl_ip_src)) == NULL) goto err; /* put together details of the reply */ timeval_cpy(&reply->tx, &probe->tx); timeval_diff_tv(&reply->rtt, &probe->tx, &dl->dl_tv); reply->reply_size = dl->dl_ip_size; reply->reply_proto = dl->dl_ip_proto; reply->probe_id = seq; reply->reply_ttl = dl->dl_ip_ttl; reply->flags |= SCAMPER_PING_REPLY_FLAG_REPLY_TTL; if(SCAMPER_DL_IS_TCP(dl)) { scamper_dl_rec_tcp_print(dl); reply->tcp_flags = dl->dl_tcp_flags; } else if(SCAMPER_DL_IS_ICMP(dl)) { scamper_dl_rec_icmp_print(dl); reply->icmp_type = dl->dl_icmp_type; reply->icmp_code = dl->dl_icmp_code; } if(dl->dl_af == AF_INET) { reply->reply_ipid = dl->dl_ip_id; reply->flags |= SCAMPER_PING_REPLY_FLAG_REPLY_IPID; reply->probe_ipid = probe->ipid; reply->flags |= SCAMPER_PING_REPLY_FLAG_PROBE_IPID; } else if(dl->dl_af == AF_INET6 && SCAMPER_DL_IS_IP_FRAG(dl)) { reply->reply_ipid32 = dl->dl_ip6_id; reply->flags |= SCAMPER_PING_REPLY_FLAG_REPLY_IPID; } if(ping->ping_replies[seq] == NULL) { if((ping->flags & SCAMPER_PING_FLAG_TBT) == 0) { /* * if this is the first reply we have for this hop, then increment * the replies counter we keep state with */ state->replies++; } else { if(state->replies == 0 && SCAMPER_PING_REPLY_IS_ICMP_ECHO_REPLY(reply) == 0) { /* * when doing TBT, anything that is not an echo reply causes * TBT to halt */ ping_stop(task, SCAMPER_PING_STOP_COMPLETED, 0); } else if(reply->flags & SCAMPER_PING_REPLY_FLAG_REPLY_IPID) { /* when doing TBT, only packets with an IPID count */ state->replies++; } } } /* put the reply into the ping table */ scamper_ping_reply_append(ping, reply); /* * if only a certain number of replies are required, and we've reached * that amount, then stop probing */ if(ping->reply_count != 0 && state->replies >= ping->reply_count) ping_stop(task, SCAMPER_PING_STOP_COMPLETED, 0); return; err: ping_handleerror(task, errno); return; } static void do_ping_handle_icmp(scamper_task_t *task, scamper_icmp_resp_t *ir) { scamper_ping_t *ping = ping_getdata(task); ping_state_t *state = ping_getstate(task); scamper_ping_reply_t *reply = NULL; ping_probe_t *probe; int seq; scamper_addr_t addr; uint8_t i, rrc = 0, tsc = 0; struct in_addr *rrs = NULL, *tsips = NULL; uint32_t *tstss = NULL; scamper_ping_reply_v4rr_t *v4rr; scamper_ping_reply_v4ts_t *v4ts; /* if we haven't sent a probe yet */ if(state->seq == 0) return; if((ping->flags & SCAMPER_PING_FLAG_DL) != 0) return; scamper_icmp_resp_print(ir); /* if this is an echo reply packet, then check the id and sequence */ if(SCAMPER_ICMP_RESP_IS_ECHO_REPLY(ir) || SCAMPER_ICMP_RESP_IS_TIME_REPLY(ir)) { /* if the response is not for us, then move on */ if(((SCAMPER_PING_METHOD_IS_ICMP_ECHO(ping) && SCAMPER_ICMP_RESP_IS_ECHO_REPLY(ir)) || (SCAMPER_PING_METHOD_IS_ICMP_TIME(ping) && SCAMPER_ICMP_RESP_IS_TIME_REPLY(ir))) == 0) return; if(ir->ir_icmp_id != ping->probe_sport) return; seq = ir->ir_icmp_seq; if(seq < ping->probe_dport) seq = seq + 0x10000; seq = seq - ping->probe_dport; if(ir->ir_af == AF_INET) { if(ir->ir_ipopt_rrc > 0) { rrc = ir->ir_ipopt_rrc; rrs = ir->ir_ipopt_rrs; } if(ir->ir_ipopt_tsc > 0) { tsc = ir->ir_ipopt_tsc; tstss = ir->ir_ipopt_tstss; tsips = ir->ir_ipopt_tsips; } } } else if(SCAMPER_ICMP_RESP_INNER_IS_SET(ir)) { if(SCAMPER_ICMP_RESP_IS_UNREACH(ir) == 0 && SCAMPER_ICMP_RESP_IS_TTL_EXP(ir) == 0 && SCAMPER_ICMP_RESP_IS_PACKET_TOO_BIG(ir) == 0 && SCAMPER_ICMP_RESP_IS_PARAMPROB(ir) == 0) { return; } if(ir->ir_inner_ip_off != 0) return; if(SCAMPER_PING_METHOD_IS_ICMP(ping)) { if(ir->ir_inner_icmp_id != ping->probe_sport) return; if((SCAMPER_PING_METHOD_IS_ICMP_ECHO(ping) && SCAMPER_ICMP_RESP_INNER_IS_ICMP_ECHO_REQ(ir) == 0) || (SCAMPER_PING_METHOD_IS_ICMP_TIME(ping) && SCAMPER_ICMP_RESP_INNER_IS_ICMP_TIME_REQ(ir) == 0)) return; seq = ir->ir_inner_icmp_seq; if(seq < ping->probe_dport) seq = seq + 0x10000; seq = seq - ping->probe_dport; } else if(SCAMPER_PING_METHOD_IS_TCP(ping)) { if(SCAMPER_ICMP_RESP_INNER_IS_TCP(ir) == 0 || ir->ir_inner_tcp_dport != ping->probe_dport) return; if(ping->probe_method == SCAMPER_PING_METHOD_TCP_ACK) { if(ir->ir_inner_tcp_sport != ping->probe_sport) return; if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV4) seq = match_ipid(task, ir->ir_inner_ip_id); else seq = state->seq - 1; } else { if(ir->ir_inner_tcp_sport > ping->probe_sport + state->seq || ir->ir_inner_tcp_sport < ping->probe_sport) return; seq = ir->ir_inner_tcp_sport - ping->probe_sport; } } else if(SCAMPER_PING_METHOD_IS_UDP(ping)) { if(SCAMPER_ICMP_RESP_INNER_IS_UDP(ir) == 0 || ir->ir_inner_udp_sport != ping->probe_sport) { return; } if(ping->probe_method == SCAMPER_PING_METHOD_UDP) { if(ir->ir_inner_udp_dport != ping->probe_dport) return; if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV4) seq = match_ipid(task, ir->ir_inner_ip_id); else seq = state->seq - 1; } else if(ping->probe_method == SCAMPER_PING_METHOD_UDP_DPORT) { if(ir->ir_inner_udp_dport > ping->probe_dport + state->seq || ir->ir_inner_udp_dport < ping->probe_dport) return; seq = ir->ir_inner_udp_dport - ping->probe_dport; } else { return; } } else { return; } if(ir->ir_af == AF_INET) { if(ir->ir_inner_ipopt_rrc > 0) { rrc = ir->ir_inner_ipopt_rrc; rrs = ir->ir_inner_ipopt_rrs; } if(ir->ir_inner_ipopt_tsc > 0) { tsc = ir->ir_inner_ipopt_tsc; tstss = ir->ir_inner_ipopt_tstss; tsips = ir->ir_inner_ipopt_tsips; } } } else return; if(seq >= state->seq) return; probe = state->probes[seq]; assert(probe != NULL); /* allocate a reply structure for the response */ if((reply = scamper_ping_reply_alloc()) == NULL) { goto err; } /* figure out where the response came from */ if(scamper_icmp_resp_src(ir, &addr) != 0) goto err; if((reply->addr = ping_addr(ping, state, addr.addr)) == NULL) goto err; /* put together details of the reply */ timeval_cpy(&reply->tx, &probe->tx); timeval_diff_tv(&reply->rtt, &probe->tx, &ir->ir_rx); reply->reply_size = ir->ir_ip_size; reply->probe_id = seq; reply->icmp_type = ir->ir_icmp_type; reply->icmp_code = ir->ir_icmp_code; if(SCAMPER_ICMP_RESP_IS_TIME_REPLY(ir)) { if((reply->tsreply = scamper_ping_reply_tsreply_alloc()) == NULL) goto err; reply->tsreply->tso = ir->ir_icmp_tso; reply->tsreply->tsr = ir->ir_icmp_tsr; reply->tsreply->tst = ir->ir_icmp_tst; } if(ir->ir_af == AF_INET) { reply->reply_ipid = ir->ir_ip_id; reply->flags |= SCAMPER_PING_REPLY_FLAG_REPLY_IPID; reply->probe_ipid = probe->ipid; reply->flags |= SCAMPER_PING_REPLY_FLAG_PROBE_IPID; reply->reply_proto = IPPROTO_ICMP; if(rrs != NULL && rrc > 0) { if((v4rr = scamper_ping_reply_v4rr_alloc(rrc)) == NULL) goto err; reply->v4rr = v4rr; for(i=0; irr[i] = scamper_addr_alloc_ipv4(&rrs[i])) == NULL) goto err; } if((ir->ir_flags & SCAMPER_ICMP_RESP_FLAG_IPOPT_TS) || (ir->ir_flags & SCAMPER_ICMP_RESP_FLAG_INNER_IPOPT_TS)) { v4ts = scamper_ping_reply_v4ts_alloc(tsc, tsips != NULL ? 1 : 0); if(v4ts == NULL) goto err; reply->v4ts = v4ts; if(tsc > 0 && tstss != NULL) { v4ts->tsc = tsc; for(i=0; iips[i]=scamper_addr_alloc_ipv4(&tsips[i])) == NULL) goto err; v4ts->tss[i] = tstss[i]; } } } } else if(ir->ir_af == AF_INET6) { reply->reply_proto = IPPROTO_ICMPV6; } if(ir->ir_ip_ttl != -1) { reply->reply_ttl = (uint8_t)ir->ir_ip_ttl; reply->flags |= SCAMPER_PING_REPLY_FLAG_REPLY_TTL; } /* * if this is the first reply we have for this hop, then increment * the replies counter we keep state with */ if(ping->ping_replies[seq] == NULL) state->replies++; /* put the reply into the ping table */ scamper_ping_reply_append(ping, reply); /* * if only a certain number of replies are required, and we've reached * that amount, then stop probing */ if(ping->reply_count != 0 && state->replies >= ping->reply_count) ping_stop(task, SCAMPER_PING_STOP_COMPLETED, 0); return; err: if(reply != NULL) scamper_ping_reply_free(reply); ping_handleerror(task, errno); return; } /* * do_ping_handle_timeout * * the ping object expired on the pending queue * that means it is either time to send the next probe, or write the * task out */ static void do_ping_handle_timeout(scamper_task_t *task) { scamper_ping_t *ping = ping_getdata(task); ping_state_t *state = ping_getstate(task); if(state->seq == ping->probe_count) ping_stop(task, SCAMPER_PING_STOP_COMPLETED, 0); return; } static int ping_state_payload(scamper_ping_t *ping, ping_state_t *state) { scamper_addr_t *src; int off = 0, al, hdr; /* payload to send in the probe */ if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV4) { al = 4; hdr = 20; if((ping->flags & SCAMPER_PING_FLAG_V4RR) != 0) hdr += 40; else if((ping->flags & SCAMPER_PING_FLAG_TSONLY) != 0) hdr += 40; else if((ping->flags & SCAMPER_PING_FLAG_TSANDADDR) != 0) hdr += 36; else if(state->tsps_ipc > 0) hdr += (state->tsps_ipc * 4 * 2) + 4; } else if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV6) { al = 16; hdr = 40; } else { return -1; } if(SCAMPER_PING_METHOD_IS_ICMP(ping)) { state->payload_len = ping->probe_size - hdr - 8; if(SCAMPER_PING_METHOD_IS_ICMP_TIME(ping)) state->payload_len -= 12; } else if(SCAMPER_PING_METHOD_IS_TCP(ping)) state->payload_len = ping->probe_size - hdr - 20; else if(SCAMPER_PING_METHOD_IS_UDP(ping)) state->payload_len = ping->probe_size - hdr - 8; else return -1; if(state->payload_len == 0) return 0; if((state->payload = malloc_zero(state->payload_len)) == NULL) return -1; if(SCAMPER_PING_METHOD_IS_ICMP_TIME(ping)) { assert(state->payload_len > 12); memset(state->payload, 0, 12); off += 12; } if((ping->flags & SCAMPER_PING_FLAG_SPOOF) != 0) { /* get the source IP address to embed in the probe */ assert(state->payload_len >= al); if((src = scamper_getsrc(ping->dst, 0)) == NULL) return -1; memcpy(state->payload+off, src->addr, al); off += al; scamper_addr_free(src); } /* need scratch space in the probe to help fudge icmp checksum */ if((ping->flags & SCAMPER_PING_FLAG_ICMPSUM) != 0) { assert(state->payload_len >= off + 2); state->payload[off++] = 0; state->payload[off++] = 0; } if(ping->probe_data != NULL) { if((ping->flags & SCAMPER_PING_FLAG_PAYLOAD) != 0) { assert(state->payload_len >= off + ping->probe_datalen); memcpy(state->payload+off, ping->probe_data, ping->probe_datalen); off += ping->probe_datalen; } else { while((size_t)(off + ping->probe_datalen) < state->payload_len) { memcpy(state->payload+off,ping->probe_data,ping->probe_datalen); off += ping->probe_datalen; } memcpy(state->payload+off,ping->probe_data,state->payload_len-off); off = state->payload_len; } } if(state->payload_len > off) memset(state->payload+off, 0, state->payload_len-off); return 0; } static void ping_state_free(ping_state_t *state) { int i; if(state->probes != NULL) { for(i=0; iseq; i++) if(state->probes[i] != NULL) free(state->probes[i]); free(state->probes); } if(state->payload != NULL) free(state->payload); if(state->last_addr != NULL) scamper_addr_free(state->last_addr); free(state); return; } static int ping_state_alloc(scamper_task_t *task) { scamper_ping_t *ping = ping_getdata(task); ping_state_t *state = NULL; size_t size; int i; if(scamper_ping_replies_alloc(ping, ping->probe_count) != 0) { printerror(__func__, "could not malloc replies"); goto err; } if((state = malloc_zero(sizeof(ping_state_t))) == NULL) { printerror(__func__, "could not malloc state"); goto err; } scamper_task_setstate(task, state); size = ping->probe_count * sizeof(ping_probe_t *); if((state->probes = malloc_zero(size)) == NULL) { printerror(__func__, "could not malloc state->probes"); goto err; } /* sort out the payload to attach with each probe */ if(ping_state_payload(ping, state) != 0) goto err; if(ping->probe_tsps != NULL) for(i=0; iprobe_tsps->ipc; i++) memcpy(&state->tsps_ips[i], ping->probe_tsps->ips[i]->addr, 4); if(SCAMPER_PING_METHOD_IS_TCP(ping)) { if(random_u32(&state->tcp_seq) != 0 || random_u32(&state->tcp_ack) != 0) return -1; } return 0; err: return -1; } /* * do_ping_probe * * it is time to send a probe for this task. figure out the form of the * probe to send, and then send it. */ static void do_ping_probe(scamper_task_t *task) { scamper_probe_ipopt_t opt; struct timeval wait_tv; scamper_ping_t *ping = ping_getdata(task); ping_state_t *state = ping_getstate(task); ping_probe_t *pp = NULL; scamper_probe_t probe; int i; uint16_t ipid = 0; uint16_t u16; struct timeval tv; if(state == NULL) { if(ping_state_alloc(task) != 0) goto err; state = ping_getstate(task); /* timestamp the start time of the ping */ gettimeofday_wrap(&ping->start); } memset(&probe, 0, sizeof(probe)); probe.pr_ip_src = ping->src; probe.pr_ip_dst = ping->dst; if(ping->flags & SCAMPER_PING_FLAG_DL) probe.pr_flags |= SCAMPER_PROBE_FLAG_DL; if(state->mode == PING_MODE_PROBE) { if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV4) { /* select a random IPID value (not zero). try up to three times */ for(i=0; i<3; i++) { if(random_u16(&ipid) != 0) { printerror(__func__, "could not rand ipid"); goto err; } if(ipid != 0) break; } } probe.pr_flags |= SCAMPER_PROBE_FLAG_IPID; probe.pr_ip_tos = ping->probe_tos; probe.pr_ip_ttl = ping->probe_ttl; probe.pr_ip_id = ipid; probe.pr_data = state->payload; probe.pr_len = state->payload_len; if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV4) probe.pr_ip_off = IP_DF; if((ping->flags & SCAMPER_PING_FLAG_SPOOF) != 0) probe.pr_flags |= SCAMPER_PROBE_FLAG_SPOOF; if((ping->flags & SCAMPER_PING_FLAG_V4RR) != 0) { opt.type = SCAMPER_PROBE_IPOPTS_V4RR; probe.pr_ipopts = &opt; probe.pr_ipoptc = 1; } else if((ping->flags & SCAMPER_PING_FLAG_TSONLY) != 0) { opt.type = SCAMPER_PROBE_IPOPTS_V4TSO; probe.pr_ipopts = &opt; probe.pr_ipoptc = 1; } else if((ping->flags & SCAMPER_PING_FLAG_TSANDADDR) != 0) { opt.type = SCAMPER_PROBE_IPOPTS_V4TSAA; probe.pr_ipopts = &opt; probe.pr_ipoptc = 1; } else if(ping->probe_tsps != NULL) { opt.type = SCAMPER_PROBE_IPOPTS_V4TSPS; opt.opt_v4tsps_ipc = ping->probe_tsps->ipc; memcpy(&opt.opt_v4tsps_ips, &state->tsps_ips, sizeof(opt.opt_v4tsps_ips)); probe.pr_ipopts = &opt; probe.pr_ipoptc = 1; } if(SCAMPER_PING_METHOD_IS_ICMP(ping)) { i = 0; if(SCAMPER_PING_METHOD_IS_ICMP_ECHO(ping)) { SCAMPER_PROBE_ICMP_ECHO(&probe, ping->probe_sport, ping->probe_dport + state->seq); } else if(SCAMPER_PING_METHOD_IS_ICMP_TIME(ping)) { SCAMPER_PROBE_ICMP_TIME(&probe, ping->probe_sport, ping->probe_dport + state->seq); gettimeofday_wrap(&tv); bytes_htonl(state->payload, ((tv.tv_sec % 86400) * 1000) + (tv.tv_usec / 1000)); i += 12; } if((ping->flags & SCAMPER_PING_FLAG_ICMPSUM) != 0) { probe.pr_icmp_sum = u16 = htons(ping->probe_icmpsum); if((ping->flags & SCAMPER_PING_FLAG_SPOOF) != 0) i += 4; memcpy(state->payload+i, &u16, 2); if(SCAMPER_ADDR_TYPE_IS_IPV4(ping->dst)) u16 = scamper_icmp4_cksum(&probe); else u16 = scamper_icmp6_cksum(&probe); memcpy(state->payload+i, &u16, 2); } } else if(SCAMPER_PING_METHOD_IS_TCP(ping)) { probe.pr_ip_proto = IPPROTO_TCP; probe.pr_tcp_dport = ping->probe_dport; probe.pr_tcp_sport = ping->probe_sport; if(ping->probe_method == SCAMPER_PING_METHOD_TCP_ACK) { probe.pr_tcp_flags = TH_ACK; probe.pr_tcp_seq = state->tcp_seq; probe.pr_tcp_ack = state->tcp_ack; } else if(ping->probe_method == SCAMPER_PING_METHOD_TCP_ACK_SPORT) { probe.pr_tcp_flags = TH_ACK; probe.pr_tcp_sport += state->seq; if(random_u32(&probe.pr_tcp_seq) != 0 || random_u32(&probe.pr_tcp_ack) != 0) goto err; } else if(ping->probe_method == SCAMPER_PING_METHOD_TCP_SYN) { probe.pr_tcp_flags = TH_SYN; probe.pr_tcp_seq = state->tcp_seq; probe.pr_tcp_ack = state->tcp_ack; } } else if(SCAMPER_PING_METHOD_IS_UDP(ping)) { probe.pr_ip_proto = IPPROTO_UDP; probe.pr_udp_sport = ping->probe_sport; if(ping->probe_method == SCAMPER_PING_METHOD_UDP) probe.pr_udp_dport = ping->probe_dport; else if(ping->probe_method == SCAMPER_PING_METHOD_UDP_DPORT) probe.pr_udp_dport = ping->probe_dport + state->seq; } else { scamper_debug(__func__,"unknown ping method %d", ping->probe_method); goto err; } /* * allocate a ping probe state record before we try and send the probe * as there is no point sending something into the wild that we can't * record */ if((pp = malloc_zero(sizeof(ping_probe_t))) == NULL) goto err; if(scamper_probe_task(&probe, task) != 0) { errno = probe.pr_errno; goto err; } /* fill out the details of the probe sent */ timeval_cpy(&pp->tx, &probe.pr_tx); pp->ipid = ipid; state->probes[state->seq] = pp; state->seq++; ping->ping_sent++; } else if(state->mode == PING_MODE_PTB) { SCAMPER_PROBE_ICMP_PTB(&probe, ping->reply_pmtu); probe.pr_ip_ttl = 255; probe.pr_data = state->quote; probe.pr_len = state->quote_len; if(scamper_probe_task(&probe, task) != 0) { errno = probe.pr_errno; goto err; } /* don't need the quote anymore */ free(state->quote); state->quote = NULL; state->quote_len = 0; state->mode = PING_MODE_PROBE; } else { scamper_debug(__func__, "unknown ping mode %d", state->mode); goto err; } if(ping->ping_sent < ping->probe_count) { timeval_add_s(&wait_tv, &probe.pr_tx, ping->probe_wait); timeval_add_us(&wait_tv, &wait_tv, ping->probe_wait_us); } else { timeval_add_s(&wait_tv, &probe.pr_tx, ping->probe_timeout); } scamper_task_queue_wait_tv(task, &wait_tv); return; err: if(pp != NULL) free(pp); ping_handleerror(task, errno); return; } static void do_ping_write(scamper_file_t *sf, scamper_task_t *task) { scamper_file_write_ping(sf, ping_getdata(task)); return; } static int validate_probe_wait(char *s_str, long *out) { char *us_str = NULL; long s = 0, us = 0; string_nullterm_char(s_str, '.', &us_str); if(string_tolong(s_str, &s) == -1 || s < 0 || s > SCAMPER_DO_PING_PROBEWAIT_MAX) return -1; if(us_str != NULL && (string_tolong(us_str, &us) == -1 || us < 0 || us >= 1000000)) return -1; if(us < 10) us *= 100000; else if(us < 100) us *= 10000; else if(us < 1000) us *= 1000; else if(us < 10000) us *= 100; else if(us < 100000) us *= 10; *out = (s * 1000000) + us; if(*out < SCAMPER_DO_PING_PROBEWAIT_US_MIN) return -1; return 0; } static int ping_arg_param_validate(int optid, char *param, long *out) { long tmp = 0; int i; switch(optid) { case PING_OPT_PAYLOAD: for(i=0; param[i] != '\0'; i++) if(ishex(param[i]) == 0) goto err; if(i == 0 || (i % 2) != 0) goto err; tmp = i / 2; if(tmp > 1000) goto err; break; case PING_OPT_PROBECOUNT: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_PING_PROBECOUNT_MIN || tmp > SCAMPER_DO_PING_PROBECOUNT_MAX) { goto err; } break; case PING_OPT_PROBEICMPSUM: if(string_tolong(param, &tmp) == -1 || tmp < 0 || tmp > 65535) goto err; break; case PING_OPT_PROBEDPORT: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_PING_PROBEDPORT_MIN || tmp > SCAMPER_DO_PING_PROBEDPORT_MAX) { goto err; } break; case PING_OPT_PROBESPORT: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_PING_PROBESPORT_MIN || tmp > SCAMPER_DO_PING_PROBESPORT_MAX) { goto err; } break; case PING_OPT_PROBEMETHOD: if(strcasecmp(param, "icmp-echo") == 0) tmp = SCAMPER_PING_METHOD_ICMP_ECHO; else if(strcasecmp(param, "tcp-ack") == 0) tmp = SCAMPER_PING_METHOD_TCP_ACK; else if(strcasecmp(param, "tcp-ack-sport") == 0) tmp = SCAMPER_PING_METHOD_TCP_ACK_SPORT; else if(strcasecmp(param, "udp") == 0) tmp = SCAMPER_PING_METHOD_UDP; else if(strcasecmp(param, "udp-dport") == 0) tmp = SCAMPER_PING_METHOD_UDP_DPORT; else if(strcasecmp(param, "icmp-time") == 0) tmp = SCAMPER_PING_METHOD_ICMP_TIME; else if(strcasecmp(param, "tcp-syn") == 0) tmp = SCAMPER_PING_METHOD_TCP_SYN; else goto err; break; /* how long to wait between sending probes */ case PING_OPT_PROBEWAIT: if(validate_probe_wait(param, &tmp) != 0) goto err; break; /* the ttl to probe with */ case PING_OPT_PROBETTL: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_PING_PROBETTL_MIN || tmp > SCAMPER_DO_PING_PROBETTL_MAX) { goto err; } break; /* how many unique replies are required before the ping completes */ case PING_OPT_REPLYCOUNT: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_PING_REPLYCOUNT_MIN || tmp > SCAMPER_DO_PING_REPLYCOUNT_MAX) { goto err; } break; case PING_OPT_REPLYPMTU: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_PING_REPLYPMTU_MIN || tmp > SCAMPER_DO_PING_REPLYPMTU_MAX) { goto err; } break; case PING_OPT_OPTION: if(strcasecmp(param, "spoof") != 0 && strcasecmp(param, "dl") != 0 && strcasecmp(param, "tbt") != 0) goto err; break; case PING_OPT_PATTERN: /* * sanity check that only hex characters are present, and that * the pattern string is not too long. */ for(i=0; i 65535) { goto err; } break; case PING_OPT_USERID: if(string_tolong(param, &tmp) != 0 || tmp < 0) goto err; break; case PING_OPT_SRCADDR: case PING_OPT_TIMESTAMP: break; /* the tos bits to include in each probe */ case PING_OPT_PROBETOS: if(string_tolong(param, &tmp) == -1 || tmp < SCAMPER_DO_PING_PROBETOS_MIN || tmp > SCAMPER_DO_PING_PROBETOS_MAX) { goto err; } break; case PING_OPT_PROBETIMEOUT: if(string_tolong(param, &tmp) != 0 || tmp < SCAMPER_DO_PING_PROBETIMEOUT_MIN || tmp > SCAMPER_DO_PING_PROBETIMEOUT_MAX) goto err; break; default: return -1; } /* valid parameter */ if(out != NULL) *out = tmp; return 0; err: return -1; } /* * scamper_do_ping_arg_validate * * */ int scamper_do_ping_arg_validate(int argc, char *argv[], int *stop) { return scamper_options_validate(opts, opts_cnt, argc, argv, stop, ping_arg_param_validate); } static int ping_tsopt(scamper_ping_t *ping, uint8_t *flags, char *tsopt) { scamper_ping_v4ts_t *ts = NULL; char *ips[4], *ptr = tsopt; int i = 0; while(*ptr != '=' && *ptr != '\0') ptr++; if(strncasecmp(tsopt, "tsprespec", 9) == 0 && *ptr == '=') { ptr++; for(;;) { if(i == 4) return -1; ips[i++] = ptr; while(isdigit((int)*ptr) || *ptr == '.') ptr++; if(*ptr == '\0') break; if(*ptr != ',') return -1; *ptr = '\0'; ptr++; } if((ts = scamper_ping_v4ts_alloc(i)) == NULL) return -1; i--; while(i>=0) { if((ts->ips[i] = scamper_addr_resolve(AF_INET, ips[i])) == NULL) { scamper_ping_v4ts_free(ts); return -1; } i--; } ping->probe_tsps = ts; } else if(*ptr == '\0' && strcasecmp(tsopt, "tsonly") == 0) { *flags |= SCAMPER_PING_FLAG_TSONLY; } else if(*ptr == '\0' && strcasecmp(tsopt, "tsandaddr") == 0) { *flags |= SCAMPER_PING_FLAG_TSANDADDR; } else { return -1; } return 0; } /* * scamper_do_ping_alloc * * given a string representing a ping task, parse the parameters and assemble * a ping. return the ping structure so that it is all ready to go. * */ void *scamper_do_ping_alloc(char *str) { uint16_t probe_count = SCAMPER_DO_PING_PROBECOUNT_DEF; uint8_t probe_wait = SCAMPER_DO_PING_PROBEWAIT_DEF; uint32_t probe_wait_us = 0; uint8_t probe_ttl = SCAMPER_DO_PING_PROBETTL_DEF; uint8_t probe_tos = SCAMPER_DO_PING_PROBETOS_DEF; uint8_t probe_method = SCAMPER_DO_PING_PROBEMETHOD_DEF; int probe_timeout = -1; int probe_sport = -1; int probe_dport = -1; uint16_t reply_count = SCAMPER_DO_PING_REPLYCOUNT_DEF; uint16_t reply_pmtu = SCAMPER_DO_PING_REPLYPMTU_DEF; uint16_t probe_size = 0; /* unset */ uint16_t pattern_len = 0; uint16_t probe_icmpsum = 0; uint8_t pattern[SCAMPER_DO_PING_PATTERN_MAX/2]; uint16_t payload_len = 0; uint8_t *payload = NULL; uint32_t userid = 0; uint8_t flags = 0; char *src = NULL; char *tsopt = NULL; int af; scamper_option_out_t *opts_out = NULL, *opt; scamper_ping_t *ping = NULL; uint16_t cmps = 0; /* calculated minimum probe size */ char *addr; size_t size; long tmp = 0; int i; /* try and parse the string passed in */ if(scamper_options_parse(str, opts, opts_cnt, &opts_out, &addr) != 0) { goto err; } /* if there is no IP address after the options string, then stop now */ if(addr == NULL) { goto err; } /* parse the options, do preliminary sanity checks */ for(opt = opts_out; opt != NULL; opt = opt->next) { if(opt->type != SCAMPER_OPTION_TYPE_NULL && ping_arg_param_validate(opt->id, opt->str, &tmp) != 0) { scamper_debug(__func__, "validation of optid %d failed", opt->id); goto err; } switch(opt->id) { case PING_OPT_PAYLOAD: payload_len = (uint16_t)tmp; if(payload_len == 0 || (payload = malloc_zero(payload_len)) == NULL) goto err; for(i=0; istr[i*2], opt->str[(i*2)+1]); flags |= SCAMPER_PING_FLAG_PAYLOAD; break; case PING_OPT_PROBECOUNT: probe_count = (uint16_t)tmp; break; case PING_OPT_PROBEDPORT: probe_dport = (uint16_t)tmp; break; case PING_OPT_PROBESPORT: probe_sport = (int)tmp; break; case PING_OPT_PROBEMETHOD: probe_method = (uint8_t)tmp; break; /* how long to wait between sending probes */ case PING_OPT_PROBEWAIT: probe_wait = (uint8_t)(tmp / 1000000); probe_wait_us = (uint32_t)(tmp % 1000000); break; /* the ttl to probe with */ case PING_OPT_PROBETTL: probe_ttl = (uint8_t)tmp; break; case PING_OPT_PROBEICMPSUM: probe_icmpsum = (uint16_t)tmp; flags |= SCAMPER_PING_FLAG_ICMPSUM; break; /* how many unique replies are required before the ping completes */ case PING_OPT_REPLYCOUNT: reply_count = (uint16_t)tmp; break; case PING_OPT_REPLYPMTU: reply_pmtu = (uint16_t)tmp; flags |= SCAMPER_PING_FLAG_DL; break; case PING_OPT_OPTION: if(strcasecmp(opt->str, "spoof") == 0) flags |= SCAMPER_PING_FLAG_SPOOF; else if(strcasecmp(opt->str, "dl") == 0) flags |= SCAMPER_PING_FLAG_DL; else if(strcasecmp(opt->str, "tbt") == 0) flags |= SCAMPER_PING_FLAG_TBT; else { scamper_debug(__func__, "unknown option %s", opt->str); goto err; } break; /* the pattern to fill each probe with */ case PING_OPT_PATTERN: size = strlen(opt->str); if((size % 2) == 0) { pattern_len = size/2; for(i=0; istr[i*2], opt->str[(i*2)+1]); } else { pattern_len = (size/2) + 1; pattern[0] = hex2byte('0', opt->str[0]); for(i=1; istr[(i*2)-1], opt->str[i*2]); } break; /* the size of each probe */ case PING_OPT_PROBESIZE: probe_size = (uint16_t)tmp; break; case PING_OPT_USERID: userid = (uint32_t)tmp; break; case PING_OPT_RECORDROUTE: flags |= SCAMPER_PING_FLAG_V4RR; break; case PING_OPT_SRCADDR: if(src != NULL) goto err; src = opt->str; break; case PING_OPT_TIMESTAMP: if(tsopt != NULL) goto err; tsopt = opt->str; break; /* the tos bits to include in each probe */ case PING_OPT_PROBETOS: probe_tos = (uint8_t)tmp; break; case PING_OPT_PROBETIMEOUT: probe_timeout = (uint8_t)tmp; break; } } scamper_options_free(opts_out); opts_out = NULL; /* allocate the ping object and determine the address to probe */ if((ping = scamper_ping_alloc()) == NULL) { goto err; } if((ping->dst = scamper_addr_resolve(AF_UNSPEC, addr)) == NULL) { goto err; } ping->probe_method = probe_method; /* only one of these two should be specified */ if(pattern_len != 0 && payload_len != 0) goto err; /* * put together the timestamp option now so we can judge how large the * options will be */ if(tsopt != NULL) { if(ping->dst->type != SCAMPER_ADDR_TYPE_IPV4) goto err; if((flags & SCAMPER_PING_FLAG_V4RR) != 0) goto err; if(ping_tsopt(ping, &flags, tsopt) != 0) goto err; } /* ensure the probe size specified is suitable */ if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV4) { cmps = 20; if(flags & SCAMPER_PING_FLAG_V4RR) cmps += 40; else if(ping->probe_tsps != NULL) cmps += (8 * ping->probe_tsps->ipc) + 4; else if(flags & SCAMPER_PING_FLAG_TSONLY) cmps += 40; else if(flags & SCAMPER_PING_FLAG_TSANDADDR) cmps += 36; if(flags & SCAMPER_PING_FLAG_SPOOF) cmps += 4; } else if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV6) { cmps = 40; if(flags & SCAMPER_PING_FLAG_SPOOF) cmps += 16; } else goto err; if(SCAMPER_PING_METHOD_IS_ICMP(ping)) { cmps += 8; if(flags & SCAMPER_PING_FLAG_ICMPSUM) cmps += 2; if(SCAMPER_PING_METHOD_IS_ICMP_TIME(ping)) cmps += 12; if(payload_len != 0) cmps += payload_len; if(probe_size == 0) { probe_size = cmps; if(payload_len == 0) { if(SCAMPER_PING_METHOD_IS_ICMP_TIME(ping)) probe_size += 44; else probe_size += 56; } } } else if(SCAMPER_PING_METHOD_IS_TCP(ping)) { cmps += 20; if(payload_len != 0) cmps += payload_len; if(probe_size == 0) probe_size = cmps; } else if(SCAMPER_PING_METHOD_IS_UDP(ping)) { cmps += 8; if(payload_len != 0) cmps += payload_len; if(probe_size == 0) { probe_size = cmps; if(payload_len == 0) probe_size += 12; } } else goto err; if(probe_size < cmps) goto err; /* TBT method is about getting IPv6 fragments */ if(flags & SCAMPER_PING_FLAG_TBT) { if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV4) goto err; if(reply_pmtu == 0 || probe_size <= reply_pmtu) goto err; } if((flags & SCAMPER_PING_FLAG_ICMPSUM) != 0 && SCAMPER_PING_METHOD_IS_ICMP(ping) == 0) { goto err; } if(src != NULL) { af = scamper_addr_af(ping->dst); if(af != AF_INET && af != AF_INET6) goto err; if((ping->src = scamper_addr_resolve(af, src)) == NULL) goto err; } /* copy in the data bytes, if any */ if(pattern_len != 0) { if(scamper_ping_setdata(ping, pattern, pattern_len) != 0) goto err; } else if(payload_len != 0) { if(scamper_ping_setdata(ping, payload, payload_len) != 0) goto err; } if(probe_sport == -1) { if(SCAMPER_PING_METHOD_IS_ICMP(ping)) probe_sport = pid & 0xffff; else probe_sport = (pid & 0xffff) | 0x8000; } if(probe_dport == -1) { if(SCAMPER_PING_METHOD_IS_ICMP(ping)) probe_dport = 0; else probe_dport = 33435; } if(probe_timeout == -1) { if(probe_wait >= 1) probe_timeout = probe_wait; else probe_timeout = 1; } ping->probe_count = probe_count; ping->probe_size = probe_size; ping->probe_wait = probe_wait; ping->probe_wait_us = probe_wait_us; ping->probe_timeout = probe_timeout; ping->probe_ttl = probe_ttl; ping->probe_tos = probe_tos; ping->probe_sport = probe_sport; ping->probe_dport = probe_dport; ping->probe_icmpsum = probe_icmpsum; ping->reply_count = reply_count; ping->reply_pmtu = reply_pmtu; ping->userid = userid; ping->flags = flags; return ping; err: if(ping != NULL) scamper_ping_free(ping); if(payload != NULL) free(payload); if(opts_out != NULL) scamper_options_free(opts_out); return NULL; } static void do_ping_halt(scamper_task_t *task) { ping_stop(task, SCAMPER_PING_STOP_HALTED, 0); return; } static void do_ping_free(scamper_task_t *task) { scamper_ping_t *ping; ping_state_t *state; if((ping = ping_getdata(task)) != NULL) scamper_ping_free(ping); if((state = ping_getstate(task)) != NULL) ping_state_free(state); return; } scamper_task_t *scamper_do_ping_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle) { scamper_ping_t *ping = (scamper_ping_t *)data; scamper_task_sig_t *sig = NULL; scamper_task_t *task = NULL; /* allocate a task structure and store the ping with it */ if((task = scamper_task_alloc(ping, &ping_funcs)) == NULL) goto err; /* declare the signature of the task */ if((sig = scamper_task_sig_alloc(SCAMPER_TASK_SIG_TYPE_TX_IP)) == NULL) goto err; sig->sig_tx_ip_dst = scamper_addr_use(ping->dst); if(ping->src == NULL && (ping->src = scamper_getsrc(ping->dst, 0)) == NULL) goto err; if((ping->flags & SCAMPER_PING_FLAG_SPOOF) == 0) sig->sig_tx_ip_src = scamper_addr_use(ping->src); if(scamper_task_sig_add(task, sig) != 0) goto err; sig = NULL; /* associate the list and cycle with the ping */ ping->list = scamper_list_use(list); ping->cycle = scamper_cycle_use(cycle); return task; err: if(sig != NULL) scamper_task_sig_free(sig); if(task != NULL) { scamper_task_setdatanull(task); scamper_task_free(task); } return NULL; } void scamper_do_ping_free(void *data) { scamper_ping_free((scamper_ping_t *)data); return; } void scamper_do_ping_cleanup() { return; } int scamper_do_ping_init() { ping_funcs.probe = do_ping_probe; ping_funcs.handle_icmp = do_ping_handle_icmp; ping_funcs.handle_timeout = do_ping_handle_timeout; ping_funcs.handle_dl = do_ping_handle_dl; ping_funcs.write = do_ping_write; ping_funcs.task_free = do_ping_free; ping_funcs.halt = do_ping_halt; #ifndef _WIN32 pid = getpid(); #else pid = GetCurrentProcessId(); #endif return 0; } scamper-cvs-20171204/scamper/ping/scamper_ping_do.h000644 001751 000000 00000002476 11737356726 022036 0ustar00mjlwheel000000 000000 /* * scamper_do_ping.h * * $Id: scamper_ping_do.h,v 1.13 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2005-2006 Matthew Luckie * Copyright (C) 2006-2010 The University of Waikato * Author: Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DO_PING_H #define __SCAMPER_DO_PING_H void *scamper_do_ping_alloc(char *str); scamper_task_t *scamper_do_ping_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle); int scamper_do_ping_arg_validate(int argc, char *argv[], int *stop); void scamper_do_ping_free(void *data); const char *scamper_do_ping_usage(void); void scamper_do_ping_cleanup(void); int scamper_do_ping_init(void); #endif /* __SCAMPER_DO_PING_H */ scamper-cvs-20171204/scamper/ping/scamper_ping_json.c000644 001751 000000 00000026543 13131350352 022354 0ustar00mjlwheel000000 000000 /* * scamper_ping_json.c * * Copyright (c) 2005-2006 Matthew Luckie * Copyright (c) 2006-2011 The University of Waikato * Copyright (c) 2011-2013 Internap Network Services Corporation * Copyright (c) 2013 Matthew Luckie * Copyright (c) 2013-2015 The Regents of the University of California * Authors: Brian Hammond, Matthew Luckie * * $Id: scamper_ping_json.c,v 1.15 2017/07/12 07:34:02 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_ping_json.c,v 1.15 2017/07/12 07:34:02 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_ping.h" #include "scamper_file.h" #include "scamper_file_json.h" #include "scamper_ping_json.h" #include "utils.h" static char *ping_probe_data(const scamper_ping_t *ping, char *buf, size_t len) { size_t off = 0; uint16_t i; for(i=0; i+4probe_datalen; i+=4) string_concat(buf, len, &off, "%02x%02x%02x%02x", ping->probe_data[i+0], ping->probe_data[i+1], ping->probe_data[i+2], ping->probe_data[i+3]); while(iprobe_datalen) string_concat(buf, len, &off, "%02x", ping->probe_data[i++]); return buf; } static char *ping_header(const scamper_ping_t *ping) { static const char *flags[] = { "v4rr", "spoof", "payload", "tsonly", "tsandaddr", "icmpsum", "dl", "8" }; char buf[1024], tmp[512]; size_t off = 0; uint8_t u8, c; string_concat(buf, sizeof(buf), &off, "{\"type\":\"ping\", \"version\":\"0.4\", \"method\":\"%s\"", scamper_ping_method2str(ping, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"src\":\"%s\"", scamper_addr_tostr(ping->src, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"dst\":\"%s\"", scamper_addr_tostr(ping->dst, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"start\":{\"sec\":%u,\"usec\":%u}", ping->start.tv_sec, ping->start.tv_usec); string_concat(buf, sizeof(buf), &off, ", \"ping_sent\":%u, \"probe_size\":%u" ", \"userid\":%u, \"ttl\":%u, \"wait\":%u", ping->ping_sent, ping->probe_size, ping->userid, ping->probe_ttl, ping->probe_wait); if(ping->probe_wait_us != 0) string_concat(buf, sizeof(buf), &off, ", \"wait_us\":%u", ping->probe_wait_us); string_concat(buf, sizeof(buf), &off, ", \"timeout\":%u", ping->probe_timeout); if(SCAMPER_PING_METHOD_IS_UDP(ping) || SCAMPER_PING_METHOD_IS_TCP(ping)) string_concat(buf, sizeof(buf), &off, ", \"sport\":%u, \"dport\":%u", ping->probe_sport, ping->probe_dport); if(ping->probe_datalen > 0 && ping->probe_data != NULL) { if((ping->flags & SCAMPER_PING_FLAG_PAYLOAD) != 0) string_concat(buf, sizeof(buf), &off, ", \"payload\":"); else string_concat(buf, sizeof(buf), &off, ", \"pattern\":"); string_concat(buf, sizeof(buf), &off, "\"%s\"", ping_probe_data(ping, tmp, sizeof(tmp))); } if(ping->flags != 0) { c = 0; string_concat(buf, sizeof(buf), &off, ", \"flags\":["); for(u8=0; u8<8; u8++) { if((ping->flags & (0x1 << u8)) == 0) continue; if(c > 0) string_concat(buf, sizeof(buf), &off, ","); string_concat(buf, sizeof(buf), &off, "\"%s\"", flags[u8]); c++; } string_concat(buf, sizeof(buf), &off, "]"); } if(SCAMPER_PING_METHOD_IS_ICMP(ping) && (ping->flags & SCAMPER_PING_FLAG_ICMPSUM) != 0) string_concat(buf, sizeof(buf), &off, ", \"icmp_csum\": %u",ping->probe_icmpsum); if(ping->probe_tsps != NULL) { string_concat(buf, sizeof(buf), &off, ", \"probe_tsps\":["); for(u8=0; u8probe_tsps->ipc; u8++) { if(u8 > 0) string_concat(buf, sizeof(buf), &off, ","); scamper_addr_tostr(ping->probe_tsps->ips[u8], tmp, sizeof(tmp)); string_concat(buf, sizeof(buf), &off, "\"%s\"", tmp); } string_concat(buf, sizeof(buf), &off, "]"); } return strdup(buf); } static char *ping_reply_proto(const scamper_ping_reply_t *reply, char *buf, size_t len) { if(reply->reply_proto == IPPROTO_ICMP || reply->reply_proto == IPPROTO_ICMPV6) snprintf(buf, len, "\"icmp\""); else if(reply->reply_proto == IPPROTO_TCP) snprintf(buf, len, "\"tcp\""); else if(reply->reply_proto == IPPROTO_UDP) snprintf(buf, len, "\"udp\""); else snprintf(buf, len, "%d", reply->reply_proto); return buf; } static char *ping_reply(const scamper_ping_t *ping, const scamper_ping_reply_t *reply) { scamper_ping_reply_v4rr_t *v4rr; scamper_ping_reply_v4ts_t *v4ts; struct timeval tv; char buf[512], tmp[64]; uint8_t i; size_t off = 0; string_concat(buf, sizeof(buf), &off, "{\"from\":\"%s\", \"seq\":%u", scamper_addr_tostr(reply->addr, tmp, sizeof(tmp)), reply->probe_id); string_concat(buf, sizeof(buf), &off,", \"reply_size\":%u, \"reply_ttl\":%u", reply->reply_size, reply->reply_ttl); string_concat(buf, sizeof(buf), &off, ", \"reply_proto\":%s", ping_reply_proto(reply, tmp, sizeof(tmp))); if(reply->tx.tv_sec != 0) { timeval_add_tv3(&tv, &reply->tx, &reply->rtt); string_concat(buf, sizeof(buf), &off, ", \"tx\":{\"sec\":%u, \"usec\":%u}", reply->tx.tv_sec, reply->tx.tv_usec); string_concat(buf, sizeof(buf), &off, ", \"rx\":{\"sec\":%u, \"usec\":%u}", tv.tv_sec, tv.tv_usec); } string_concat(buf, sizeof(buf), &off, ", \"rtt\":%s", timeval_tostr_us(&reply->rtt, tmp, sizeof(tmp))); if(SCAMPER_ADDR_TYPE_IS_IPV4(reply->addr)) { string_concat(buf, sizeof(buf), &off, ", \"probe_ipid\":%u, \"reply_ipid\":%u", reply->probe_ipid, reply->reply_ipid); } else if(SCAMPER_ADDR_TYPE_IS_IPV6(reply->addr) && (reply->flags & SCAMPER_PING_REPLY_FLAG_REPLY_IPID) != 0) { string_concat(buf, sizeof(buf), &off, ", \"reply_ipid\":%u", reply->reply_ipid32); } if(SCAMPER_PING_REPLY_IS_ICMP(reply)) { string_concat(buf, sizeof(buf), &off, ", \"icmp_type\":%u, \"icmp_code\":%u", reply->icmp_type, reply->icmp_code); } else if(SCAMPER_PING_REPLY_IS_TCP(reply)) { string_concat(buf, sizeof(buf), &off, ", \"tcp_flags\":%u", reply->tcp_flags); } if((v4rr = reply->v4rr) != NULL) { string_concat(buf, sizeof(buf), &off, ", \"RR\":["); for(i=0; irrc; i++) { if(i > 0) string_concat(buf, sizeof(buf), &off, ","); string_concat(buf, sizeof(buf), &off, "\"%s\"", scamper_addr_tostr(v4rr->rr[i], tmp, sizeof(tmp))); } string_concat(buf, sizeof(buf), &off, "]"); } if((v4ts = reply->v4ts) != NULL) { if((ping->flags & SCAMPER_PING_FLAG_TSONLY) == 0) { string_concat(buf, sizeof(buf), &off, ", \"tsandaddr\":["); for(i=0; itsc; i++) { if(i > 0) string_concat(buf, sizeof(buf), &off, ","); string_concat(buf,sizeof(buf),&off, "{\"ip\":\"%s\",\"ts\":%u}", scamper_addr_tostr(v4ts->ips[i], tmp, sizeof(tmp)), v4ts->tss[i]); } string_concat(buf, sizeof(buf), &off, "]"); } else { string_concat(buf, sizeof(buf), &off, ", \"tsonly\":["); for(i=0; itsc; i++) { if(i > 0) string_concat(buf, sizeof(buf), &off, ","); string_concat(buf, sizeof(buf), &off, "%u", v4ts->tss[i]); } string_concat(buf, sizeof(buf), &off, "]"); } } string_concat(buf, sizeof(buf), &off, "}"); return strdup(buf); } static char *ping_stats(const scamper_ping_t *ping) { scamper_ping_stats_t stats; char buf[512], str[64]; size_t off = 0; if(scamper_ping_stats(ping, &stats) != 0) return NULL; string_concat(buf, sizeof(buf), &off, "\"statistics\":{\"replies\":%d", stats.nreplies); if(ping->ping_sent != 0) { string_concat(buf, sizeof(buf), &off, ", \"loss\":"); if(stats.nreplies == 0) string_concat(buf, sizeof(buf), &off, "1"); else if(stats.nreplies == ping->ping_sent) string_concat(buf, sizeof(buf), &off, "0"); else string_concat(buf, sizeof(buf), &off, "%.2f", (float)(ping->ping_sent - stats.nreplies) / ping->ping_sent); } if(stats.nreplies > 0) { string_concat(buf, sizeof(buf), &off, ", \"min\":%s", timeval_tostr_us(&stats.min_rtt, str, sizeof(str))); string_concat(buf, sizeof(buf), &off, ", \"max\":%s", timeval_tostr_us(&stats.max_rtt, str, sizeof(str))); string_concat(buf, sizeof(buf), &off, ", \"avg\":%s", timeval_tostr_us(&stats.avg_rtt, str, sizeof(str))); string_concat(buf, sizeof(buf), &off, ", \"stddev\":%s", timeval_tostr_us(&stats.stddev_rtt, str, sizeof(str))); } string_concat(buf, sizeof(buf), &off, "}"); return strdup(buf); } int scamper_file_json_ping_write(const scamper_file_t *sf, const scamper_ping_t *ping) { scamper_ping_reply_t *reply; uint32_t reply_count = scamper_ping_reply_count(ping); char *header = NULL; size_t header_len = 0; char **replies = NULL; size_t *reply_lens = NULL; char *stats = NULL; size_t stats_len = 0; char *str = NULL; size_t len = 0; size_t wc = 0; int ret = -1; uint32_t i,j; /* get the header string */ if((header = ping_header(ping)) == NULL) goto cleanup; len = (header_len = strlen(header)); /* put together a string for each reply */ len += 15; /* , \"responses\":[", */ if(reply_count > 0) { if((replies = malloc_zero(sizeof(char *) * reply_count)) == NULL || (reply_lens = malloc_zero(sizeof(size_t) * reply_count)) == NULL) { goto cleanup; } for(i=0, j=0; iping_sent; i++) { reply = ping->ping_replies[i]; while(reply != NULL) { /* build string representation of this reply */ if((replies[j] = ping_reply(ping, reply)) == NULL) goto cleanup; len += (reply_lens[j] = strlen(replies[j])); if(j > 0) len++; /* , */ reply = reply->next; j++; } } } len += 2; /* ], */ if((stats = ping_stats(ping)) != NULL) len += (stats_len = strlen(stats)); len += 2; /* }\n */ if((str = malloc_zero(len)) == NULL) goto cleanup; memcpy(str+wc, header, header_len); wc += header_len; memcpy(str+wc, ", \"responses\":[", 15); wc += 15; for(i=0; i 0) { memcpy(str+wc, ",", 1); wc++; } memcpy(str+wc, replies[i], reply_lens[i]); wc += reply_lens[i]; } memcpy(str+wc, "],", 2); wc += 2; if(stats != NULL) { memcpy(str+wc, stats, stats_len); wc += stats_len; } memcpy(str+wc, "}\n", 2); wc += 2; assert(wc == len); ret = json_write(sf, str, len); cleanup: if(str != NULL) free(str); if(header != NULL) free(header); if(stats != NULL) free(stats); if(reply_lens != NULL) free(reply_lens); if(replies != NULL) { for(i=0; isrc, src, sizeof(src)), scamper_addr_tostr(ping->dst, dst, sizeof(dst)), ping->probe_size); return strdup(header); } static char *tsreply_tostr(char *buf, size_t len, uint32_t val) { uint32_t hh, mm, ss, ms; ms = val % 1000; ss = val / 1000; hh = ss / 3600; ss -= (hh * 3600); mm = ss / 60; ss -= (mm * 60); snprintf(buf, len, "%02d:%02d:%02d.%03d", hh, mm, ss, ms); return buf; } static char *ping_reply(const scamper_ping_t *ping, const scamper_ping_reply_t *reply) { scamper_ping_reply_v4rr_t *v4rr; scamper_ping_reply_v4ts_t *v4ts; char buf[256], a[64], rtt[32], *tcp, flags[16], tso[32], tsr[32], tst[32]; uint8_t i; size_t off = 0; scamper_addr_tostr(reply->addr, a, sizeof(a)); timeval_tostr_us(&reply->rtt, rtt, sizeof(rtt)); string_concat(buf, sizeof(buf), &off, "%d bytes from %s, seq=%d ", reply->reply_size, a, reply->probe_id); if(SCAMPER_PING_REPLY_IS_ICMP(reply) || SCAMPER_PING_REPLY_IS_UDP(reply)) { string_concat(buf, sizeof(buf), &off, "ttl=%d time=%s ms", reply->reply_ttl, rtt); } if(SCAMPER_PING_REPLY_IS_ICMP(reply) && reply->tsreply != NULL) { string_concat(buf, sizeof(buf), &off, " tso=%s tsr=%s tst=%s", tsreply_tostr(tso, sizeof(tso), reply->tsreply->tso), tsreply_tostr(tsr, sizeof(tsr), reply->tsreply->tsr), tsreply_tostr(tst, sizeof(tst), reply->tsreply->tst)); } else if(SCAMPER_PING_REPLY_IS_TCP(reply)) { if((reply->tcp_flags & TH_RST) != 0) { tcp = "closed"; } else if((reply->tcp_flags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK)) { if((reply->tcp_flags & TH_ECE) != 0) tcp = "open,ecn"; else tcp = "open"; } else { snprintf(flags, sizeof(flags), "%0x02x", reply->tcp_flags); tcp = flags; } string_concat(buf, sizeof(buf), &off, "tcp=%s ttl=%d time=%s ms", tcp, reply->reply_ttl, rtt); } string_concat(buf, sizeof(buf), &off, "\n"); if((v4rr = reply->v4rr) != NULL) { string_concat(buf, sizeof(buf), &off, " RR: %s\n", scamper_addr_tostr(v4rr->rr[0], a, sizeof(a))); for(i=1; irrc; i++) string_concat(buf, sizeof(buf), &off, " %s\n", scamper_addr_tostr(v4rr->rr[i], a, sizeof(a))); } if((v4ts = reply->v4ts) != NULL && v4ts->tsc > 0) { string_concat(buf, sizeof(buf), &off, " TS: "); if(v4ts->ips != NULL) string_concat(buf, sizeof(buf), &off, "%-15s ", scamper_addr_tostr(v4ts->ips[0], a, sizeof(a))); string_concat(buf, sizeof(buf), &off, "%d\n", v4ts->tss[0]); for(i=1; itsc; i++) { string_concat(buf, sizeof(buf), &off, " "); if(v4ts->ips != NULL) string_concat(buf, sizeof(buf), &off, "%-15s ", scamper_addr_tostr(v4ts->ips[i], a, sizeof(a))); string_concat(buf, sizeof(buf), &off, "%d\n", v4ts->tss[i]); } } return strdup(buf); } static char *ping_stats(const scamper_ping_t *ping) { scamper_ping_stats_t stats; size_t off = 0; char str[64]; char buf[512]; int rp = 0; if(scamper_ping_stats(ping, &stats) != 0) return NULL; if(ping->ping_sent != 0) rp = ((ping->ping_sent - stats.nreplies) * 100) / ping->ping_sent; string_concat(buf, sizeof(buf), &off, "--- %s ping statistics ---\n", scamper_addr_tostr(ping->dst, str, sizeof(str))); string_concat(buf, sizeof(buf), &off, "%d packets transmitted, %d packets received, ", ping->ping_sent, stats.nreplies); if(stats.ndups > 0) string_concat(buf, sizeof(buf), &off, "+%d duplicates, ", stats.ndups); string_concat(buf, sizeof(buf), &off, "%d%% packet loss\n", rp); if(stats.nreplies > 0) { string_concat(buf, sizeof(buf), &off, "round-trip min/avg/max/stddev ="); string_concat(buf, sizeof(buf), &off, " %s", timeval_tostr_us(&stats.min_rtt, str, sizeof(str))); string_concat(buf, sizeof(buf), &off, "/%s", timeval_tostr_us(&stats.avg_rtt, str, sizeof(str))); string_concat(buf, sizeof(buf), &off, "/%s", timeval_tostr_us(&stats.max_rtt, str, sizeof(str))); string_concat(buf, sizeof(buf), &off, "/%s ms\n", timeval_tostr_us(&stats.stddev_rtt, str, sizeof(str))); } return strdup(buf); } int scamper_file_text_ping_write(const scamper_file_t *sf, const scamper_ping_t *ping) { scamper_ping_reply_t *reply; int fd = scamper_file_getfd(sf); off_t off = 0; uint32_t reply_count = scamper_ping_reply_count(ping); char *header = NULL; size_t header_len = 0; char **replies = NULL; size_t *reply_lens = NULL; char *stats = NULL; size_t stats_len = 0; char *str = NULL; size_t len = 0; size_t wc = 0; int ret = -1; uint32_t i,j; /* get current position incase trunction is required */ if(fd != 1 && (off = lseek(fd, 0, SEEK_CUR)) == -1) return -1; /* get the header string */ if((header = ping_header(ping)) == NULL) goto cleanup; len = (header_len = strlen(header)); /* put together a string for each reply */ if(reply_count > 0) { if((replies = malloc_zero(sizeof(char *) * reply_count)) == NULL || (reply_lens = malloc_zero(sizeof(size_t) * reply_count)) == NULL) goto cleanup; for(i=0, j=0; iping_sent; i++) { reply = ping->ping_replies[i]; while(reply != NULL) { /* build string representation of this reply */ if((replies[j] = ping_reply(ping, reply)) == NULL) { goto cleanup; } len += (reply_lens[j] = strlen(replies[j])); reply = reply->next; j++; } } } /* put together the summary stats */ stats = ping_stats(ping); if(stats != NULL) len += (stats_len = strlen(stats)); /* allocate a string long enough to combine the above strings */ if((str = malloc_zero(len)) == NULL) goto cleanup; /* combine the strings created above */ memcpy(str+wc, header, header_len); wc += header_len; for(i=0; i= 1); buf[(*off)++] = rr->rrc; for(i=0; irrc; i++) insert_addr(buf, off, len, rr->rr[i], param); return; } static int extract_ping_reply_v4rr(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_ping_reply_v4rr_t **out, void *param) { scamper_addr_t *addr; uint8_t i, rrc; if(*off >= len || len - *off < 1) return -1; rrc = buf[(*off)++]; if((*out = scamper_ping_reply_v4rr_alloc(rrc)) == NULL) return -1; for(i=0; irr[i] = addr; } return 0; } static void insert_ping_reply_v4ts(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_ping_reply_v4ts_t *ts, void *param) { uint8_t i, ipc; ipc = (ts->ips != NULL ? ts->tsc : 0); assert(len - *off >= 2); buf[(*off)++] = ts->tsc; buf[(*off)++] = ipc; for(i=0; itsc; i++) insert_uint32(buf, off, len, &ts->tss[i], NULL); for(i=0; iips[i], param); return; } static int extract_ping_reply_v4ts(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_ping_reply_v4ts_t **out, void *param) { scamper_addr_t *addr; uint8_t i, tsc, ipc; uint32_t u32; if(*off >= len || len - *off < 2) return -1; /* * the v4ts structure will have timestamps, and sometimes IP * addresses. if there are IP addresses, the number must match the * number of timestamp records. the second parameter to * scamper_ping_reply_v4ts_alloc is a binary flag that says whether * or not to allocate the same number of IP addresses. this is * probably a design oversight in the warts records. */ tsc = buf[(*off)++]; ipc = buf[(*off)++]; if(ipc != 0 && ipc != tsc) return -1; if((*out = scamper_ping_reply_v4ts_alloc(tsc, ipc != 0 ? 1 : 0)) == NULL) return -1; for(i=0; itss[i] = u32; } for(i=0; iips[i] = addr; } return 0; } static void insert_ping_reply_tsreply(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_ping_reply_tsreply_t *ts, void *param) { insert_uint32(buf, off, len, &ts->tso, NULL); insert_uint32(buf, off, len, &ts->tsr, NULL); insert_uint32(buf, off, len, &ts->tst, NULL); return; } static int extract_ping_reply_tsreply(uint8_t *buf, uint32_t *off, const uint32_t len, scamper_ping_reply_tsreply_t **out, void *param) { scamper_ping_reply_tsreply_t *tsreply; if(*off >= len || len - *off < 12) return -1; if((tsreply = scamper_ping_reply_tsreply_alloc()) == NULL) return -1; extract_uint32(buf, off, len, &tsreply->tso, NULL); extract_uint32(buf, off, len, &tsreply->tsr, NULL); extract_uint32(buf, off, len, &tsreply->tst, NULL); *out = tsreply; return 0; } static void warts_ping_reply_params(const scamper_ping_t *ping, const scamper_ping_reply_t *reply, warts_addrtable_t *table, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { const warts_var_t *var; int i, j, max_id = 0; /* unset all the flags possible */ memset(flags, 0, ping_reply_vars_mfb); *params_len = 0; for(i=0; iid == WARTS_PING_REPLY_ADDR_GID || (var->id == WARTS_PING_REPLY_ADDR && reply->addr == NULL) || (var->id == WARTS_PING_REPLY_FLAGS && reply->flags == 0) || (var->id == WARTS_PING_REPLY_REPLY_PROTO && SCAMPER_PING_METHOD_IS_ICMP(ping)) || (var->id == WARTS_PING_REPLY_REPLY_TTL && (reply->flags & SCAMPER_PING_REPLY_FLAG_REPLY_TTL) == 0) || (var->id == WARTS_PING_REPLY_REPLY_IPID && SCAMPER_ADDR_TYPE_IS_IPV4(ping->dst) && (reply->flags & SCAMPER_PING_REPLY_FLAG_REPLY_IPID) == 0) || (var->id == WARTS_PING_REPLY_REPLY_IPID32 && SCAMPER_ADDR_TYPE_IS_IPV6(ping->dst) && (reply->flags & SCAMPER_PING_REPLY_FLAG_REPLY_IPID) == 0) || (var->id == WARTS_PING_REPLY_PROBE_IPID && SCAMPER_ADDR_TYPE_IS_IPV4(ping->dst) && (reply->flags & SCAMPER_PING_REPLY_FLAG_PROBE_IPID) == 0) || (var->id == WARTS_PING_REPLY_ICMP_TC && SCAMPER_PING_REPLY_IS_ICMP(reply) == 0) || (var->id == WARTS_PING_REPLY_TCP_FLAGS && SCAMPER_PING_REPLY_IS_TCP(reply) == 0) || (var->id == WARTS_PING_REPLY_V4RR && reply->v4rr == NULL) || (var->id == WARTS_PING_REPLY_V4TS && reply->v4ts == NULL) || (var->id == WARTS_PING_REPLY_TX && reply->tx.tv_sec == 0) || (var->id == WARTS_PING_REPLY_TSREPLY && reply->tsreply == NULL)) { continue; } flag_set(flags, var->id, &max_id); if(var->id == WARTS_PING_REPLY_ADDR) { *params_len += warts_addr_size(table, reply->addr); } else if(var->id == WARTS_PING_REPLY_V4RR) { *params_len += 1; for(j=0; jv4rr->rrc; j++) *params_len += warts_addr_size(table, reply->v4rr->rr[j]); } else if(var->id == WARTS_PING_REPLY_V4TS) { assert(reply->v4ts != NULL); *params_len += 2; /* one byte tsc, one byte count of v4ts->ips */ *params_len += (reply->v4ts->tsc * 4); if(reply->v4ts->ips != NULL) for(j=0; jv4ts->tsc; j++) *params_len += warts_addr_size(table, reply->v4ts->ips[j]); } else { assert(var->size >= 0); *params_len += var->size; } } *flags_len = fold_flags(flags, max_id); return; } static int warts_ping_reply_state(const scamper_file_t *sf, const scamper_ping_t *ping, scamper_ping_reply_t *reply, warts_ping_reply_t *state, warts_addrtable_t *table, uint32_t *len) { warts_ping_reply_params(ping, reply, table, state->flags, &state->flags_len, &state->params_len); state->reply = reply; *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int extract_ping_reply_icmptc(const uint8_t *buf, uint32_t *off, uint32_t len, scamper_ping_reply_t *reply, void *param) { if(*off >= len || len - *off < 2) return -1; reply->icmp_type = buf[(*off)++]; reply->icmp_code = buf[(*off)++]; return 0; } static void insert_ping_reply_icmptc(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_ping_reply_t *reply, void *param) { assert(len - *off >= 2); buf[(*off)++] = reply->icmp_type; buf[(*off)++] = reply->icmp_code; return; } static int warts_ping_reply_read(const scamper_ping_t *ping, scamper_ping_reply_t *reply, warts_state_t *state, warts_addrtable_t *table, const uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&reply->addr, (wpr_t)extract_addr_gid, state}, {&reply->flags, (wpr_t)extract_byte, NULL}, {&reply->reply_ttl, (wpr_t)extract_byte, NULL}, {&reply->reply_size, (wpr_t)extract_uint16, NULL}, {reply, (wpr_t)extract_ping_reply_icmptc, NULL}, {&reply->rtt, (wpr_t)extract_rtt, NULL}, {&reply->probe_id, (wpr_t)extract_uint16, NULL}, {&reply->reply_ipid, (wpr_t)extract_uint16, NULL}, {&reply->probe_ipid, (wpr_t)extract_uint16, NULL}, {&reply->reply_proto, (wpr_t)extract_byte, NULL}, {&reply->tcp_flags, (wpr_t)extract_byte, NULL}, {&reply->addr, (wpr_t)extract_addr, table}, {&reply->v4rr, (wpr_t)extract_ping_reply_v4rr, table}, {&reply->v4ts, (wpr_t)extract_ping_reply_v4ts, table}, {&reply->reply_ipid32, (wpr_t)extract_uint32, NULL}, {&reply->tx, (wpr_t)extract_timeval, NULL}, {&reply->tsreply, (wpr_t)extract_ping_reply_tsreply, NULL}, }; const int handler_cnt = sizeof(handlers) / sizeof(warts_param_reader_t); uint32_t o = *off; int i; if((i = warts_params_read(buf, off, len, handlers, handler_cnt)) != 0) return i; if(reply->addr == NULL) return -1; /* * some earlier versions of the ping reply structure did not include * the reply protocol field. fill it with something valid. */ if(flag_isset(&buf[o], WARTS_PING_REPLY_REPLY_PROTO) == 0) { if(ping->dst->type == SCAMPER_ADDR_TYPE_IPV4) reply->reply_proto = IPPROTO_ICMP; else reply->reply_proto = IPPROTO_ICMPV6; } return 0; } static void warts_ping_reply_write(const warts_ping_reply_t *state, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { scamper_ping_reply_t *reply = state->reply; warts_param_writer_t handlers[] = { {NULL, NULL, NULL}, {&reply->flags, (wpw_t)insert_byte, NULL}, {&reply->reply_ttl, (wpw_t)insert_byte, NULL}, {&reply->reply_size, (wpw_t)insert_uint16, NULL}, {reply, (wpw_t)insert_ping_reply_icmptc, NULL}, {&reply->rtt, (wpw_t)insert_rtt, NULL}, {&reply->probe_id, (wpw_t)insert_uint16, NULL}, {&reply->reply_ipid, (wpw_t)insert_uint16, NULL}, {&reply->probe_ipid, (wpw_t)insert_uint16, NULL}, {&reply->reply_proto, (wpw_t)insert_byte, NULL}, {&reply->tcp_flags, (wpw_t)insert_byte, NULL}, {reply->addr, (wpw_t)insert_addr, table}, {reply->v4rr, (wpw_t)insert_ping_reply_v4rr, table}, {reply->v4ts, (wpw_t)insert_ping_reply_v4ts, table}, {&reply->reply_ipid32, (wpw_t)insert_uint32, NULL}, {&reply->tx, (wpw_t)insert_timeval, NULL}, {reply->tsreply, (wpw_t)insert_ping_reply_tsreply, NULL}, }; const int handler_cnt = sizeof(handlers) / sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static void warts_ping_params(const scamper_ping_t *ping, warts_addrtable_t *table, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { const warts_var_t *var; int i, j, max_id = 0; /* unset all the flags possible */ memset(flags, 0, ping_vars_mfb); *params_len = 0; for(i=0; iid == WARTS_PING_ADDR_SRC_GID || var->id == WARTS_PING_ADDR_DST_GID || (var->id == WARTS_PING_ADDR_SRC && ping->src == NULL) || (var->id == WARTS_PING_ADDR_DST && ping->dst == NULL) || (var->id == WARTS_PING_LIST_ID && ping->list == NULL) || (var->id == WARTS_PING_CYCLE_ID && ping->cycle == NULL) || (var->id == WARTS_PING_USERID && ping->userid == 0) || (var->id == WARTS_PING_DATA_LEN && ping->probe_datalen == 0) || (var->id == WARTS_PING_PROBE_METHOD && ping->probe_method == 0) || (var->id == WARTS_PING_PROBE_TOS && ping->probe_tos == 0) || (var->id == WARTS_PING_PROBE_SPORT && ping->probe_sport == 0) || (var->id == WARTS_PING_PROBE_DPORT && ping->probe_dport == 0) || (var->id == WARTS_PING_FLAGS && ping->flags == 0) || (var->id == WARTS_PING_REPLY_PMTU && ping->reply_pmtu == 0) || (var->id == WARTS_PING_PROBE_TIMEOUT && ping->probe_timeout == ping->probe_wait) || (var->id == WARTS_PING_PROBE_WAIT_US && ping->probe_wait_us == 0)) { continue; } if(var->id == WARTS_PING_PROBE_ICMPSUM) { if(ping->probe_icmpsum == 0 || (ping->flags & SCAMPER_PING_FLAG_ICMPSUM) == 0) continue; } if(var->id == WARTS_PING_DATA_BYTES) { if(ping->probe_datalen != 0) { flag_set(flags, WARTS_PING_DATA_BYTES, &max_id); *params_len += ping->probe_datalen; } continue; } if(var->id == WARTS_PING_PROBE_TSPS) { if(ping->probe_tsps != NULL) { flag_set(flags, WARTS_PING_PROBE_TSPS, &max_id); *params_len += 1; for(j=0; jprobe_tsps->ipc; j++) *params_len += warts_addr_size(table,ping->probe_tsps->ips[j]); } continue; } flag_set(flags, var->id, &max_id); if(var->id == WARTS_PING_ADDR_SRC) { *params_len += warts_addr_size(table, ping->src); continue; } else if(var->id == WARTS_PING_ADDR_DST) { *params_len += warts_addr_size(table, ping->dst); continue; } assert(var->size >= 0); *params_len += var->size; } *flags_len = fold_flags(flags, max_id); return; } static void insert_ping_probe_tsps(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_ping_v4ts_t *ts, void *param) { uint8_t i; assert(len - *off >= 1); buf[(*off)++] = ts->ipc; for(i=0; iipc; i++) insert_addr(buf, off, len, ts->ips[i], param); return; } static int extract_ping_probe_tsps(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_ping_v4ts_t **out, void *param) { scamper_addr_t *addr; uint8_t i, ipc; /* make sure there is room for the ip count */ if(*off >= len || len - *off < 1) return -1; ipc = buf[(*off)++]; if((*out = scamper_ping_v4ts_alloc(ipc)) == NULL) return -1; for(i=0; iips[i] = addr; } return 0; } static int warts_ping_params_read(scamper_ping_t *ping, warts_state_t *state, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&ping->list, (wpr_t)extract_list, state}, {&ping->cycle, (wpr_t)extract_cycle, state}, {&ping->src, (wpr_t)extract_addr_gid, state}, {&ping->dst, (wpr_t)extract_addr_gid, state}, {&ping->start, (wpr_t)extract_timeval, NULL}, {&ping->stop_reason, (wpr_t)extract_byte, NULL}, {&ping->stop_data, (wpr_t)extract_byte, NULL}, {&ping->probe_datalen, (wpr_t)extract_uint16, NULL}, {&ping->probe_data, (wpr_t)extract_bytes_alloc, &ping->probe_datalen}, {&ping->probe_count, (wpr_t)extract_uint16, NULL}, {&ping->probe_size, (wpr_t)extract_uint16, NULL}, {&ping->probe_wait, (wpr_t)extract_byte, NULL}, {&ping->probe_ttl, (wpr_t)extract_byte, NULL}, {&ping->reply_count, (wpr_t)extract_uint16, NULL}, {&ping->ping_sent, (wpr_t)extract_uint16, NULL}, {&ping->probe_method, (wpr_t)extract_byte, NULL}, {&ping->probe_sport, (wpr_t)extract_uint16, NULL}, {&ping->probe_dport, (wpr_t)extract_uint16, NULL}, {&ping->userid, (wpr_t)extract_uint32, NULL}, {&ping->src, (wpr_t)extract_addr, table}, {&ping->dst, (wpr_t)extract_addr, table}, {&ping->flags, (wpr_t)extract_byte, NULL}, {&ping->probe_tos, (wpr_t)extract_byte, NULL}, {&ping->probe_tsps, (wpr_t)extract_ping_probe_tsps, table}, {&ping->probe_icmpsum, (wpr_t)extract_uint16, NULL}, {&ping->reply_pmtu, (wpr_t)extract_uint16, NULL}, {&ping->probe_timeout, (wpr_t)extract_byte, NULL}, {&ping->probe_wait_us, (wpr_t)extract_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); uint32_t o = *off; int rc; if((rc = warts_params_read(buf, off, len, handlers, handler_cnt)) != 0) return rc; if(ping->src == NULL || ping->dst == NULL) return -1; if(flag_isset(&buf[o], WARTS_PING_PROBE_TIMEOUT) == 0) ping->probe_timeout = ping->probe_wait; return 0; } static int warts_ping_params_write(const scamper_ping_t *ping, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len) { uint32_t list_id, cycle_id; uint16_t pad_len = ping->probe_datalen; warts_param_writer_t handlers[] = { {&list_id, (wpw_t)insert_uint32, NULL}, {&cycle_id, (wpw_t)insert_uint32, NULL}, {NULL, NULL, NULL}, {NULL, NULL, NULL}, {&ping->start, (wpw_t)insert_timeval, NULL}, {&ping->stop_reason, (wpw_t)insert_byte, NULL}, {&ping->stop_data, (wpw_t)insert_byte, NULL}, {&ping->probe_datalen, (wpw_t)insert_uint16, NULL}, {ping->probe_data, (wpw_t)insert_bytes_uint16, &pad_len}, {&ping->probe_count, (wpw_t)insert_uint16, NULL}, {&ping->probe_size, (wpw_t)insert_uint16, NULL}, {&ping->probe_wait, (wpw_t)insert_byte, NULL}, {&ping->probe_ttl, (wpw_t)insert_byte, NULL}, {&ping->reply_count, (wpw_t)insert_uint16, NULL}, {&ping->ping_sent, (wpw_t)insert_uint16, NULL}, {&ping->probe_method, (wpw_t)insert_byte, NULL}, {&ping->probe_sport, (wpw_t)insert_uint16, NULL}, {&ping->probe_dport, (wpw_t)insert_uint16, NULL}, {&ping->userid, (wpw_t)insert_uint32, NULL}, {ping->src, (wpw_t)insert_addr, table}, {ping->dst, (wpw_t)insert_addr, table}, {&ping->flags, (wpw_t)insert_byte, NULL}, {&ping->probe_tos, (wpw_t)insert_byte, NULL}, {ping->probe_tsps, (wpw_t)insert_ping_probe_tsps, table}, {&ping->probe_icmpsum, (wpw_t)insert_uint16, NULL}, {&ping->reply_pmtu, (wpw_t)insert_uint16, NULL}, {&ping->probe_timeout, (wpw_t)insert_byte, NULL}, {&ping->probe_wait_us, (wpw_t)insert_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); if(warts_list_getid(sf, ping->list, &list_id) == -1) return -1; if(warts_cycle_getid(sf, ping->cycle, &cycle_id) == -1) return -1; warts_params_write(buf, off, len, flags, flags_len, params_len, handlers, handler_cnt); return 0; } int scamper_file_warts_ping_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_ping_t **ping_out) { warts_state_t *state = scamper_file_getstate(sf); scamper_ping_t *ping = NULL; uint8_t *buf = NULL; uint32_t off = 0; uint16_t i; scamper_ping_reply_t *reply; uint16_t reply_count; warts_addrtable_t *table = NULL; if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { *ping_out = NULL; return 0; } if((ping = scamper_ping_alloc()) == NULL) { goto err; } if((table = warts_addrtable_alloc_byid()) == NULL) goto err; if(warts_ping_params_read(ping, state, table, buf, &off, hdr->len) != 0) { goto err; } /* determine how many replies to read */ if(extract_uint16(buf, &off, hdr->len, &reply_count, NULL) != 0) { goto err; } /* allocate the ping_replies array */ if(scamper_ping_replies_alloc(ping, ping->ping_sent) != 0) { goto err; } /* if there are no replies, then we are done */ if(reply_count == 0) { goto done; } /* for each reply, read it and insert it into the ping structure */ for(i=0; ilen) != 0) { goto err; } if(scamper_ping_reply_append(ping, reply) != 0) { goto err; } } done: warts_addrtable_free(table); *ping_out = ping; free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(buf != NULL) free(buf); if(ping != NULL) scamper_ping_free(ping); return -1; } int scamper_file_warts_ping_write(const scamper_file_t *sf, const scamper_ping_t *ping) { warts_addrtable_t *table = NULL; warts_ping_reply_t *reply_state = NULL; scamper_ping_reply_t *reply; uint8_t *buf = NULL; uint8_t flags[ping_vars_mfb]; uint16_t flags_len, params_len; uint32_t len, off = 0; uint16_t reply_count; size_t size; int i, j; if((table = warts_addrtable_alloc_byaddr()) == NULL) goto err; /* figure out which ping data items we'll store in this record */ warts_ping_params(ping, table, flags, &flags_len, ¶ms_len); /* length of the ping's flags, parameters, and number of reply records */ len = 8 + flags_len + 2 + params_len + 2; if((reply_count = scamper_ping_reply_count(ping)) > 0) { size = reply_count * sizeof(warts_ping_reply_t); if((reply_state = (warts_ping_reply_t *)malloc_zero(size)) == NULL) { goto err; } for(i=0, j=0; iping_sent; i++) { for(reply=ping->ping_replies[i]; reply != NULL; reply = reply->next) { if(warts_ping_reply_state(sf, ping, reply, &reply_state[j++], table, &len) == -1) { goto err; } } } } if((buf = malloc_zero(len)) == NULL) { goto err; } insert_wartshdr(buf, &off, len, SCAMPER_FILE_OBJ_PING); if(warts_ping_params_write(ping, sf, table, buf, &off, len, flags, flags_len, params_len) == -1) { goto err; } /* reply record count */ insert_uint16(buf, &off, len, &reply_count, NULL); /* write each ping reply record */ for(i=0; idst_ip; } scamper_neighbourdisc_reply_t *scamper_neighbourdisc_reply_alloc(void) { return malloc_zero(sizeof(scamper_neighbourdisc_reply_t)); } void scamper_neighbourdisc_reply_free(scamper_neighbourdisc_reply_t *reply) { if(reply->mac != NULL) scamper_addr_free(reply->mac); free(reply); return; } int scamper_neighbourdisc_reply_add(scamper_neighbourdisc_probe_t *probe, scamper_neighbourdisc_reply_t *reply) { size_t len = sizeof(scamper_neighbourdisc_reply_t *) * (probe->rxc+1); if(realloc_wrap((void **)&probe->rxs, len) != 0) return -1; probe->rxs[probe->rxc++] = reply; return 0; } int scamper_neighbourdisc_replies_alloc(scamper_neighbourdisc_probe_t *probe, uint16_t c) { size_t len = sizeof(scamper_neighbourdisc_reply_t *) * c; if((probe->rxs = malloc_zero(len)) == NULL) return -1; return 0; } scamper_neighbourdisc_probe_t *scamper_neighbourdisc_probe_alloc(void) { return malloc_zero(sizeof(scamper_neighbourdisc_probe_t)); } void scamper_neighbourdisc_probe_free(scamper_neighbourdisc_probe_t *probe) { uint16_t i; if(probe == NULL) return; if(probe->rxs != NULL) { for(i=0; irxc; i++) scamper_neighbourdisc_reply_free(probe->rxs[i]); free(probe->rxs); } free(probe); return; } int scamper_neighbourdisc_probe_add(scamper_neighbourdisc_t *nd, scamper_neighbourdisc_probe_t *probe) { size_t len = sizeof(scamper_neighbourdisc_probe_t *) * (nd->probec+1); if(realloc_wrap((void **)&nd->probes, len) != 0) return -1; nd->probes[nd->probec++] = probe; return 0; } int scamper_neighbourdisc_probes_alloc(scamper_neighbourdisc_t *nd, uint16_t c) { size_t len = sizeof(scamper_neighbourdisc_probe_t *) * c; if((nd->probes = malloc_zero(len)) == NULL) return -1; return 0; } scamper_neighbourdisc_t *scamper_neighbourdisc_alloc() { size_t len = sizeof(scamper_neighbourdisc_t); return (scamper_neighbourdisc_t *)malloc_zero(len); } int scamper_neighbourdisc_ifname_set(scamper_neighbourdisc_t *nd, char *ifname) { if(nd->ifname != NULL) free(nd->ifname); if((nd->ifname = strdup(ifname)) == NULL) return -1; return 0; } void scamper_neighbourdisc_free(scamper_neighbourdisc_t *nd) { uint16_t i; if(nd == NULL) return; if(nd->probes != NULL) { for(i=0; iprobec; i++) scamper_neighbourdisc_probe_free(nd->probes[i]); free(nd->probes); } if(nd->ifname != NULL) free(nd->ifname); if(nd->dst_mac != NULL) scamper_addr_free(nd->dst_mac); if(nd->dst_ip != NULL) scamper_addr_free(nd->dst_ip); if(nd->src_mac != NULL) scamper_addr_free(nd->src_mac); if(nd->src_ip != NULL) scamper_addr_free(nd->src_ip); if(nd->cycle != NULL) scamper_cycle_free(nd->cycle); if(nd->list != NULL) scamper_list_free(nd->list); free(nd); return; } scamper-cvs-20171204/scamper/neighbourdisc/scamper_neighbourdisc.h000644 001751 000000 00000007221 11650114611 025100 0ustar00mjlwheel000000 000000 /* * scamper_neighbourdisc * * $Id: scamper_neighbourdisc.h,v 1.4 2011/10/20 21:58:33 mjl Exp $ * * Copyright (C) 2009 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_NEIGHBOURDISC_H #define __SCAMPER_NEIGHBOURDISC_H #define SCAMPER_NEIGHBOURDISC_METHOD_ARP 0x01 #define SCAMPER_NEIGHBOURDISC_METHOD_ND_NSOL 0x02 #define SCAMPER_NEIGHBOURDISC_FLAG_ALLATTEMPTS 0x01 #define SCAMPER_NEIGHBOURDISC_FLAG_FIRSTRESPONSE 0x02 typedef struct scamper_neighbourdisc_reply { struct timeval rx; /* time this reply was received */ scamper_addr_t *mac; /* MAC address sent */ } scamper_neighbourdisc_reply_t; typedef struct scamper_neighbourdisc_probe { struct timeval tx; /* time this request was sent */ scamper_neighbourdisc_reply_t **rxs; /* replies received */ uint16_t rxc; /* number of replies received */ } scamper_neighbourdisc_probe_t; typedef struct scamper_neighbourdisc { scamper_list_t *list; /* list */ scamper_cycle_t *cycle; /* cycle */ uint32_t userid; /* user assigned id */ struct timeval start; /* when started */ char *ifname; /* interface name */ uint8_t method; /* method of neighbour disc. */ uint8_t flags; /* misc. flags */ uint16_t wait; /* how long to wait, in ms */ uint16_t attempts; /* number of attempts to make */ uint16_t replyc; /* replies requested */ scamper_addr_t *src_ip; /* source IP address */ scamper_addr_t *src_mac; /* source MAC address */ scamper_addr_t *dst_ip; /* target IP address, if any */ scamper_addr_t *dst_mac; /* target MAC address, if any */ scamper_neighbourdisc_probe_t **probes; /* details of probes sent */ uint16_t probec; /* probe count sent */ } scamper_neighbourdisc_t; scamper_neighbourdisc_t *scamper_neighbourdisc_alloc(void); void scamper_neighbourdisc_free(scamper_neighbourdisc_t *); scamper_addr_t *scamper_neighbourdisc_addr(const void *va); scamper_neighbourdisc_probe_t *scamper_neighbourdisc_probe_alloc(void); void scamper_neighbourdisc_probe_free(scamper_neighbourdisc_probe_t *); int scamper_neighbourdisc_probe_add(scamper_neighbourdisc_t *, scamper_neighbourdisc_probe_t *); int scamper_neighbourdisc_probes_alloc(scamper_neighbourdisc_t *, uint16_t); int scamper_neighbourdisc_ifname_set(scamper_neighbourdisc_t *, char *); scamper_neighbourdisc_reply_t *scamper_neighbourdisc_reply_alloc(void); void scamper_neighbourdisc_reply_free(scamper_neighbourdisc_reply_t *); int scamper_neighbourdisc_reply_add(scamper_neighbourdisc_probe_t *, scamper_neighbourdisc_reply_t *); int scamper_neighbourdisc_replies_alloc(scamper_neighbourdisc_probe_t *, uint16_t); #endif /* __SCAMPER_NEIGHBOURDISC_H */ scamper-cvs-20171204/scamper/neighbourdisc/scamper_neighbourdisc_do.c000644 001751 000000 00000053260 13210743023 025560 0ustar00mjlwheel000000 000000 /* * scamper_do_neighbourdisc * * $Id: scamper_neighbourdisc_do.c,v 1.37 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2009-2011 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_neighbourdisc_do.c,v 1.37 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_neighbourdisc.h" #include "scamper_dl.h" #include "scamper_fds.h" #include "scamper_probe.h" #include "scamper_task.h" #include "scamper_options.h" #include "scamper_if.h" #include "scamper_getsrc.h" #include "scamper_queue.h" #include "scamper_file.h" #include "scamper_debug.h" #include "scamper_neighbourdisc_do.h" #include "mjl_list.h" #include "utils.h" static scamper_task_funcs_t nd_funcs; extern scamper_addrcache_t *addrcache; static uint8_t *pktbuf; static size_t pktbuf_len; typedef struct nd_state { scamper_fd_t *fd; int ifindex; int replyc; dlist_t *cbs; } nd_state_t; struct scamper_neighbourdisc_do { scamper_task_t *task; void *param; void (*cb)(void *, scamper_addr_t *, scamper_addr_t *); dlist_node_t *node; }; #define ND_OPT_FIRSTRESPONSE 1 #define ND_OPT_IFNAME 2 #define ND_OPT_REPLYC 3 #define ND_OPT_ATTEMPTS 4 #define ND_OPT_ALLATTEMPTS 5 #define ND_OPT_WAIT 6 #define ND_OPT_SRCADDR 7 static const scamper_option_in_t opts[] = { {'F', NULL, ND_OPT_FIRSTRESPONSE, SCAMPER_OPTION_TYPE_NULL}, {'i', NULL, ND_OPT_IFNAME, SCAMPER_OPTION_TYPE_STR}, {'o', NULL, ND_OPT_REPLYC, SCAMPER_OPTION_TYPE_NUM}, {'q', NULL, ND_OPT_ATTEMPTS, SCAMPER_OPTION_TYPE_NUM}, {'Q', NULL, ND_OPT_ALLATTEMPTS, SCAMPER_OPTION_TYPE_NULL}, {'S', NULL, ND_OPT_SRCADDR, SCAMPER_OPTION_TYPE_STR}, {'w', NULL, ND_OPT_WAIT, SCAMPER_OPTION_TYPE_NUM}, }; static const int opts_cnt = SCAMPER_OPTION_COUNT(opts); const char *scamper_do_neighbourdisc_usage(void) { return "neighbourdisc [-FQ] [-i if] [-o replyc] [-q attempts] [-S srcaddr] [-w wait]\n"; } static scamper_neighbourdisc_t *nd_getdata(const scamper_task_t *task) { return scamper_task_getdata(task); } static nd_state_t *nd_getstate(const scamper_task_t *task) { return scamper_task_getstate(task); } static void nd_handleerror(scamper_task_t *task, int error) { scamper_task_queue_done(task, 0); return; } static void nd_done(scamper_task_t *task) { scamper_task_queue_done(task, 0); return; } static void nd_state_free(nd_state_t *state) { if(state->fd != NULL) scamper_fd_free(state->fd); free(state); return; } static int nd_state_alloc(scamper_task_t *task) { scamper_neighbourdisc_t *nd = nd_getdata(task); scamper_dl_t *dl; nd_state_t *state; uint8_t src[6]; int i; assert(nd != NULL); gettimeofday_wrap(&nd->start); if((state = malloc_zero(sizeof(nd_state_t))) == NULL) { printerror(__func__, "could not malloc state"); goto err; } if(scamper_if_getifindex(nd->ifname, &state->ifindex) != 0) { printerror(__func__, "could not get ifindex for %s", nd->ifname); goto err; } if(nd->src_ip == NULL && (nd->src_ip = scamper_getsrc(nd->dst_ip, state->ifindex)) == NULL) { printerror(__func__, "could not get src ip"); goto err; } if(scamper_if_getmac(state->ifindex, src) != 0) { printerror(__func__, "could not get src mac"); goto err; } if((nd->src_mac = scamper_addrcache_get_ethernet(addrcache, src)) == NULL) { printerror(__func__, "could not get src mac"); goto err; } if((state->fd = scamper_fd_dl(state->ifindex)) == NULL) { printerror(__func__, "could not get fd"); goto err; } if((dl = scamper_fd_dl_get(state->fd)) == NULL) { printerror(__func__, "could not get dl"); goto err; } if((i = scamper_dl_tx_type(dl)) != SCAMPER_DL_TX_ETHERNET) { scamper_debug(__func__, "dl type %d not ethernet", i); goto err; } scamper_task_setstate(task, state); return 0; err: if(state != NULL) nd_state_free(state); return -1; } static void do_nd_handle_timeout(scamper_task_t *task) { scamper_neighbourdisc_t *nd = nd_getdata(task); nd_state_t *state = nd_getstate(task); if(((nd->flags & SCAMPER_NEIGHBOURDISC_FLAG_ALLATTEMPTS) == 0 && nd->dst_mac != NULL) || nd->probec == nd->attempts || (state->replyc >= nd->replyc && nd->replyc != 0)) { nd_done(task); return; } return; } static void do_nd_probe_arp(scamper_task_t *task) { scamper_neighbourdisc_t *nd = nd_getdata(task); size_t off; /* * standard 14 byte ethernet header followed by 28 byte arp request. * * 6 bytes: broadcast ethernet mac address * 6 bytes: src mac address * 2 bytes: ethernet type * * 2 bytes: ethernet address space: 0x0001 * 2 bytes: protocol address space: 0x0800 * 1 byte: the length of an ethernet mac address: 6 * 1 byte: the length of an ip address: 4 * 2 bytes: request packet: 0x0001 * 6 bytes: src mac address * 4 bytes: src IP address * 6 bytes: dst mac address: all zeros in request * 4 bytes: dst IP address */ memset(pktbuf, 0xff, 6); off = 6; mem_concat(pktbuf, nd->src_mac->addr, 6, &off, pktbuf_len); bytes_htons(pktbuf+off, ETHERTYPE_ARP); off += 2; bytes_htons(pktbuf+off, 0x0001); off += 2; bytes_htons(pktbuf+off, ETHERTYPE_IP); off += 2; pktbuf[off++] = 6; pktbuf[off++] = 4; bytes_htons(pktbuf+off, 0x0001); off += 2; mem_concat(pktbuf, nd->src_mac->addr, 6, &off, pktbuf_len); mem_concat(pktbuf, nd->src_ip->addr, 4, &off, pktbuf_len); memset(pktbuf+off, 0, 6); off += 6; mem_concat(pktbuf, nd->dst_ip->addr, 4, &off, pktbuf_len); return; } static void do_nd_probe_nsol(scamper_task_t *task) { scamper_neighbourdisc_t *nd = nd_getdata(task); struct ip6_hdr *ip6; struct icmp6_hdr *icmp6; struct in6_addr a; uint16_t u16, *w; uint8_t ip6_dst[16]; uint8_t sol[4]; size_t off = 0; int i, sum = 0; /* figure out the lower 4 bytes of the solicited multicast address */ memcpy(sol, ((uint8_t *)nd->dst_ip->addr)+12, 4); sol[0] = 0xff; /* figure out the destination IPv6 address of this message */ ip6_dst[0] = 0xff; ip6_dst[1] = 0x02; memset(ip6_dst+2, 0, 9); ip6_dst[11] = 0x01; memcpy(ip6_dst+12, sol, 4); /* ethernet header: 14 bytes */ pktbuf[off++] = 0x33; pktbuf[off++] = 0x33; mem_concat(pktbuf, sol, 4, &off, pktbuf_len); mem_concat(pktbuf, nd->src_mac->addr, 6, &off, pktbuf_len); bytes_htons(pktbuf+off, ETHERTYPE_IPV6); off += 2; /* IPv6 header: 40 bytes */ ip6 = (struct ip6_hdr *)(pktbuf+off); off += sizeof(struct ip6_hdr); memset(ip6, 0, sizeof(struct ip6_hdr)); ip6->ip6_vfc = 0x60; ip6->ip6_plen = htons(32); ip6->ip6_nxt = IPPROTO_ICMPV6; ip6->ip6_hlim = 255; memcpy(&ip6->ip6_src, nd->src_ip->addr, 16); memcpy(&ip6->ip6_dst, ip6_dst, 16); /* ICMP6 neighbour discovery: 32 bytes */ icmp6 = (struct icmp6_hdr *)(pktbuf+off); off += sizeof(struct icmp6_hdr); icmp6->icmp6_type = ND_NEIGHBOR_SOLICIT; icmp6->icmp6_code = 0; icmp6->icmp6_data32[0] = 0; icmp6->icmp6_cksum = 0; mem_concat(pktbuf, nd->dst_ip->addr, 16, &off, pktbuf_len); pktbuf[off++] = 0x01; pktbuf[off++] = 0x01; mem_concat(pktbuf, nd->src_mac->addr, 6, &off, pktbuf_len); /* build up the ICMP6 checksum, which includes a psuedo header */ memcpy(&a, &ip6->ip6_src, sizeof(struct in6_addr)); w = (uint16_t *)&a; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; memcpy(&a, &ip6->ip6_dst, sizeof(struct in6_addr)); w = (uint16_t *)&a; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += *w++; sum += ip6->ip6_plen; sum += htons(IPPROTO_ICMPV6); w = (uint16_t *)icmp6; for(i = ntohs(ip6->ip6_plen); i > 1; i -= 2) sum += *w++; if(i != 0) sum += ((uint8_t *)w)[0]; sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); if((u16 = ~sum) == 0) u16 = 0xffff; icmp6->icmp6_cksum = u16; return; } static void do_nd_handle_dl(scamper_task_t *task, scamper_dl_rec_t *dl) { scamper_neighbourdisc_t *nd = nd_getdata(task); nd_state_t *state = nd_getstate(task); scamper_neighbourdisc_probe_t *probe; scamper_neighbourdisc_reply_t *reply; uint16_t opt_off; uint8_t *opt; uint8_t *mac = NULL; #ifdef HAVE_SCAMPER_DEBUG char a[64], b[64]; #endif if(nd->probec == 0) return; probe = nd->probes[nd->probec-1]; if(SCAMPER_DL_IS_ARP(dl)) { if(nd->method != SCAMPER_NEIGHBOURDISC_METHOD_ARP || SCAMPER_DL_IS_ARP_OP_REPLY(dl) == 0 || SCAMPER_DL_IS_ARP_HRD_ETHERNET(dl) == 0 || SCAMPER_DL_IS_ARP_PRO_IPV4(dl) == 0) { return; } mac = dl->dl_arp_sha; } else if(SCAMPER_DL_IS_ICMPV6(dl)) { if(nd->method != SCAMPER_NEIGHBOURDISC_METHOD_ND_NSOL || SCAMPER_DL_IS_ICMP6_ND_NADV(dl) == 0) { return; } /* * loop through the attached options, trying to find the * destination link-address option */ opt = dl->dl_icmp6_nd_opts; opt_off = 0; while(opt_off + 8 <= dl->dl_icmp6_nd_opts_len) { if(opt[0]==2 && opt[1]==1 && dl->dl_icmp6_nd_opts_len-opt_off >= 8) { mac = opt+2; break; } if(opt[1] == 0) return; opt_off += (opt[1] * 8); opt += (opt[1] * 8); } } if(mac == NULL) return; if((reply = scamper_neighbourdisc_reply_alloc()) == NULL) { printerror(__func__, "could not alloc reply"); goto err; } timeval_cpy(&reply->rx, &dl->dl_tv); reply->mac = scamper_addrcache_get_ethernet(addrcache, mac); if(reply->mac == NULL) { printerror(__func__, "could not get reply->mac"); goto err; } scamper_debug(__func__, "%s is-at %s", scamper_addr_tostr(nd->dst_ip, a, sizeof(a)), scamper_addr_tostr(reply->mac, b, sizeof(b))); if(scamper_neighbourdisc_reply_add(probe, reply) != 0) { printerror(__func__, "could not add reply"); goto err; } if(nd->dst_mac == NULL) nd->dst_mac = scamper_addr_use(reply->mac); if(probe->rxc == 1) { state->replyc++; if((nd->flags & SCAMPER_NEIGHBOURDISC_FLAG_FIRSTRESPONSE) != 0) nd_done(task); } return; err: return; } static void do_nd_probe(scamper_task_t *task) { scamper_neighbourdisc_probe_t *probe = NULL; scamper_neighbourdisc_t *nd = nd_getdata(task); nd_state_t *state = nd_getstate(task); scamper_dl_t *dl; size_t len; char ip[64], mac[32]; if(state == NULL) { if(nd_state_alloc(task) != 0) goto err; state = nd_getstate(task); } /* determine the length of the packet to transmit */ if(nd->method == SCAMPER_NEIGHBOURDISC_METHOD_ARP) len = 42; else if(nd->method == SCAMPER_NEIGHBOURDISC_METHOD_ND_NSOL) len = 86; else goto err; /* make sure the pktbuf is at least that size */ if(pktbuf_len < len) { if(realloc_wrap((void **)&pktbuf, len) != 0) { printerror(__func__, "could not realloc"); goto err; } pktbuf_len = len; } /* form the probe to send */ if(nd->method == SCAMPER_NEIGHBOURDISC_METHOD_ARP) do_nd_probe_arp(task); else if(nd->method == SCAMPER_NEIGHBOURDISC_METHOD_ND_NSOL) do_nd_probe_nsol(task); else goto err; /* allocate a probe record to store tx time and associated replies */ if((probe = scamper_neighbourdisc_probe_alloc()) == NULL) { printerror(__func__, "could not alloc probe"); goto err; } /* send the probe. record the time it is sent */ dl = scamper_fd_dl_get(state->fd); gettimeofday_wrap(&probe->tx); if(scamper_dl_tx(dl, pktbuf, len) == -1) { goto err; } scamper_addr_tostr(nd->dst_ip, ip, sizeof(ip)); scamper_addr_tostr(nd->src_mac, mac, sizeof(mac)); scamper_debug(__func__, "who-has %s tell %s", ip, mac); if(scamper_neighbourdisc_probe_add(nd, probe) != 0) { printerror(__func__, "could not add probe"); goto err; } scamper_task_queue_wait(task, nd->wait); return; err: nd_handleerror(task, errno); return; } static void do_nd_write(scamper_file_t *sf, scamper_task_t *task) { scamper_file_write_neighbourdisc(sf, nd_getdata(task)); return; } static void do_nd_halt(scamper_task_t *task) { nd_done(task); return; } static void do_nd_free(scamper_task_t *task) { scamper_neighbourdisc_do_t *nddo; scamper_neighbourdisc_t *nd = nd_getdata(task); nd_state_t *state = nd_getstate(task); scamper_addr_t *mac = NULL; scamper_addr_t *ip = NULL; if(state != NULL && state->cbs != NULL) { if(nd != NULL) { ip = nd->dst_ip; mac = nd->dst_mac; } while((nddo = dlist_head_pop(state->cbs)) != NULL) { nddo->node = NULL; if(ip != NULL) nddo->cb(nddo->param, ip, mac); free(nddo); } dlist_free(state->cbs); state->cbs = NULL; } if(nd != NULL) scamper_neighbourdisc_free(nd); if(state != NULL) nd_state_free(state); return; } static int nd_arg_param_validate(int optid, char *param, long *out) { long tmp; switch(optid) { case ND_OPT_IFNAME: case ND_OPT_ALLATTEMPTS: case ND_OPT_SRCADDR: return 0; case ND_OPT_ATTEMPTS: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 65535) return -1; break; case ND_OPT_REPLYC: if(string_tolong(param, &tmp) != 0 || tmp < 0 || tmp > 65535) return -1; break; case ND_OPT_WAIT: if(string_tolong(param, &tmp) != 0 || tmp < 100 || tmp > 65535) return -1; break; default: return -1; } if(out != NULL) *out = tmp; return 0; } int scamper_do_neighbourdisc_arg_validate(int argc, char *argv[], int *stop) { return scamper_options_validate(opts, opts_cnt, argc, argv, stop, nd_arg_param_validate); } scamper_task_t *scamper_do_neighbourdisc_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle) { scamper_neighbourdisc_t *nd = (scamper_neighbourdisc_t *)data; scamper_task_sig_t *sig = NULL; scamper_task_t *task = NULL; /* allocate a task structure and store the neighbourdisc with it */ if((task = scamper_task_alloc(nd, &nd_funcs)) == NULL) goto err; if((sig = scamper_task_sig_alloc(SCAMPER_TASK_SIG_TYPE_TX_ND)) == NULL) goto err; sig->sig_tx_nd_ip = scamper_addr_use(nd->dst_ip); if(scamper_task_sig_add(task, sig) != 0) goto err; sig = NULL; /* associate the list and cycle with the neighbourdisc */ nd->list = scamper_list_use(list); nd->cycle = scamper_cycle_use(cycle); return task; err: if(sig != NULL) scamper_task_sig_free(sig); if(task != NULL) { scamper_task_setdatanull(task); scamper_task_free(task); } return NULL; } void *scamper_do_neighbourdisc_alloc(char *str) { scamper_neighbourdisc_t *nd = NULL; scamper_option_out_t *opts_out = NULL, *opt; char *ifname = NULL; uint16_t attempts = 1; uint16_t replyc = 0; uint16_t wait = 1000; uint8_t flags = 0; char *dst = NULL; char *src = NULL; long tmp = 0; /* try and parse the string passed in */ if(scamper_options_parse(str, opts, opts_cnt, &opts_out, &dst) != 0) { scamper_debug(__func__, "could not parse command"); goto err; } if(dst == NULL) goto err; for(opt = opts_out; opt != NULL; opt = opt->next) { if(opt->type != SCAMPER_OPTION_TYPE_NULL && nd_arg_param_validate(opt->id, opt->str, &tmp) != 0) { scamper_debug(__func__, "validation of optid %d failed", opt->id); goto err; } switch(opt->id) { case ND_OPT_FIRSTRESPONSE: flags |= SCAMPER_NEIGHBOURDISC_FLAG_FIRSTRESPONSE; break; case ND_OPT_IFNAME: ifname = opt->str; break; case ND_OPT_ATTEMPTS: attempts = (uint16_t)tmp; break; case ND_OPT_REPLYC: replyc = (uint16_t)tmp; break; case ND_OPT_ALLATTEMPTS: flags |= SCAMPER_NEIGHBOURDISC_FLAG_ALLATTEMPTS; break; case ND_OPT_WAIT: wait = (uint16_t)tmp; break; case ND_OPT_SRCADDR: if(src != NULL) goto err; src = opt->str; break; default: scamper_debug(__func__, "unhandled option %d", opt->id); goto err; } } scamper_options_free(opts_out); opts_out = NULL; if(ifname == NULL) goto err; if((nd = scamper_neighbourdisc_alloc()) == NULL) goto err; if((nd->dst_ip = scamper_addrcache_resolve(addrcache,AF_UNSPEC,dst)) == NULL) goto err; if(SCAMPER_ADDR_TYPE_IS_IPV4(nd->dst_ip)) nd->method = SCAMPER_NEIGHBOURDISC_METHOD_ARP; else if(SCAMPER_ADDR_TYPE_IS_IPV6(nd->dst_ip)) nd->method = SCAMPER_NEIGHBOURDISC_METHOD_ND_NSOL; else goto err; if(src != NULL) { if(SCAMPER_ADDR_TYPE_IS_IPV6(nd->dst_ip) == 0) goto err; nd->src_ip = scamper_addrcache_resolve(addrcache, AF_INET6, src); if(nd->src_ip == NULL) goto err; } if(scamper_neighbourdisc_ifname_set(nd, ifname) != 0) goto err; /* * if we only want the first response, then we can't want more than * one reply */ if((flags & SCAMPER_NEIGHBOURDISC_FLAG_FIRSTRESPONSE) != 0 && (replyc > 1 || (flags & SCAMPER_NEIGHBOURDISC_FLAG_ALLATTEMPTS) != 0)) { scamper_debug(__func__, "invalid combination of arguments"); goto err; } /* * if we have asked for all attempts to be sent, but we have limited the * number of replies we want to less than the number of probes we will send, * then these arguments are conflicting */ if(replyc < attempts && replyc != 0 && (flags & SCAMPER_NEIGHBOURDISC_FLAG_ALLATTEMPTS) != 0) { scamper_debug(__func__, "invalid combination of arguments"); goto err; } nd->flags = flags; nd->attempts = attempts; nd->replyc = replyc; nd->wait = wait; return nd; err: if(nd != NULL) scamper_neighbourdisc_free(nd); if(opts_out != NULL) scamper_options_free(opts_out); return NULL; } void scamper_neighbourdisc_do_free(scamper_neighbourdisc_do_t *nddo) { scamper_task_t *task; nd_state_t *state; if(nddo == NULL) return; if((task = nddo->task) != NULL) { state = nd_getstate(task); if(state != NULL && nddo->node != NULL) dlist_node_pop(state->cbs, nddo->node); } free(nddo); return; } static scamper_neighbourdisc_do_t *scamper_neighbourdisc_do_add( scamper_task_t *task, void *param, void (*cb)(void *param,scamper_addr_t *ip,scamper_addr_t *dst)) { scamper_neighbourdisc_do_t *nddo = NULL; nd_state_t *state = nd_getstate(task); if(state->cbs == NULL && (state->cbs = dlist_alloc()) == NULL) { printerror(__func__, "could not alloc state->cbs"); return NULL; } if((nddo = malloc_zero(sizeof(scamper_neighbourdisc_do_t))) == NULL) { printerror(__func__, "could not alloc nddo"); return NULL; } nddo->task = task; nddo->cb = cb; nddo->param = param; if((nddo->node = dlist_tail_push(state->cbs, nddo)) == NULL) { printerror(__func__, "could not add nddo"); free(nddo); return NULL; } return nddo; } scamper_neighbourdisc_do_t *scamper_do_neighbourdisc_do( int ifindex, scamper_addr_t *dst, void *param, void (*cb)(void *param,scamper_addr_t *ip,scamper_addr_t *dst)) { scamper_neighbourdisc_t *nd = NULL; scamper_task_sig_t sig; scamper_task_t *task = NULL; uint8_t method; char ifname[64]; if(dst->type == SCAMPER_ADDR_TYPE_IPV4) method = SCAMPER_NEIGHBOURDISC_METHOD_ARP; else method = SCAMPER_NEIGHBOURDISC_METHOD_ND_NSOL; memset(&sig, 0, sizeof(sig)); sig.sig_type = SCAMPER_TASK_SIG_TYPE_TX_ND; sig.sig_tx_nd_ip = dst; /* piggy back on existing nd task if there is one */ if((task = scamper_task_find(&sig)) != NULL) return scamper_neighbourdisc_do_add(task, param, cb); if(scamper_if_getifname(ifname, sizeof(ifname), ifindex) != 0) goto err; if((nd = scamper_neighbourdisc_alloc()) == NULL) { printerror(__func__, "could not alloc nd"); goto err; } if(scamper_neighbourdisc_ifname_set(nd, ifname) != 0) { printerror(__func__, "could not set ifname"); goto err; } nd->method = method; nd->dst_ip = scamper_addr_use(dst); nd->flags |= SCAMPER_NEIGHBOURDISC_FLAG_FIRSTRESPONSE; nd->attempts = 1; nd->wait = 500; nd->replyc = 1; if((task = scamper_do_neighbourdisc_alloctask(nd, NULL, NULL)) == NULL) goto err; nd = NULL; if(scamper_task_sig_install(task) != 0) goto err; if(nd_state_alloc(task) != 0) goto err; do_nd_probe(task); if(scamper_task_queue_isdone(task)) goto err; return scamper_neighbourdisc_do_add(task, param, cb); err: if(nd != NULL) scamper_neighbourdisc_free(nd); return NULL; } void scamper_do_neighbourdisc_free(void *data) { scamper_neighbourdisc_free((scamper_neighbourdisc_t *)data); return; } void scamper_do_neighbourdisc_cleanup() { if(pktbuf != NULL) { free(pktbuf); pktbuf = NULL; } return; } int scamper_do_neighbourdisc_init() { nd_funcs.probe = do_nd_probe; nd_funcs.handle_timeout = do_nd_handle_timeout; nd_funcs.write = do_nd_write; nd_funcs.task_free = do_nd_free; nd_funcs.handle_dl = do_nd_handle_dl; nd_funcs.halt = do_nd_halt; return 0; } scamper-cvs-20171204/scamper/neighbourdisc/scamper_neighbourdisc_do.h000644 001751 000000 00000003340 11737356726 025605 0ustar00mjlwheel000000 000000 /* * scamper_do_neighbourdisc.h * * $Id: scamper_neighbourdisc_do.h,v 1.5 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2009-2010 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DO_NEIGHBOURDISC_H #define __SCAMPER_DO_NEIGHBOURDISC_H typedef struct scamper_neighbourdisc_do scamper_neighbourdisc_do_t; void *scamper_do_neighbourdisc_alloc(char *str); scamper_task_t *scamper_do_neighbourdisc_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle); int scamper_do_neighbourdisc_arg_validate(int argc, char *argv[], int *stop); void scamper_do_neighbourdisc_free(void *); const char *scamper_do_neighbourdisc_usage(void); /* code to use the neighbourdisc code to do IP->MAC for another scamper task */ scamper_neighbourdisc_do_t *scamper_do_neighbourdisc_do( int ifindex, scamper_addr_t *dst, void *param, void (*cb)(void *, scamper_addr_t *ip, scamper_addr_t *mac)); void scamper_neighbourdisc_do_free(scamper_neighbourdisc_do_t *nddo); void scamper_do_neighbourdisc_cleanup(void); int scamper_do_neighbourdisc_init(void); #endif /* __SCAMPER_DO_NEIGHBOURDISC_H */ scamper-cvs-20171204/scamper/neighbourdisc/scamper_neighbourdisc_warts.c000644 001751 000000 00000040452 13020235506 026316 0ustar00mjlwheel000000 000000 /* * scamper_neighbourdisc_warts.h * * $Id: scamper_neighbourdisc_warts.c,v 1.7 2016/12/02 09:13:42 mjl Exp $ * * Copyright (C) 2009-2016 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_neighbourdisc_warts.c,v 1.7 2016/12/02 09:13:42 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_neighbourdisc.h" #include "scamper_file.h" #include "scamper_file_warts.h" #include "scamper_neighbourdisc_warts.h" #include "mjl_splaytree.h" #include "utils.h" #define WARTS_NEIGHBOURDISC_LIST 1 #define WARTS_NEIGHBOURDISC_CYCLE 2 #define WARTS_NEIGHBOURDISC_USERID 3 #define WARTS_NEIGHBOURDISC_IFNAME 4 #define WARTS_NEIGHBOURDISC_START 5 #define WARTS_NEIGHBOURDISC_METHOD 6 #define WARTS_NEIGHBOURDISC_WAIT 7 #define WARTS_NEIGHBOURDISC_FLAGS 8 #define WARTS_NEIGHBOURDISC_ATTEMPTS 9 #define WARTS_NEIGHBOURDISC_REPLYC 10 #define WARTS_NEIGHBOURDISC_SRC_IP 11 #define WARTS_NEIGHBOURDISC_SRC_MAC 12 #define WARTS_NEIGHBOURDISC_DST_IP 13 #define WARTS_NEIGHBOURDISC_DST_MAC 14 #define WARTS_NEIGHBOURDISC_PROBEC 15 static const warts_var_t neighbourdisc_vars[] = { {WARTS_NEIGHBOURDISC_LIST, 4, -1}, {WARTS_NEIGHBOURDISC_CYCLE, 4, -1}, {WARTS_NEIGHBOURDISC_USERID, 4, -1}, {WARTS_NEIGHBOURDISC_IFNAME, -1, -1}, {WARTS_NEIGHBOURDISC_START, 8, -1}, {WARTS_NEIGHBOURDISC_METHOD, 1, -1}, {WARTS_NEIGHBOURDISC_WAIT, 2, -1}, {WARTS_NEIGHBOURDISC_FLAGS, 1, -1}, {WARTS_NEIGHBOURDISC_ATTEMPTS, 2, -1}, {WARTS_NEIGHBOURDISC_REPLYC, 2, -1}, {WARTS_NEIGHBOURDISC_SRC_IP, -1, -1}, {WARTS_NEIGHBOURDISC_SRC_MAC, -1, -1}, {WARTS_NEIGHBOURDISC_DST_IP, -1, -1}, {WARTS_NEIGHBOURDISC_DST_MAC, -1, -1}, {WARTS_NEIGHBOURDISC_PROBEC, 2, -1}, }; #define neighbourdisc_vars_mfb WARTS_VAR_MFB(neighbourdisc_vars) #define WARTS_NEIGHBOURDISC_PROBE_TX 1 #define WARTS_NEIGHBOURDISC_PROBE_RXC 2 static const warts_var_t neighbourdisc_probe_vars[] = { {WARTS_NEIGHBOURDISC_PROBE_TX, 8, -1}, {WARTS_NEIGHBOURDISC_PROBE_RXC, 4, -1}, }; #define neighbourdisc_probe_vars_mfb WARTS_VAR_MFB(neighbourdisc_probe_vars) #define WARTS_NEIGHBOURDISC_REPLY_RX 1 #define WARTS_NEIGHBOURDISC_REPLY_MAC 2 static const warts_var_t neighbourdisc_reply_vars[] = { {WARTS_NEIGHBOURDISC_REPLY_RX, 8, -1}, {WARTS_NEIGHBOURDISC_REPLY_MAC, -1, -1}, }; #define neighbourdisc_reply_vars_mfb WARTS_VAR_MFB(neighbourdisc_reply_vars) typedef struct warts_neighbourdisc_reply { uint8_t flags[WARTS_VAR_MFB(neighbourdisc_reply_vars)]; uint16_t flags_len; uint16_t params_len; } warts_neighbourdisc_reply_t; typedef struct warts_neighbourdisc_probe { uint8_t flags[WARTS_VAR_MFB(neighbourdisc_probe_vars)]; uint16_t flags_len; uint16_t params_len; warts_neighbourdisc_reply_t *rxs; } warts_neighbourdisc_probe_t; static int warts_neighbourdisc_reply_state(scamper_neighbourdisc_reply_t *reply, warts_neighbourdisc_reply_t *state, warts_addrtable_t *table, uint32_t *len) { const warts_var_t *var; int i, max_id = 0; memset(state->flags, 0, neighbourdisc_reply_vars_mfb); state->params_len = 0; for(i=0; iflags, var->id, &max_id); if(var->id == WARTS_NEIGHBOURDISC_REPLY_MAC) { state->params_len += warts_addr_size(table, reply->mac); continue; } assert(var->size != -1); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_neighbourdisc_reply_write(const scamper_neighbourdisc_reply_t *reply, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, warts_neighbourdisc_reply_t *state) { warts_param_writer_t handlers[] = { {&reply->rx, (wpw_t)insert_timeval, NULL}, {reply->mac, (wpw_t)insert_addr, table}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return 0; } static int warts_neighbourdisc_reply_read(scamper_neighbourdisc_reply_t *reply, warts_state_t *state, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&reply->rx, (wpr_t)extract_timeval, NULL}, {&reply->mac, (wpr_t)extract_addr, table}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); return warts_params_read(buf, off, len, handlers, handler_cnt); } static int warts_neighbourdisc_probe_state(const scamper_file_t *sf, scamper_neighbourdisc_probe_t *probe, warts_neighbourdisc_probe_t *state, warts_addrtable_t *table, uint32_t *len) { const warts_var_t *var; int i, max_id = 0; size_t size; memset(state->flags, 0, neighbourdisc_probe_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_NEIGHBOURDISC_PROBE_RXC && probe->rxc == 0) continue; flag_set(state->flags, var->id, &max_id); assert(var->size != -1); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); state->rxs = NULL; if(probe->rxc > 0) { size = sizeof(warts_neighbourdisc_reply_t) * probe->rxc; if((state->rxs = malloc_zero(size)) == NULL) return -1; for(i=0; irxc; i++) { if(warts_neighbourdisc_reply_state(probe->rxs[i], &state->rxs[i], table, len) != 0) { free(state->rxs); state->rxs = NULL; return -1; } } } /* increase length required for the probe record */ *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_neighbourdisc_probe_write(const scamper_neighbourdisc_probe_t *probe, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, warts_neighbourdisc_probe_t *state) { uint16_t i; warts_param_writer_t handlers[] = { {&probe->tx, (wpw_t)insert_timeval, NULL}, {&probe->rxc, (wpw_t)insert_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); for(i=0; irxc; i++) { warts_neighbourdisc_reply_write(probe->rxs[i], sf, table, buf, off, len, &state->rxs[i]); } return 0; } static int warts_neighbourdisc_probe_read(scamper_neighbourdisc_probe_t *pr, warts_state_t *state, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { scamper_neighbourdisc_reply_t *reply; uint16_t i; warts_param_reader_t handlers[] = { {&pr->tx, (wpr_t)extract_timeval, NULL}, {&pr->rxc, (wpr_t)extract_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; if(pr->rxc == 0) return 0; if(scamper_neighbourdisc_replies_alloc(pr, pr->rxc) != 0) return -1; for(i=0; irxc; i++) { if((reply = scamper_neighbourdisc_reply_alloc()) == NULL) return -1; pr->rxs[i] = reply; if(warts_neighbourdisc_reply_read(reply,state,table,buf,off,len) != 0) return -1; } return 0; } static void warts_neighbourdisc_params(const scamper_neighbourdisc_t *nd, warts_addrtable_t *table, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { int i, max_id = 0; const warts_var_t *var; memset(flags, 0, neighbourdisc_vars_mfb); *params_len = 0; for(i=0; iid == WARTS_NEIGHBOURDISC_LIST && nd->list == NULL) || (var->id == WARTS_NEIGHBOURDISC_CYCLE && nd->cycle == NULL) || (var->id == WARTS_NEIGHBOURDISC_USERID && nd->userid == 0) || (var->id == WARTS_NEIGHBOURDISC_IFNAME && nd->ifname == NULL) || (var->id == WARTS_NEIGHBOURDISC_SRC_IP && nd->src_ip == NULL) || (var->id == WARTS_NEIGHBOURDISC_SRC_MAC && nd->src_mac == NULL) || (var->id == WARTS_NEIGHBOURDISC_DST_IP && nd->dst_ip == NULL) || (var->id == WARTS_NEIGHBOURDISC_DST_MAC && nd->dst_mac == NULL) || (var->id == WARTS_NEIGHBOURDISC_PROBEC && nd->probec == 0)) continue; flag_set(flags, var->id, &max_id); if(var->size < 0) { if(var->id == WARTS_NEIGHBOURDISC_SRC_IP) *params_len += warts_addr_size(table, nd->src_ip); else if(var->id == WARTS_NEIGHBOURDISC_SRC_MAC) *params_len += warts_addr_size(table, nd->src_mac); else if(var->id == WARTS_NEIGHBOURDISC_DST_IP) *params_len += warts_addr_size(table, nd->dst_ip); else if(var->id == WARTS_NEIGHBOURDISC_DST_MAC) *params_len += warts_addr_size(table, nd->dst_mac); else if(var->id == WARTS_NEIGHBOURDISC_IFNAME) *params_len += warts_str_size(nd->ifname); continue; } assert(var->size >= 0); *params_len += var->size; } *flags_len = fold_flags(flags, max_id); return; } static int warts_neighbourdisc_params_write(const scamper_neighbourdisc_t *nd, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len) { uint32_t list_id, cycle_id; warts_param_writer_t handlers[] = { {&list_id, (wpw_t)insert_uint32, NULL}, {&cycle_id, (wpw_t)insert_uint32, NULL}, {&nd->userid, (wpw_t)insert_uint32, NULL}, {nd->ifname, (wpw_t)insert_string, NULL}, {&nd->start, (wpw_t)insert_timeval, NULL}, {&nd->method, (wpw_t)insert_byte, NULL}, {&nd->wait, (wpw_t)insert_uint16, NULL}, {&nd->flags, (wpw_t)insert_byte, NULL}, {&nd->attempts, (wpw_t)insert_uint16, NULL}, {&nd->replyc, (wpw_t)insert_uint16, NULL}, {nd->src_ip, (wpw_t)insert_addr, table}, {nd->src_mac, (wpw_t)insert_addr, table}, {nd->dst_ip, (wpw_t)insert_addr, table}, {nd->dst_mac, (wpw_t)insert_addr, table}, {&nd->probec, (wpw_t)insert_uint16, table}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); if(warts_list_getid(sf, nd->list, &list_id) == -1) return -1; if(warts_cycle_getid(sf, nd->cycle, &cycle_id) == -1) return -1; warts_params_write(buf, off, len, flags, flags_len, params_len, handlers, handler_cnt); return 0; } static int warts_neighbourdisc_params_read(scamper_neighbourdisc_t *nd, warts_addrtable_t *table, warts_state_t *state, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&nd->list, (wpr_t)extract_list, state}, {&nd->cycle, (wpr_t)extract_cycle, state}, {&nd->userid, (wpr_t)extract_uint32, NULL}, {&nd->ifname, (wpr_t)extract_string, NULL}, {&nd->start, (wpr_t)extract_timeval, NULL}, {&nd->method, (wpr_t)extract_byte, NULL}, {&nd->wait, (wpr_t)extract_uint16, NULL}, {&nd->flags, (wpr_t)extract_byte, NULL}, {&nd->attempts, (wpr_t)extract_uint16, NULL}, {&nd->replyc, (wpr_t)extract_uint16, NULL}, {&nd->src_ip, (wpr_t)extract_addr, table}, {&nd->src_mac, (wpr_t)extract_addr, table}, {&nd->dst_ip, (wpr_t)extract_addr, table}, {&nd->dst_mac, (wpr_t)extract_addr, table}, {&nd->probec, (wpr_t)extract_uint16, NULL}, }; const int handler_cnt = sizeof(handlers) / sizeof(warts_param_reader_t); int rc; if((rc = warts_params_read(buf, off, len, handlers, handler_cnt)) != 0) return rc; if(nd->src_mac == NULL) return -1; return 0; } static void warts_neighbourdisc_probes_free(warts_neighbourdisc_probe_t *ps, uint32_t cnt) { uint16_t i; if(ps != NULL) { for(i=0; iprobec > 0) { size = nd->probec * sizeof(warts_neighbourdisc_probe_t); if((probes = (warts_neighbourdisc_probe_t *)malloc_zero(size)) == NULL) goto err; for(i=0; iprobec; i++) { probe = nd->probes[i]; len2 = len; if(warts_neighbourdisc_probe_state(sf, probe, &probes[i], table, &len2) != 0) goto err; if(len2 < len) goto err; len = len2; } } if((buf = malloc_zero(len)) == NULL) goto err; insert_wartshdr(buf, &off, len, SCAMPER_FILE_OBJ_NEIGHBOURDISC); if(warts_neighbourdisc_params_write(nd, sf, table, buf, &off, len, flags, flags_len, params_len) != 0) { goto err; } if(nd->probec > 0) { for(i=0; iprobec; i++) { probe = nd->probes[i]; warts_neighbourdisc_probe_write(probe, sf, table, buf, &off, len, &probes[i]); } } warts_neighbourdisc_probes_free(probes, nd->probec); probes = NULL; assert(off == len); if(warts_write(sf, buf, len) == -1) { goto err; } warts_addrtable_free(table); free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(probes != NULL) warts_neighbourdisc_probes_free(probes, nd->probec); if(buf != NULL) free(buf); return -1; } int scamper_file_warts_neighbourdisc_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_neighbourdisc_t **nd_out) { scamper_neighbourdisc_t *nd = NULL; scamper_neighbourdisc_probe_t *probe; warts_addrtable_t *table = NULL; warts_state_t *state = scamper_file_getstate(sf); uint8_t *buf = NULL; uint32_t off = 0; uint16_t i; if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { *nd_out = NULL; return 0; } if((nd = scamper_neighbourdisc_alloc()) == NULL) { goto err; } if((table = warts_addrtable_alloc_byid()) == NULL) goto err; if(warts_neighbourdisc_params_read(nd,table,state,buf,&off,hdr->len) != 0) { goto err; } if(nd->probec == 0) goto done; if(scamper_neighbourdisc_probes_alloc(nd, nd->probec) != 0) { goto err; } for(i=0; iprobec; i++) { if((probe = scamper_neighbourdisc_probe_alloc()) == NULL) { goto err; } nd->probes[i] = probe; if(warts_neighbourdisc_probe_read(probe, state, table, buf, &off, hdr->len) != 0) { goto err; } } done: warts_addrtable_free(table); *nd_out = nd; free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(buf != NULL) free(buf); if(nd != NULL) scamper_neighbourdisc_free(nd); return -1; } scamper-cvs-20171204/scamper/neighbourdisc/scamper_neighbourdisc_warts.h000644 001751 000000 00000002252 11452510530 026317 0ustar00mjlwheel000000 000000 /* * scamper_neighbourdisc_warts.h * * $Id: scamper_neighbourdisc_warts.h,v 1.1 2010/10/05 02:45:44 mjl Exp $ * * Copyright (C) 2009-2010 Matthew Luckie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_NEIGHBOURDISC_WARTS_H #define __SCAMPER_NEIGHBOURDISC_WARTS_H int scamper_file_warts_neighbourdisc_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_neighbourdisc_t **nd_out); int scamper_file_warts_neighbourdisc_write(const scamper_file_t *sf, const scamper_neighbourdisc_t *nd); #endif /* __SCAMPER_NEIGHBOURDISC_WARTS_H */ scamper-cvs-20171204/scamper/dealias/.cvsignore000644 001751 000000 00000000034 12415633115 021145 0ustar00mjlwheel000000 000000 .deps .dirstamp .libs *.lo scamper-cvs-20171204/scamper/dealias/scamper_dealias.c000644 001751 000000 00000060370 13014473037 022437 0ustar00mjlwheel000000 000000 /* * scamper_dealias.c * * $Id: scamper_dealias.c,v 1.51 2016/11/21 04:20:47 mjl Exp $ * * Copyright (C) 2008-2010 The University of Waikato * Copyright (C) 2012-2013 The Regents of the University of California * Author: Matthew Luckie * * This code implements alias resolution techniques published by others * which require the network to be probed; the author of each technique * is detailed with its data structures. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_dealias.c,v 1.51 2016/11/21 04:20:47 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_dealias.h" #include "utils.h" int scamper_dealias_ipid(const scamper_dealias_probe_t **probes, uint32_t probec, scamper_dealias_ipid_t *ipid) { const scamper_dealias_probe_t *p; const scamper_dealias_reply_t *r; uint32_t bs_mind = 0x30000; uint32_t bs_maxd = 0; uint32_t bs_sum = 0; uint32_t mind = 0x30000; uint32_t maxd = 0; uint32_t sum = 0; uint32_t diff; uint32_t cur, prev; uint32_t i; int echo, cons; ipid->type = SCAMPER_DEALIAS_IPID_UNKNOWN; echo = 1; cons = 1; if(probec == 0 || probes[0] == NULL || probes[0]->replyc != 1) return 0; prev = probes[0]->replies[0]->ipid; for(i=1; ireplyc != 1) return 0; if((r = p->replies[0]) == NULL) return 0; /* non byteswap case */ cur = r->ipid; if(cur > prev) diff = cur - prev; else if(cur < prev) diff = 0x10000 + cur - prev; else diff = 0; if(diff < mind) mind = diff; if(diff > maxd) maxd = diff; sum += diff; /* byteswap case */ cur = byteswap16(r->ipid); prev = byteswap16(prev); if(cur > prev) diff = cur - prev; else if(cur < prev) diff = 0x10000 + cur - prev; else diff = 0; if(diff < bs_mind) bs_mind = diff; if(diff > maxd) bs_maxd = diff; bs_sum += diff; if(echo != 0 && p->ipid != r->ipid && p->ipid != byteswap16(r->ipid)) echo = 0; else if(cons != 0 && probes[i-1]->replies[0]->ipid != r->ipid) cons = 0; prev = r->ipid; } if(cons == 0 && echo == 0) { /* figure out which byte ordering best explains the sequence */ if(sum < bs_sum) { ipid->mind = mind; ipid->maxd = maxd; } else { ipid->mind = bs_mind; ipid->maxd = bs_maxd; } ipid->type = SCAMPER_DEALIAS_IPID_INCR; } else if(cons != 0) { if(probes[0]->replies[0]->ipid == 0) ipid->type = SCAMPER_DEALIAS_IPID_ZERO; else ipid->type = SCAMPER_DEALIAS_IPID_CONST; } else if(echo != 0) { ipid->type = SCAMPER_DEALIAS_IPID_ECHO; } return 0; } static void dealias_probedef_free(scamper_dealias_probedef_t *probedef) { if(probedef->src != NULL) { scamper_addr_free(probedef->src); probedef->src = NULL; } if(probedef->dst != NULL) { scamper_addr_free(probedef->dst); probedef->dst = NULL; } return; } static void dealias_mercator_free(void *data) { scamper_dealias_mercator_t *mercator = (scamper_dealias_mercator_t *)data; dealias_probedef_free(&mercator->probedef); free(mercator); return; } static void dealias_ally_free(void *data) { scamper_dealias_ally_t *ally = (scamper_dealias_ally_t *)data; dealias_probedef_free(&ally->probedefs[0]); dealias_probedef_free(&ally->probedefs[1]); free(ally); return; } static void dealias_radargun_free(void *data) { scamper_dealias_radargun_t *radargun = (scamper_dealias_radargun_t *)data; uint32_t i; if(radargun->probedefs != NULL) { for(i=0; iprobedefc; i++) { dealias_probedef_free(&radargun->probedefs[i]); } free(radargun->probedefs); } free(radargun); return; } static void dealias_prefixscan_free(void *data) { scamper_dealias_prefixscan_t *prefixscan = data; uint16_t i; if(prefixscan == NULL) return; if(prefixscan->a != NULL) scamper_addr_free(prefixscan->a); if(prefixscan->b != NULL) scamper_addr_free(prefixscan->b); if(prefixscan->ab != NULL) scamper_addr_free(prefixscan->ab); if(prefixscan->xs != NULL) { for(i=0; ixc; i++) if(prefixscan->xs[i] != NULL) scamper_addr_free(prefixscan->xs[i]); free(prefixscan->xs); } if(prefixscan->probedefs != NULL) { for(i=0; iprobedefc; i++) dealias_probedef_free(&prefixscan->probedefs[i]); free(prefixscan->probedefs); } free(prefixscan); return; } static void dealias_bump_free(void *data) { scamper_dealias_bump_t *bump = (scamper_dealias_bump_t *)data; dealias_probedef_free(&bump->probedefs[0]); dealias_probedef_free(&bump->probedefs[1]); free(bump); return; } const char *scamper_dealias_probedef_method_tostr(const scamper_dealias_probedef_t *d, char *b, size_t l) { static const char *m[] = { NULL, "icmp-echo", "tcp-ack", "udp", "tcp-ack-sport", "udp-dport", "tcp-syn-sport", }; if(d->method > sizeof(m) / sizeof(char *) || m[d->method] == NULL) { snprintf(b, l, "%d", d->method); return b; } return m[d->method]; } scamper_dealias_probedef_t *scamper_dealias_probedef_alloc(void) { size_t size = sizeof(scamper_dealias_probedef_t); return (scamper_dealias_probedef_t *)malloc_zero(size); } void scamper_dealias_probedef_free(scamper_dealias_probedef_t *probedef) { dealias_probedef_free(probedef); free(probedef); return; } scamper_dealias_probe_t *scamper_dealias_probe_alloc(void) { size_t size = sizeof(scamper_dealias_probe_t); return (scamper_dealias_probe_t *)malloc_zero(size); } void scamper_dealias_probe_free(scamper_dealias_probe_t *probe) { uint16_t i; if(probe->replies != NULL) { for(i=0; ireplyc; i++) { if(probe->replies[i] != NULL) scamper_dealias_reply_free(probe->replies[i]); } free(probe->replies); } free(probe); return; } scamper_dealias_reply_t *scamper_dealias_reply_alloc(void) { size_t size = sizeof(scamper_dealias_reply_t); return (scamper_dealias_reply_t *)malloc_zero(size); } void scamper_dealias_reply_free(scamper_dealias_reply_t *reply) { if(reply->src != NULL) scamper_addr_free(reply->src); free(reply); return; } uint32_t scamper_dealias_reply_count(const scamper_dealias_t *dealias) { uint32_t rc = 0; uint16_t i; for(i=0; iprobec; i++) { if(dealias->probes[i] != NULL) rc += dealias->probes[i]->replyc; } return rc; } static int dealias_probe_tx_cmp(const scamper_dealias_probe_t *a, const scamper_dealias_probe_t *b) { return timeval_cmp(&a->tx, &b->tx); } static int dealias_probe_seq_cmp(const scamper_dealias_probe_t *a, const scamper_dealias_probe_t *b) { if(a->seq < b->seq) return -1; if(a->seq > b->seq) return 1; if(a->def->id < b->def->id) return -1; if(a->def->id > b->def->id) return 1; return 0; } static int dealias_probe_def_cmp(const scamper_dealias_probe_t *a, const scamper_dealias_probe_t *b) { if(a->def->id < b->def->id) return -1; if(a->def->id > b->def->id) return 1; if(a->seq < b->seq) return -1; if(a->seq > b->seq) return 1; return 0; } void scamper_dealias_probes_sort_tx(scamper_dealias_t *dealias) { array_qsort((void **)dealias->probes, dealias->probec, (array_cmp_t)dealias_probe_tx_cmp); return; } void scamper_dealias_probes_sort_seq(scamper_dealias_t *dealias) { array_qsort((void **)dealias->probes, dealias->probec, (array_cmp_t)dealias_probe_seq_cmp); return; } void scamper_dealias_probes_sort_def(scamper_dealias_t *dealias) { array_qsort((void **)dealias->probes, dealias->probec, (array_cmp_t)dealias_probe_def_cmp); return; } int scamper_dealias_probe_add(scamper_dealias_t *dealias, scamper_dealias_probe_t *probe) { size_t size = (dealias->probec+1) * sizeof(scamper_dealias_probe_t *); if(realloc_wrap((void **)&dealias->probes, size) == 0) { dealias->probes[dealias->probec++] = probe; return 0; } return -1; } int scamper_dealias_reply_add(scamper_dealias_probe_t *probe, scamper_dealias_reply_t *reply) { size_t size = (probe->replyc+1) * sizeof(scamper_dealias_reply_t *); if(realloc_wrap((void **)&probe->replies, size) == 0) { probe->replies[probe->replyc++] = reply; return 0; } return -1; } int scamper_dealias_ally_alloc(scamper_dealias_t *dealias) { if((dealias->data = malloc_zero(sizeof(scamper_dealias_ally_t))) != NULL) return 0; return -1; } int scamper_dealias_mercator_alloc(scamper_dealias_t *dealias) { if((dealias->data = malloc_zero(sizeof(scamper_dealias_mercator_t))) != NULL) return 0; return -1; } int scamper_dealias_radargun_alloc(scamper_dealias_t *dealias) { if((dealias->data = malloc_zero(sizeof(scamper_dealias_radargun_t))) != NULL) return 0; return -1; } int scamper_dealias_prefixscan_alloc(scamper_dealias_t *dealias) { dealias->data = malloc_zero(sizeof(scamper_dealias_prefixscan_t)); if(dealias->data != NULL) return 0; return -1; } int scamper_dealias_bump_alloc(scamper_dealias_t *dealias) { if((dealias->data = malloc_zero(sizeof(scamper_dealias_bump_t))) != NULL) return 0; return -1; } static uint16_t dealias_ipid16_diff(uint16_t a, uint16_t b) { if(a <= b) return b - a; return (0xFFFFUL - a) + b + 1; } static int dealias_ipid16_inseq2(uint16_t a, uint16_t b, uint16_t fudge) { if(a == b || dealias_ipid16_diff(a, b) > fudge) return 0; return 1; } static int dealias_ipid16_inseq3(uint32_t a,uint32_t b,uint32_t c,uint32_t f) { if(a == b || b == c || a == c) return 0; if(a > b) b += 0x10000; if(a > c) c += 0x10000; if(a > b || b > c) return 0; if(f != 0 && (b - a > f || c - b > f)) return 0; return 1; } static uint32_t dealias_ipid32_diff(uint32_t a, uint32_t b) { if(a <= b) return b - a; return (0xFFFFFFFFUL - a) + b + 1; } static int dealias_ipid32_inseq2(uint32_t a, uint32_t b, uint32_t fudge) { if(a == b || dealias_ipid32_diff(a, b) > fudge) return 0; return 1; } static int dealias_ipid32_inseq3(uint64_t a,uint64_t b,uint64_t c,uint64_t f) { if(a == b || b == c || a == c) return 0; if(a > b) b += 0x100000000ULL; if(a > c) c += 0x100000000ULL; if(a > b || b > c) return 0; if(f != 0 && (b - a > f || c - b > f)) return 0; return 1; } static int dealias_ipid16_bo(scamper_dealias_probe_t **probes, int probec) { scamper_dealias_probe_t **s = NULL; uint16_t a, b, c = 1, max_bs = 0, max_nobs = 0, u16; int i, rc = 2; if((s = memdup(probes, sizeof(scamper_dealias_probe_t *) * probec)) == NULL) return -1; array_qsort((void **)s, probec, (array_cmp_t)dealias_probe_def_cmp); for(i=0; idef != s[i+1]->def) { if(c >= 3) { if(max_nobs < max_bs) rc = 0; else if(max_nobs > max_bs) rc = 1; if(rc == 0) goto done; } c = 1; max_nobs = 0; max_bs = 0; } else { a = s[i]->replies[0]->ipid; b = s[i+1]->replies[0]->ipid; u16 = dealias_ipid16_diff(a, b); if(u16 > max_nobs || max_nobs == 0) max_nobs = u16; u16 = dealias_ipid16_diff(byteswap16(a), byteswap16(b)); if(u16 > max_bs || max_bs == 0) max_bs = u16; c++; } } done: if(s != NULL) free(s); return rc; } static int dealias_ipid16_inseq(scamper_dealias_probe_t **probes, int probec, uint16_t fudge, int bs) { uint16_t a, b, c; int i; /* * do a preliminary check to see if the ipids could be in sequence with * two samples. */ if(probec == 2) { /* if it is a strict sequence check, we don't actually know */ if(fudge == 0) return 1; a = probes[0]->replies[0]->ipid; b = probes[1]->replies[0]->ipid; if(bs != 0) { a = byteswap16(a); b = byteswap16(b); } if(dealias_ipid16_inseq2(a, b, fudge) != 0) return 1; return 0; } for(i=0; i+2replies[0]->ipid; b = probes[i+1]->replies[0]->ipid; c = probes[i+2]->replies[0]->ipid; if(bs != 0) { a = byteswap16(a); b = byteswap16(b); c = byteswap16(c); } if(dealias_ipid16_inseq3(a, b, c, fudge) == 0) return 0; } return 1; } static int dealias_ipid32_bo(scamper_dealias_probe_t **probes, int probec) { scamper_dealias_probe_t **s = NULL; uint32_t a, b, c = 1, max_bs = 0, max_nobs = 0, u32; int i, rc = 2; if((s = memdup(probes, sizeof(scamper_dealias_probe_t *) * probec)) == NULL) return -1; array_qsort((void **)s, probec, (array_cmp_t)dealias_probe_def_cmp); for(i=0; idef != s[i+1]->def) { if(c >= 3) { if(max_nobs < max_bs) rc = 0; else if(max_nobs > max_bs) rc = 1; if(rc == 0) goto done; } c = 1; max_nobs = 0; max_bs = 0; } else { a = s[i]->replies[0]->ipid32; b = s[i+1]->replies[0]->ipid32; u32 = dealias_ipid32_diff(a, b); if(u32 > max_nobs || max_nobs == 0) max_nobs = u32; u32 = dealias_ipid32_diff(byteswap32(a), byteswap32(b)); if(u32 > max_bs || max_bs == 0) max_bs = u32; c++; } } done: if(s != NULL) free(s); return rc; } static int dealias_ipid32_inseq(scamper_dealias_probe_t **probes, int probec, uint16_t fudge, int bs) { uint32_t a, b, c; int i; /* * do a preliminary check to see if the ipids could be in sequence with * two samples. */ if(probec == 2) { /* if it is a strict sequence check, we don't actually know */ if(fudge == 0) return 1; a = probes[0]->replies[0]->ipid32; b = probes[1]->replies[0]->ipid32; if(bs != 0) { a = byteswap32(a); b = byteswap32(b); } if(dealias_ipid32_inseq2(a, b, fudge) != 0) return 1; return 0; } for(i=0; i+2replies[0]->ipid32; b = probes[i+1]->replies[0]->ipid32; c = probes[i+2]->replies[0]->ipid32; if(bs != 0) { a = byteswap32(a); b = byteswap32(b); c = byteswap32(c); } if(dealias_ipid32_inseq3(a, b, c, fudge) == 0) return 0; } return 1; } int scamper_dealias_ipid_inseq(scamper_dealias_probe_t **probes, int probec, uint16_t fudge, int bs) { static int (*const inseq[])(scamper_dealias_probe_t **,int,uint16_t,int) = { dealias_ipid16_inseq, dealias_ipid32_inseq, }; static int (*const bo[])(scamper_dealias_probe_t **, int) = { dealias_ipid16_bo, dealias_ipid32_bo, }; int i, x; if(probec < 2) return -1; if(SCAMPER_ADDR_TYPE_IS_IPV4(probes[0]->def->dst)) x = 0; else if(SCAMPER_ADDR_TYPE_IS_IPV6(probes[0]->def->dst)) x = 1; else return -1; if(bs == 3 && fudge == 0) { if((i = bo[x](probes, probec)) == -1) return -1; return inseq[x](probes, probec, fudge, i); } if(bs == 2 || bs == 3) { if(inseq[x](probes, probec, fudge, 0) == 1) return 1; return inseq[x](probes, probec, fudge, 1); } return inseq[x](probes, probec, fudge, bs); } int scamper_dealias_probes_alloc(scamper_dealias_t *dealias, uint32_t cnt) { size_t size = cnt * sizeof(scamper_dealias_probe_t *); if((dealias->probes = malloc_zero(size)) == NULL) return -1; return 0; } int scamper_dealias_replies_alloc(scamper_dealias_probe_t *probe, uint16_t cnt) { size_t size = cnt * sizeof(scamper_dealias_reply_t *); if((probe->replies = malloc_zero(size)) == NULL) return -1; return 0; } int scamper_dealias_radargun_probedefs_alloc(scamper_dealias_radargun_t *rg, uint32_t probedefc) { size_t len = probedefc * sizeof(scamper_dealias_probedef_t); if((rg->probedefs = malloc_zero(len)) == NULL) return -1; return 0; } typedef struct dealias_resolv { scamper_dealias_probe_t **probes; int probec; int probet; } dealias_resolv_t; static int dealias_fudge_inseq(scamper_dealias_probe_t *pr_a, scamper_dealias_probe_t *pr_b, int bs, int fudge) { uint32_t a = pr_a->replies[0]->ipid; uint32_t b = pr_b->replies[0]->ipid; if(bs != 0) { a = byteswap16(a); b = byteswap16(b); } if(a > b) b += 0x10000; if((int)(b - a) > fudge) return 0; return 1; } int scamper_dealias_prefixscan_xs_add(scamper_dealias_t *dealias, scamper_addr_t *addr) { scamper_dealias_prefixscan_t *prefixscan = dealias->data; int tmp; if(array_find((void **)prefixscan->xs, prefixscan->xc, addr, (array_cmp_t)scamper_addr_cmp) != NULL) return 0; if((tmp = prefixscan->xc) == 65535) return -1; if(array_insert((void ***)&prefixscan->xs, &tmp, addr, (array_cmp_t)scamper_addr_cmp) != 0) return -1; scamper_addr_use(addr); prefixscan->xc++; return 0; } int scamper_dealias_prefixscan_xs_in(scamper_dealias_t *dealias, scamper_addr_t *addr) { scamper_dealias_prefixscan_t *prefixscan = dealias->data; if(array_find((void **)prefixscan->xs, prefixscan->xc, addr, (array_cmp_t)scamper_addr_cmp) != NULL) return 1; return 0; } int scamper_dealias_prefixscan_xs_alloc(scamper_dealias_prefixscan_t *p, uint16_t xc) { if((p->xs = malloc_zero(sizeof(scamper_addr_t *) * xc)) != NULL) return 0; return -1; } int scamper_dealias_prefixscan_probedefs_alloc(scamper_dealias_prefixscan_t *p, uint32_t probedefc) { size_t len = probedefc * sizeof(scamper_dealias_probedef_t); if((p->probedefs = malloc_zero(len)) != NULL) return 0; return -1; } int scamper_dealias_prefixscan_probedef_add(scamper_dealias_t *dealias, scamper_dealias_probedef_t *def) { scamper_dealias_prefixscan_t *prefixscan = dealias->data; size_t size; /* make the probedef array one bigger */ size = sizeof(scamper_dealias_probedef_t) * (prefixscan->probedefc+1); if(realloc_wrap((void **)&prefixscan->probedefs, size) != 0) return -1; /* add the probedef to the array */ memcpy(&prefixscan->probedefs[prefixscan->probedefc], def, sizeof(scamper_dealias_probedef_t)); /* update the probedef with an id, and get references to the addresses */ def = &prefixscan->probedefs[prefixscan->probedefc]; def->id = prefixscan->probedefc++; scamper_addr_use(def->src); scamper_addr_use(def->dst); return 0; } int scamper_dealias_radargun_fudge(scamper_dealias_t *dealias, scamper_dealias_probedef_t *def, scamper_dealias_probedef_t **defs, int *cnt, int fudge) { scamper_dealias_radargun_t *rg = dealias->data; scamper_dealias_probe_t *pr, *pr_a, *pr_b; scamper_dealias_reply_t *re, *re_a, *re_b, *re_c; dealias_resolv_t *dr = NULL; dealias_resolv_t *drd; uint32_t pid, x; int i, j, k, bs, inseq, d = 0; if(dealias->method != SCAMPER_DEALIAS_METHOD_RADARGUN) goto err; if((dr = malloc_zero(sizeof(dealias_resolv_t) * rg->probedefc)) == NULL) goto err; for(x=0; xprobec; x++) { pr = dealias->probes[x]; pid = pr->def->id; /* * if this probedef has already been determined to be useless for * alias resolution, skip it */ if(dr[pid].probec < 0) continue; if(pr->replyc > 1) { if(dr[pid].probes != NULL) free(dr[pid].probes); dr[pid].probec = -1; if(pr->def == def) goto done; continue; } /* total number of probes transmitted */ dr[pid].probet++; if(pr->replyc == 0) continue; re = pr->replies[0]; /* * with three replies, do some basic checks to see if we should * continue considering this probedef. */ if(dr[pid].probec == 2) { pr_a = dr[pid].probes[0]; pr_b = dr[pid].probes[1]; re_a = pr_a->replies[0]; re_b = pr_b->replies[0]; if((re->ipid == pr->ipid && re_a->ipid == pr_a->ipid && re_b->ipid == pr_b->ipid) || (re->ipid == re_a->ipid && re->ipid == re_b->ipid)) { free(dr[pid].probes); dr[pid].probec = -1; if(pr->def == def) goto done; continue; } } if(array_insert((void ***)&dr[pid].probes,&dr[pid].probec,pr,NULL) != 0) goto err; } /* figure out if we should byteswap the ipid sequence */ if(dr[def->id].probec < 3) goto done; re_a = dr[def->id].probes[0]->replies[0]; re_b = dr[def->id].probes[1]->replies[0]; re_c = dr[def->id].probes[2]->replies[0]; if(re_a->ipid < re_b->ipid) i = re_b->ipid - re_a->ipid; else i = 0x10000 + re_b->ipid - re_a->ipid; if(re_b->ipid < re_c->ipid) i += re_c->ipid - re_b->ipid; else i += 0x10000 + re_c->ipid - re_b->ipid; if(byteswap16(re_a->ipid) < byteswap16(re_b->ipid)) j = byteswap16(re_b->ipid) - byteswap16(re_a->ipid); else j = 0x10000 + byteswap16(re_b->ipid) - byteswap16(re_a->ipid); if(byteswap16(re_b->ipid) < byteswap16(re_c->ipid)) j += byteswap16(re_c->ipid) - byteswap16(re_b->ipid); else j += 0x10000 + byteswap16(re_c->ipid) - byteswap16(re_b->ipid); if(i < j) bs = 0; else bs = 1; /* for each probedef, consider if it could be an alias */ drd = &dr[def->id]; d = 0; for(pid=0; pidprobedefc; pid++) { if(&rg->probedefs[pid] == def || dr[pid].probec < 3) continue; j = 0; k = 0; /* get the first ipid */ if(timeval_cmp(&drd->probes[j]->tx, &dr[pid].probes[k]->tx) < 0) pr_a = drd->probes[j++]; else pr_a = dr[pid].probes[k++]; for(;;) { if(timeval_cmp(&drd->probes[j]->tx, &dr[pid].probes[k]->tx) < 0) pr_b = drd->probes[j++]; else pr_b = dr[pid].probes[k++]; if((inseq = dealias_fudge_inseq(pr_a, pr_b, bs, fudge)) == 0) break; if(j == drd->probec || k == dr[pid].probec) break; } /* * if the pairs do not appear to have insequence IP-ID values, then * abandon */ if(inseq == 0) continue; defs[d++] = &rg->probedefs[pid]; if(d == *cnt) break; } done: *cnt = d; for(x=0; xprobedefc; x++) if(dr[x].probec > 0) free(dr[x].probes); free(dr); return 0; err: if(dr != NULL) { for(x=0; xprobedefc; x++) if(dr[x].probec > 0) free(dr[x].probes); free(dr); } return -1; } const char *scamper_dealias_method_tostr(const scamper_dealias_t *d, char *b, size_t l) { static const char *m[] = { NULL, "mercator", "ally", "radargun", "prefixscan", "bump", }; if(d->method > sizeof(m) / sizeof(char *) || m[d->method] == NULL) { snprintf(b, l, "%d", d->method); return b; } return m[d->method]; } const char *scamper_dealias_result_tostr(const scamper_dealias_t *d, char *b, size_t l) { static char *t[] = { "none", "aliases", "not-aliases", "halted", "ipid-echo", }; if(d->result > sizeof(t) / sizeof(char *) || t[d->result] == NULL) { snprintf(b, l, "%d", d->result); return b; } return t[d->result]; } void scamper_dealias_free(scamper_dealias_t *dealias) { static void (*const func[])(void *) = { dealias_mercator_free, dealias_ally_free, dealias_radargun_free, dealias_prefixscan_free, dealias_bump_free, }; uint32_t i; if(dealias == NULL) return; if(dealias->probes != NULL) { for(i=0; iprobec; i++) { if(dealias->probes[i] != NULL) scamper_dealias_probe_free(dealias->probes[i]); } free(dealias->probes); } if(dealias->cycle != NULL) scamper_cycle_free(dealias->cycle); if(dealias->list != NULL) scamper_list_free(dealias->list); if(dealias->data != NULL) { assert(dealias->method != 0); assert(dealias->method <= 5); func[dealias->method-1](dealias->data); } free(dealias); return; } scamper_dealias_t *scamper_dealias_alloc(void) { return (scamper_dealias_t *)malloc_zero(sizeof(scamper_dealias_t)); } scamper-cvs-20171204/scamper/dealias/scamper_dealias.h000644 001751 000000 00000034173 12207304543 022444 0ustar00mjlwheel000000 000000 /* * scamper_dealias.h * * $Id: scamper_dealias.h,v 1.45 2013/08/28 05:23:47 mjl Exp $ * * Copyright (C) 2008-2011 The University of Waikato * Copyright (C) 2012-2013 The Regents of the University of California * Author: Matthew Luckie * * This code implements alias resolution techniques published by others * which require the network to be probed; the author of each technique * is detailed with its data structures. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the replye that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DEALIAS_H #define __SCAMPER_DEALIAS_H #define SCAMPER_DEALIAS_METHOD_MERCATOR 1 #define SCAMPER_DEALIAS_METHOD_ALLY 2 #define SCAMPER_DEALIAS_METHOD_RADARGUN 3 #define SCAMPER_DEALIAS_METHOD_PREFIXSCAN 4 #define SCAMPER_DEALIAS_METHOD_BUMP 5 #define SCAMPER_DEALIAS_PROBEDEF_METHOD_ICMP_ECHO 1 #define SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK 2 #define SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP 3 #define SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK_SPORT 4 #define SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP_DPORT 5 #define SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_SYN_SPORT 6 #define SCAMPER_DEALIAS_RESULT_NONE 0 #define SCAMPER_DEALIAS_RESULT_ALIASES 1 #define SCAMPER_DEALIAS_RESULT_NOTALIASES 2 #define SCAMPER_DEALIAS_RESULT_HALTED 3 #define SCAMPER_DEALIAS_RESULT_IPIDECHO 4 #define SCAMPER_DEALIAS_ALLY_FLAG_NOBS 1 #define SCAMPER_DEALIAS_RADARGUN_FLAG_SHUFFLE 1 #define SCAMPER_DEALIAS_PREFIXSCAN_FLAG_NOBS 1 #define SCAMPER_DEALIAS_PREFIXSCAN_FLAG_CSA 2 #define SCAMPER_DEALIAS_REPLY_FLAG_IPID32 1 #define SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_ICMP(def) ( \ (def)->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_ICMP_ECHO) #define SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP(def) ( \ (def)->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP || \ (def)->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP_DPORT) #define SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP(def) ( \ (def)->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK || \ (def)->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK_SPORT || \ (def)->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_SYN_SPORT) #define SCAMPER_DEALIAS_PROBEDEF_VARY_TCP_SPORT(def) ( \ (def)->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK_SPORT || \ (def)->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_SYN_SPORT) #define SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP_ACK(def) ( \ (def)->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK || \ (def)->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK_SPORT) #define SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP_SYN(def) ( \ (def)->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_SYN_SPORT) #define SCAMPER_DEALIAS_REPLY_IS_ICMP(reply) ( \ ((reply)->proto == 1 || (reply)->proto == 58)) #define SCAMPER_DEALIAS_REPLY_IS_TCP(reply) ( \ ((reply)->proto == 6)) #define SCAMPER_DEALIAS_REPLY_IS_ICMP_TTL_EXP(reply) ( \ ((reply)->proto == 1 && (reply)->icmp_type == 11) || \ ((reply)->proto == 58 && (reply)->icmp_type == 3)) #define SCAMPER_DEALIAS_REPLY_IS_ICMP_UNREACH(reply) ( \ ((reply)->proto == 1 && (reply)->icmp_type == 3) || \ ((reply)->proto == 58 && (reply)->icmp_type == 1)) #define SCAMPER_DEALIAS_REPLY_IS_ICMP_UNREACH_PORT(reply) ( \ ((reply)->proto == 1 && \ (reply)->icmp_type == 3 && (reply)->icmp_code == 3) || \ ((reply)->proto == 58 && \ (reply)->icmp_type == 1 && (reply)->icmp_code == 4)) #define SCAMPER_DEALIAS_REPLY_IS_ICMP_ECHO_REPLY(reply) ( \ ((reply)->proto == 1 && (reply)->icmp_type == 0) || \ ((reply)->proto == 58 && (reply)->icmp_type == 129)) #define SCAMPER_DEALIAS_METHOD_IS_MERCATOR(d) ( \ (d)->method == SCAMPER_DEALIAS_METHOD_MERCATOR) #define SCAMPER_DEALIAS_METHOD_IS_ALLY(d) ( \ (d)->method == SCAMPER_DEALIAS_METHOD_ALLY) #define SCAMPER_DEALIAS_METHOD_IS_RADARGUN(d) ( \ (d)->method == SCAMPER_DEALIAS_METHOD_RADARGUN) #define SCAMPER_DEALIAS_METHOD_IS_PREFIXSCAN(d) ( \ (d)->method == SCAMPER_DEALIAS_METHOD_PREFIXSCAN) #define SCAMPER_DEALIAS_METHOD_IS_BUMP(d) ( \ (d)->method == SCAMPER_DEALIAS_METHOD_BUMP) #define SCAMPER_DEALIAS_RESULT_IS_NONE(d) ( \ (d)->result == SCAMPER_DEALIAS_RESULT_NONE) #define SCAMPER_DEALIAS_RESULT_IS_ALIASES(d) ( \ (d)->result == SCAMPER_DEALIAS_RESULT_ALIASES) #define SCAMPER_DEALIAS_RESULT_IS_NOTALIASES(d) ( \ (d)->result == SCAMPER_DEALIAS_RESULT_NOTALIASES) #define SCAMPER_DEALIAS_ALLY_IS_NOBS(d) ( \ (((scamper_dealias_ally_t *)(d)->data)->flags) & \ SCAMPER_DEALIAS_ALLY_FLAG_NOBS) #define SCAMPER_DEALIAS_PREFIXSCAN_IS_NOBS(d) ( \ (((scamper_dealias_prefixscan_t *)(d)->data)->flags) & \ SCAMPER_DEALIAS_PREFIXSCAN_FLAG_NOBS) #define SCAMPER_DEALIAS_REPLY_FROM_TARGET(p, r) ( \ (SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP((p)->def) && \ SCAMPER_DEALIAS_REPLY_IS_ICMP_UNREACH_PORT((r))) || \ (SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_ICMP((p)->def) && \ SCAMPER_DEALIAS_REPLY_IS_ICMP_ECHO_REPLY((r))) || \ (SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP((p)->def) && \ SCAMPER_DEALIAS_REPLY_IS_TCP((r)))) typedef struct scamper_dealias_reply { scamper_addr_t *src; struct timeval rx; uint8_t flags; uint8_t proto; uint8_t ttl; uint8_t icmp_type; uint8_t icmp_code; uint8_t icmp_q_ip_ttl; uint8_t tcp_flags; uint16_t ipid; uint32_t ipid32; struct scamper_icmpext *icmp_ext; } scamper_dealias_reply_t; typedef struct scamper_dealias_probedef_udp { uint16_t sport; uint16_t dport; } scamper_dealias_probedef_udp_t; typedef struct scamper_dealias_probedef_icmp { uint16_t csum; uint16_t id; } scamper_dealias_probedef_icmp_t; typedef struct scamper_dealias_probedef_tcp { uint16_t sport; uint16_t dport; uint8_t flags; } scamper_dealias_probedef_tcp_t; typedef struct scamper_dealias_probedef { scamper_addr_t *src; scamper_addr_t *dst; uint32_t id; uint8_t method; uint8_t ttl; uint8_t tos; uint16_t size; uint16_t mtu; union { scamper_dealias_probedef_udp_t udp; scamper_dealias_probedef_tcp_t tcp; scamper_dealias_probedef_icmp_t icmp; } un; } scamper_dealias_probedef_t; typedef struct scamper_dealias_probe { scamper_dealias_probedef_t *def; uint32_t seq; struct timeval tx; scamper_dealias_reply_t **replies; uint16_t replyc; uint16_t ipid; } scamper_dealias_probe_t; typedef struct scamper_dealias_mercator { scamper_dealias_probedef_t probedef; uint8_t attempts; uint8_t wait_timeout; } scamper_dealias_mercator_t; typedef struct scamper_dealias_ally { scamper_dealias_probedef_t probedefs[2]; uint16_t wait_probe; uint8_t wait_timeout; uint8_t attempts; uint8_t flags; uint16_t fudge; } scamper_dealias_ally_t; /* * scamper_dealias_radargun * * the following variables define a radargun measurement. radargun was * first defined in the following paper: * * Fixing ally's growing pains with velocity modeling. Adam Bender, Rob * Sherwood, Neil Spring. Proc. IMC 2008, pages 337-342. * * probedefs : structures defining the form of a probe packet * attempts : number of times to send each probe packet * wait_probe : minimum length of time (ms) to wait between probes in a round * wait_round : minimum length of time (ms) to wait between attempts * wait_timeout : minimum length of time (sec) to wait for a response * flags : flags to adjust the behaviour of radargun */ typedef struct scamper_dealias_radargun { scamper_dealias_probedef_t *probedefs; uint32_t probedefc; uint16_t attempts; uint16_t wait_probe; uint32_t wait_round; uint8_t wait_timeout; uint8_t flags; } scamper_dealias_radargun_t; /* * scamper_dealias_prefixscan * * given an IP link defined by `a' and `b', try and find an alias for `a' * that would be found on the same subnet as `b'. if such an alias is * found, store it in `ab'. */ typedef struct scamper_dealias_prefixscan { scamper_addr_t *a; /* hop a */ scamper_addr_t *b; /* hop b */ scamper_addr_t *ab; /* alias found */ scamper_addr_t **xs; /* ifaces to exclude */ uint16_t xc; /* # ifaces to exclude */ uint8_t prefix; /* range of IPs to scan */ uint8_t attempts; /* how many attempts */ uint8_t replyc; /* replies required */ uint16_t fudge; /* ipid fudge */ uint16_t wait_probe; /* how long b/w probes */ uint8_t wait_timeout; /* when to declare lost */ uint8_t flags; /* flags */ scamper_dealias_probedef_t *probedefs; /* probedefs used */ uint16_t probedefc; /* how many were used */ } scamper_dealias_prefixscan_t; /* * scamper_dealias_bump * * given two IP addresses thought to be aliases, try and confirm this by * attempting to bump their IP-ID counters out of synchronisation. */ typedef struct scamper_dealias_bump { scamper_dealias_probedef_t probedefs[2]; uint16_t wait_probe; uint16_t bump_limit; uint8_t attempts; } scamper_dealias_bump_t; typedef struct scamper_dealias { scamper_list_t *list; scamper_cycle_t *cycle; uint32_t userid; struct timeval start; uint8_t method; uint8_t result; void *data; scamper_dealias_probe_t **probes; uint32_t probec; } scamper_dealias_t; scamper_dealias_t *scamper_dealias_alloc(void); void scamper_dealias_free(scamper_dealias_t *); scamper_dealias_probe_t *scamper_dealias_probe_alloc(void); void scamper_dealias_probe_free(scamper_dealias_probe_t *); scamper_dealias_probedef_t *scamper_dealias_probedef_alloc(void); void scamper_dealias_probedef_free(scamper_dealias_probedef_t *); scamper_dealias_reply_t *scamper_dealias_reply_alloc(void); void scamper_dealias_reply_free(scamper_dealias_reply_t *); uint32_t scamper_dealias_reply_count(const scamper_dealias_t *); const char *scamper_dealias_method_tostr(const scamper_dealias_t *, char *, size_t); const char *scamper_dealias_result_tostr(const scamper_dealias_t *, char *, size_t); const char *scamper_dealias_probedef_method_tostr(const scamper_dealias_probedef_t *, char *, size_t); int scamper_dealias_probes_alloc(scamper_dealias_t *, uint32_t); int scamper_dealias_replies_alloc(scamper_dealias_probe_t *, uint16_t); /* these functions allow the probes recorded to be ordered to suit */ void scamper_dealias_probes_sort_tx(scamper_dealias_t *); void scamper_dealias_probes_sort_seq(scamper_dealias_t *); void scamper_dealias_probes_sort_def(scamper_dealias_t *); int scamper_dealias_probe_add(scamper_dealias_t *, scamper_dealias_probe_t *); int scamper_dealias_reply_add(scamper_dealias_probe_t *, scamper_dealias_reply_t *); int scamper_dealias_ally_alloc(scamper_dealias_t *); int scamper_dealias_mercator_alloc(scamper_dealias_t *); int scamper_dealias_radargun_alloc(scamper_dealias_t *); int scamper_dealias_prefixscan_alloc(scamper_dealias_t *); int scamper_dealias_bump_alloc(scamper_dealias_t *); /* * scamper_dealias_ipid_inseq * * convenience function to consider if a sequence of IPIDs are in sequence * (given a fudge value). * * the first two parameters: array of probes and its length. * the third parameter: fudge factor * the fourth parameter: 0: no byteswap, 1: byteswap, 2: don't care * */ int scamper_dealias_ipid_inseq(scamper_dealias_probe_t **, int, uint16_t, int); int scamper_dealias_prefixscan_xs_add(scamper_dealias_t *, scamper_addr_t *); int scamper_dealias_prefixscan_xs_in(scamper_dealias_t *, scamper_addr_t *); int scamper_dealias_prefixscan_xs_alloc(scamper_dealias_prefixscan_t *, uint16_t); int scamper_dealias_prefixscan_probedef_add(scamper_dealias_t *, scamper_dealias_probedef_t *); int scamper_dealias_prefixscan_probedefs_alloc(scamper_dealias_prefixscan_t *, uint32_t); int scamper_dealias_radargun_fudge(scamper_dealias_t *, scamper_dealias_probedef_t *, scamper_dealias_probedef_t **, int *, int); int scamper_dealias_radargun_probedefs_alloc(scamper_dealias_radargun_t *, uint32_t); #define SCAMPER_DEALIAS_IPID_UNKNOWN 0 #define SCAMPER_DEALIAS_IPID_ZERO 1 #define SCAMPER_DEALIAS_IPID_CONST 2 #define SCAMPER_DEALIAS_IPID_ECHO 3 #define SCAMPER_DEALIAS_IPID_INCR 4 typedef struct scamper_dealias_ipid { uint8_t type; uint32_t mind; uint32_t maxd; } scamper_dealias_ipid_t; int scamper_dealias_ipid(const scamper_dealias_probe_t **probes, uint32_t probec, scamper_dealias_ipid_t *ipid); #endif /* __SCAMPER_DEALIAS_H */ scamper-cvs-20171204/scamper/dealias/scamper_dealias_do.c000644 001751 000000 00000270622 13210743023 023115 0ustar00mjlwheel000000 000000 /* * scamper_do_dealias.c * * $Id: scamper_dealias_do.c,v 1.161 2017/12/03 09:38:27 mjl Exp $ * * Copyright (C) 2008-2011 The University of Waikato * Copyright (C) 2012-2013 Matthew Luckie * Copyright (C) 2012-2014 The Regents of the University of California * Copyright (C) 2016 Matthew Luckie * Author: Matthew Luckie * * This code implements alias resolution techniques published by others * which require the network to be probed; the author of each technique * is detailed with its data structures. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_dealias_do.c,v 1.161 2017/12/03 09:38:27 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_dealias.h" #include "scamper_task.h" #include "scamper_icmp_resp.h" #include "scamper_fds.h" #include "scamper_dl.h" #include "scamper_dlhdr.h" #include "scamper_rtsock.h" #include "scamper_probe.h" #include "scamper_getsrc.h" #include "scamper_udp4.h" #include "scamper_udp6.h" #include "scamper_icmp4.h" #include "scamper_icmp6.h" #include "scamper_queue.h" #include "scamper_file.h" #include "scamper_options.h" #include "scamper_debug.h" #include "scamper_dealias_do.h" #include "mjl_splaytree.h" #include "mjl_list.h" #include "utils.h" static scamper_task_funcs_t funcs; /* packet buffer for generating the payload of each packet */ static uint8_t *pktbuf = NULL; static size_t pktbuf_len = 0; /* address cache used to avoid reallocating the same address multiple times */ extern scamper_addrcache_t *addrcache; #define DEALIAS_OPT_DPORT 1 #define DEALIAS_OPT_FUDGE 2 #define DEALIAS_OPT_METHOD 3 #define DEALIAS_OPT_REPLYC 4 #define DEALIAS_OPT_OPTION 5 #define DEALIAS_OPT_PROBEDEF 6 #define DEALIAS_OPT_ATTEMPTS 7 #define DEALIAS_OPT_WAIT_ROUND 8 #define DEALIAS_OPT_SPORT 9 #define DEALIAS_OPT_TTL 10 #define DEALIAS_OPT_USERID 11 #define DEALIAS_OPT_WAIT_TIMEOUT 12 #define DEALIAS_OPT_WAIT_PROBE 13 #define DEALIAS_OPT_EXCLUDE 14 static const scamper_option_in_t opts[] = { {'d', NULL, DEALIAS_OPT_DPORT, SCAMPER_OPTION_TYPE_NUM}, {'f', NULL, DEALIAS_OPT_FUDGE, SCAMPER_OPTION_TYPE_NUM}, {'m', NULL, DEALIAS_OPT_METHOD, SCAMPER_OPTION_TYPE_STR}, {'o', NULL, DEALIAS_OPT_REPLYC, SCAMPER_OPTION_TYPE_NUM}, {'O', NULL, DEALIAS_OPT_OPTION, SCAMPER_OPTION_TYPE_STR}, {'p', NULL, DEALIAS_OPT_PROBEDEF, SCAMPER_OPTION_TYPE_STR}, {'q', NULL, DEALIAS_OPT_ATTEMPTS, SCAMPER_OPTION_TYPE_NUM}, {'r', NULL, DEALIAS_OPT_WAIT_ROUND, SCAMPER_OPTION_TYPE_NUM}, {'s', NULL, DEALIAS_OPT_SPORT, SCAMPER_OPTION_TYPE_NUM}, {'t', NULL, DEALIAS_OPT_TTL, SCAMPER_OPTION_TYPE_NUM}, {'U', NULL, DEALIAS_OPT_USERID, SCAMPER_OPTION_TYPE_NUM}, {'w', NULL, DEALIAS_OPT_WAIT_TIMEOUT, SCAMPER_OPTION_TYPE_NUM}, {'W', NULL, DEALIAS_OPT_WAIT_PROBE, SCAMPER_OPTION_TYPE_NUM}, {'x', NULL, DEALIAS_OPT_EXCLUDE, SCAMPER_OPTION_TYPE_STR}, }; static const int opts_cnt = SCAMPER_OPTION_COUNT(opts); #define DEALIAS_PROBEDEF_OPT_CSUM 1 #define DEALIAS_PROBEDEF_OPT_DPORT 2 #define DEALIAS_PROBEDEF_OPT_IP 3 #define DEALIAS_PROBEDEF_OPT_PROTO 4 #define DEALIAS_PROBEDEF_OPT_SPORT 5 #define DEALIAS_PROBEDEF_OPT_TTL 6 #define DEALIAS_PROBEDEF_OPT_SIZE 7 #define DEALIAS_PROBEDEF_OPT_MTU 8 static const scamper_option_in_t probedef_opts[] = { {'c', NULL, DEALIAS_PROBEDEF_OPT_CSUM, SCAMPER_OPTION_TYPE_STR}, {'d', NULL, DEALIAS_PROBEDEF_OPT_DPORT, SCAMPER_OPTION_TYPE_NUM}, {'F', NULL, DEALIAS_PROBEDEF_OPT_SPORT, SCAMPER_OPTION_TYPE_NUM}, {'i', NULL, DEALIAS_PROBEDEF_OPT_IP, SCAMPER_OPTION_TYPE_STR}, {'P', NULL, DEALIAS_PROBEDEF_OPT_PROTO, SCAMPER_OPTION_TYPE_STR}, {'s', NULL, DEALIAS_PROBEDEF_OPT_SIZE, SCAMPER_OPTION_TYPE_NUM}, {'t', NULL, DEALIAS_PROBEDEF_OPT_TTL, SCAMPER_OPTION_TYPE_NUM}, {'M', NULL, DEALIAS_PROBEDEF_OPT_MTU, SCAMPER_OPTION_TYPE_NUM}, }; static const int probedef_opts_cnt = SCAMPER_OPTION_COUNT(probedef_opts); const char *scamper_do_dealias_usage(void) { return "dealias [-d dport] [-f fudge] [-m method] [-o replyc] [-O option]\n" " [-p '[-c sum] [-d dp] [-F sp] [-i ip] [-M mtu] [-P meth] [-s size] [-t ttl]']\n" " [-q attempts] [-r wait-round] [-s sport] [-t ttl]\n" " [-U userid] [-w wait-timeout] [-W wait-probe] [-x exclude]\n"; } typedef struct dealias_target { scamper_addr_t *addr; dlist_t *probes; uint16_t tcp_sport; uint16_t udp_dport; } dealias_target_t; typedef struct dealias_probe { dealias_target_t *target; scamper_dealias_probe_t *probe; uint16_t match_field; dlist_node_t *target_node; } dealias_probe_t; typedef struct dealias_prefixscan { scamper_dealias_probedef_t *probedefs; int probedefc; scamper_addr_t **aaliases; int aaliasc; int attempt; int seq; int round0; int round; int replyc; } dealias_prefixscan_t; typedef struct dealias_radargun { uint32_t *order; /* probedef order */ uint32_t i; /* index into order */ struct timeval next_round; } dealias_radargun_t; typedef struct dealias_bump { uint8_t step; uint8_t attempt; uint16_t bump; } dealias_bump_t; typedef struct dealias_options { char *addr; uint8_t attempts; uint8_t replyc; uint8_t wait_timeout; uint16_t wait_probe; uint32_t wait_round; uint16_t sport; uint16_t dport; uint8_t ttl; uint16_t fudge; slist_t *probedefs; slist_t *xs; int nobs; int shuffle; int inseq; } dealias_options_t; typedef struct dealias_probedef { scamper_dealias_probedef_t *def; dealias_target_t *target; uint32_t tcp_seq; uint32_t tcp_ack; uint16_t pktbuf_len; uint8_t flags; uint8_t echo; } dealias_probedef_t; typedef struct dealias_ptb { scamper_dealias_probedef_t *def; uint8_t *quote; uint16_t quote_len; } dealias_ptb_t; typedef struct dealias_state { uint8_t id; uint8_t flags; uint16_t icmpseq; scamper_dealias_probedef_t *probedefs; uint32_t probedefc; dealias_probedef_t **pds; int pdc; uint32_t probe; uint32_t round; struct timeval last_tx; struct timeval next_tx; struct timeval ptb_tx; splaytree_t *targets; dlist_t *recent_probes; void *methodstate; slist_t *ptbq; slist_t *discard; } dealias_state_t; #define DEALIAS_STATE_FLAG_DL 0x01 #define DEALIAS_PROBEDEF_FLAG_RX_IPID 0x01 #define DEALIAS_PROBEDEF_FLAG_TX_PTB 0x02 #ifdef NDEBUG #define dealias_state_assert(state) ((void)0) #endif #ifndef NDEBUG static void dealias_state_assert(const dealias_state_t *state) { int i; for(i=0; ipdc; i++) { assert(state->pds[i] != NULL); assert(state->pds[i]->def->id == i); } return; } #endif static scamper_dealias_t *dealias_getdata(const scamper_task_t *task) { return scamper_task_getdata(task); } static dealias_state_t *dealias_getstate(const scamper_task_t *task) { dealias_state_t *state = scamper_task_getstate(task); dealias_state_assert(state); return state; } static int dealias_ally_queue(const scamper_dealias_t *dealias, dealias_state_t *state, const struct timeval *now, struct timeval *tv) { if(state->ptb_tx.tv_sec == 0) return 0; timeval_add_s(tv, &state->ptb_tx, 1); if(timeval_cmp(tv, now) > 0) return 1; memset(&state->ptb_tx, 0, sizeof(struct timeval)); return 0; } static void dealias_queue(scamper_task_t *task) { static int (*const func[])(const scamper_dealias_t *, dealias_state_t *, const struct timeval *, struct timeval *) = { NULL, dealias_ally_queue, NULL, NULL, NULL, }; scamper_dealias_t *dealias = dealias_getdata(task); dealias_state_t *state = dealias_getstate(task); struct timeval tv, now; dealias_probe_t *p; if(scamper_task_queue_isdone(task)) return; gettimeofday_wrap(&now); for(;;) { if((p = dlist_head_item(state->recent_probes)) == NULL) break; timeval_add_s(&tv, &p->probe->tx, 10); if(timeval_cmp(&now, &tv) < 0) break; dlist_node_pop(p->target->probes, p->target_node); dlist_head_pop(state->recent_probes); free(p); } if(slist_count(state->ptbq) > 0) { scamper_task_queue_probe(task); return; } if(func[dealias->method-1] != NULL && func[dealias->method-1](dealias, state, &now, &tv) != 0) { scamper_task_queue_wait_tv(task, &tv); return; } if(timeval_cmp(&state->next_tx, &now) <= 0) { scamper_task_queue_probe(task); return; } scamper_task_queue_wait_tv(task, &state->next_tx); return; } static void dealias_handleerror(scamper_task_t *task, int error) { scamper_task_queue_done(task, 0); return; } static void dealias_result(scamper_task_t *task, uint8_t result) { scamper_dealias_t *dealias = dealias_getdata(task); #ifdef HAVE_SCAMPER_DEBUG char buf[16]; #endif dealias->result = result; #ifdef HAVE_SCAMPER_DEBUG scamper_debug(__func__, "%s", scamper_dealias_result_tostr(dealias, buf, sizeof(buf))); #endif scamper_task_queue_done(task, 0); return; } static void dealias_ptb_free(dealias_ptb_t *ptb) { if(ptb == NULL) return; if(ptb->quote != NULL) free(ptb->quote); free(ptb); return; } static int dealias_ptb_add(dealias_state_t *state, scamper_dl_rec_t *dl, scamper_dealias_probedef_t *def) { dealias_ptb_t *ptb; if((ptb = malloc_zero(sizeof(dealias_ptb_t))) == NULL) { printerror(__func__, "could not malloc ptb"); goto err; } ptb->def = def; if(dl->dl_ip_size > 1280-40-8) ptb->quote_len = 1280-40-8; else ptb->quote_len = dl->dl_ip_size; if((ptb->quote = memdup(dl->dl_net_raw, ptb->quote_len)) == NULL) { printerror(__func__, "could not dup ptb quote"); goto err; } if(slist_tail_push(state->ptbq, ptb) == NULL) { printerror(__func__, "could not queue ptb"); goto err; } return 0; err: if(ptb != NULL) dealias_ptb_free(ptb); return -1; } static int dealias_target_cmp(const dealias_target_t *a, const dealias_target_t *b) { return scamper_addr_cmp(a->addr, b->addr); } static void dealias_target_free(dealias_target_t *tgt) { if(tgt == NULL) return; if(tgt->probes != NULL) dlist_free_cb(tgt->probes, free); if(tgt->addr != NULL) scamper_addr_free(tgt->addr); free(tgt); return; } static dealias_target_t *dealias_target_find(dealias_state_t *s, scamper_addr_t *addr) { dealias_target_t fm; fm.addr = addr; return splaytree_find(s->targets, &fm); } static dealias_target_t *dealias_target_get(dealias_state_t *state, scamper_addr_t *addr) { dealias_target_t *tgt; if((tgt = dealias_target_find(state, addr)) != NULL) return tgt; if((tgt = malloc_zero(sizeof(dealias_target_t))) == NULL || (tgt->probes = dlist_alloc()) == NULL) { printerror(__func__, "could not malloc tgt"); goto err; } tgt->addr = scamper_addr_use(addr); if(splaytree_insert(state->targets, tgt) == NULL) { printerror(__func__, "could not add tgt to tree"); goto err; } return tgt; err: dealias_target_free(tgt); return NULL; } static int dealias_probedef_add(dealias_state_t *state, scamper_dealias_probedef_t *def) { dealias_probedef_t *pd = NULL; if((pd = malloc_zero(sizeof(dealias_probedef_t))) == NULL) { printerror(__func__, "could not malloc pd"); goto err; } pd->def = def; if((pd->target = dealias_target_get(state, def->dst)) == NULL) goto err; if(def->size == 0) pd->pktbuf_len = 2; else if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_ICMP_ECHO) if(SCAMPER_ADDR_TYPE_IS_IPV4(def->dst)) pd->pktbuf_len = def->size - 28; else pd->pktbuf_len = def->size - 48; else goto err; if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK && (random_u32(&pd->tcp_seq) != 0 || random_u32(&pd->tcp_ack) != 0)) goto err; if(array_insert((void ***)&state->pds, &state->pdc, pd, NULL) != 0) { printerror(__func__, "could not add pd"); goto err; } return 0; err: if(pd != NULL) free(pd); return -1; } static void dealias_prefixscan_array_free(scamper_addr_t **addrs, int addrc) { int i; if(addrs == NULL) return; for(i=0; idata; scamper_addr_t **array = *out; scamper_addr_t *sa; /* convert the in_addr into something that scamper deals with */ sa = scamper_addrcache_get(addrcache, SCAMPER_ADDR_TYPE_IPV4, addr); if(sa == NULL) { printerror(__func__, "could not get addr"); return -1; } /* * don't consider this address if it is the same as the address * we are trying to find an alias for, or it is in the exclude list. */ if(scamper_addr_cmp(prefixscan->a, sa) == 0 || scamper_dealias_prefixscan_xs_in(dealias, sa) != 0) { scamper_addr_free(sa); return 0; } /* add the scamper address to the array */ if(array_insert((void ***)&array, outc, sa, NULL) != 0) { printerror(__func__, "could not add addr"); scamper_addr_free(sa); return -1; } *out = array; return 0; } /* * dealias_prefixscan_array: * * figure out what the next address to scan will be, based on what the * previously probed address was. below are examples of the order in which * addresses should be probed given a starting address. addresses in * prefixes less than /30 could be probed in random order. * * 00100111 39 00100010 34 00101001 41 00100000 32 * 00100110 38 /31 00100001 33 00101010 42 00100001 33 /31 * 00100101 37 00100000 32 00101000 40 00100010 34 * 00100100 36 /30 00100011 35 /30 00101011 43 /30 00100011 35 /30 * 00100011 35 00100100 36 00101100 44 * 00100010 34 00100101 37 00101101 45 * 00100001 33 00100110 38 00101110 46 * 00100000 32 /29 00100111 39 /29 00101111 47 /29 * 00101000 40 00101000 40 00100000 32 * 00101001 41 00101001 41 00100001 33 * 00101010 42 00101010 42 * 00101011 43 * 00101100 44 * 00101101 45 * 00101110 46 * 00101111 47 /28 * */ static int dealias_prefixscan_array(scamper_dealias_t *dealias, scamper_addr_t ***out, int *outc) { scamper_dealias_prefixscan_t *prefixscan = dealias->data; scamper_addr_t **array = NULL; uint32_t hostid, netid, mask; uint32_t slash30[4][3] = {{1, 2, 3}, {2, 0, 3}, {1, 0, 3}, {2, 1, 0}}; uint32_t cnt[] = {4, 8, 16, 32, 64, 128}; uint32_t bit; struct in_addr a; int pre, i; memcpy(&a, prefixscan->b->addr, sizeof(a)); *outc = 0; /* if we've been instructed only to try /31 pair */ if(prefixscan->prefix == 31) { netid = ntohl(a.s_addr) & ~0x1; hostid = ntohl(a.s_addr) & 0x1; if(hostid == 1) a.s_addr = htonl(netid | 0); else a.s_addr = htonl(netid | 1); if(dealias_prefixscan_array_add(dealias, &array, outc, &a) != 0) goto err; *out = array; return 0; } /* when probing a /30 the first three probes have a particular order */ mask = 0x3; netid = ntohl(a.s_addr) & ~mask; hostid = ntohl(a.s_addr) & mask; for(i=0; i<3; i++) { a.s_addr = htonl(netid | slash30[hostid][i]); if(dealias_prefixscan_array_add(dealias, &array, outc, &a) != 0) goto err; } for(pre = 29; pre >= prefixscan->prefix; pre--) { bit = (0x1 << (31-pre)); mask |= bit; memcpy(&a, prefixscan->b->addr, sizeof(a)); netid = ntohl(a.s_addr) & ~mask; if((ntohl(a.s_addr) & bit) != 0) bit = 0; for(hostid=0; hostidprobes); n != NULL; n = dlist_node_next(n)) { dp = dlist_node_item(n); def = dp->probe->def; if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP(def) == 0 || def->un.udp.sport != sport) continue; if(SCAMPER_ADDR_TYPE_IS_IPV4(tgt->addr) && dp->probe->ipid != ipid) continue; if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP) { if(def->un.udp.dport == dport) return dp->probe; } else if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP_DPORT) { if(dp->match_field == dport) return dp->probe; } } return NULL; } static scamper_dealias_probe_t * dealias_probe_tcp_find2(dealias_state_t *state, dealias_target_t *tgt, uint16_t sport, uint16_t dport) { scamper_dealias_probedef_t *def; dealias_probe_t *dp; dlist_node_t *n; for(n=dlist_head_node(tgt->probes); n != NULL; n = dlist_node_next(n)) { dp = dlist_node_item(n); def = dp->probe->def; if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP(def) == 0 || def->un.tcp.dport != dport) continue; if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK) { if(def->un.tcp.sport == sport) return dp->probe; } else if(SCAMPER_DEALIAS_PROBEDEF_VARY_TCP_SPORT(def)) { if(dp->match_field == sport) return dp->probe; } } return NULL; } static scamper_dealias_probe_t * dealias_probe_tcp_find(dealias_state_t *state, dealias_target_t *tgt, uint16_t ipid, uint16_t sport, uint16_t dport) { scamper_dealias_probedef_t *def; dealias_probe_t *dp; dlist_node_t *n; for(n=dlist_head_node(tgt->probes); n != NULL; n = dlist_node_next(n)) { dp = dlist_node_item(n); def = dp->probe->def; if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP(def) == 0 || def->un.tcp.dport != dport) continue; if(SCAMPER_ADDR_TYPE_IS_IPV4(tgt->addr) && dp->probe->ipid != ipid) continue; if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK) { if(def->un.tcp.sport == sport) return dp->probe; } else if(SCAMPER_DEALIAS_PROBEDEF_VARY_TCP_SPORT(def)) { if(dp->match_field == sport) return dp->probe; } } return NULL; } static scamper_dealias_probe_t * dealias_probe_icmp_find(dealias_state_t *state, dealias_target_t *tgt, uint16_t ipid, uint8_t type, uint8_t code, uint16_t id, uint16_t seq) { scamper_dealias_probedef_t *def; dealias_probe_t *dp; dlist_node_t *n; uint8_t method; if((SCAMPER_ADDR_TYPE_IS_IPV4(tgt->addr) && type == ICMP_ECHO && code == 0) || (SCAMPER_ADDR_TYPE_IS_IPV6(tgt->addr) && type == ICMP6_ECHO_REQUEST && code == 0)) method = SCAMPER_DEALIAS_PROBEDEF_METHOD_ICMP_ECHO; else return NULL; for(n=dlist_head_node(tgt->probes); n != NULL; n = dlist_node_next(n)) { dp = dlist_node_item(n); def = dp->probe->def; if(SCAMPER_ADDR_TYPE_IS_IPV4(tgt->addr) && dp->probe->ipid != ipid) continue; if(def->method == method && def->un.icmp.id == id && dp->match_field == seq) return dp->probe; } return NULL; } static scamper_dealias_probe_t * dealias_probe_echoreq_find(dealias_state_t *state, dealias_target_t *tgt, uint16_t id, uint16_t seq) { scamper_dealias_probedef_t *def; dealias_probe_t *dp; dlist_node_t *n; for(n=dlist_head_node(tgt->probes); n != NULL; n = dlist_node_next(n)) { dp = dlist_node_item(n); def = dp->probe->def; if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_ICMP_ECHO && def->un.icmp.id == id && dp->match_field == seq) return dp->probe; } return NULL; } static dealias_probedef_t * dealias_mercator_def(scamper_dealias_t *dealias, dealias_state_t *state) { return state->pds[state->probe]; } static int dealias_mercator_postprobe(scamper_dealias_t *dealias, dealias_state_t *state) { /* we just wait the specified number of seconds with mercator probes */ scamper_dealias_mercator_t *mercator = dealias->data; timeval_add_s(&state->next_tx, &state->last_tx, mercator->wait_timeout); state->round++; return 0; } static void dealias_mercator_handlereply(scamper_task_t *task, scamper_dealias_probe_t *probe, scamper_dealias_reply_t *reply, scamper_dl_rec_t *dl) { if(SCAMPER_DEALIAS_REPLY_IS_ICMP_UNREACH_PORT(reply) && scamper_addr_cmp(probe->def->dst, reply->src) != 0) { dealias_result(task, SCAMPER_DEALIAS_RESULT_ALIASES); } else { dealias_result(task, SCAMPER_DEALIAS_RESULT_NONE); } return; } static void dealias_mercator_handletimeout(scamper_task_t *task) { scamper_dealias_t *dealias = dealias_getdata(task); scamper_dealias_mercator_t *mercator = dealias->data; if(dealias->probec < mercator->attempts) dealias_queue(task); else dealias_result(task, SCAMPER_DEALIAS_RESULT_NONE); return; } static dealias_probedef_t * dealias_ally_def(scamper_dealias_t *dealias, dealias_state_t *state) { return state->pds[state->probe]; } static int dealias_ally_postprobe(scamper_dealias_t *dealias, dealias_state_t *state) { /* * we wait a fixed amount of time before we send the next probe with * ally. except when the last probe has been sent, where we wait for * some other length of time for any final replies to come in */ scamper_dealias_ally_t *ally = dealias->data; if(dealias->probec != ally->attempts) timeval_add_ms(&state->next_tx, &state->last_tx, ally->wait_probe); else timeval_add_s(&state->next_tx, &state->last_tx, ally->wait_timeout); if(++state->probe == 2) { state->probe = 0; state->round++; } return 0; } static int dealias_ally_allzero(scamper_dealias_t *dealias) { uint32_t i; uint16_t j; if(dealias->probec == 0) return 0; if(SCAMPER_ADDR_TYPE_IS_IPV4(dealias->probes[0]->def->dst) == 0) return 0; for(i=0; iprobec; i++) { assert(dealias->probes[i] != NULL); for(j=0; jprobes[i]->replyc; j++) { assert(dealias->probes[i]->replies[j] != NULL); if(dealias->probes[i]->replies[j]->ipid != 0) return 0; } } return 1; } /* * dealias_ally_handlereply_v6 * * process the IPv6 response and signal to the caller what to do next. * * -1: error, stop probing now. * 0: response is not useful, don't process the packet. * 1: useful response, continue processing. */ static int dealias_ally_handlereply_v6(scamper_task_t *task, scamper_dealias_probe_t *probe, scamper_dealias_reply_t *reply, scamper_dl_rec_t *dl) { scamper_dealias_t *dealias = dealias_getdata(task); dealias_state_t *state = dealias_getstate(task); dealias_probedef_t *pd = state->pds[probe->def->id]; slist_node_t *sn; int ptb = 0, discard = 0; uint32_t i; /* are we in a period where we're waiting for the receiver to get the PTB? */ if(state->ptb_tx.tv_sec != 0 || slist_count(state->ptbq) > 0) ptb = 1; /* is the probe going to be discarded? */ for(sn=slist_head_node(state->discard); sn != NULL; sn=slist_node_next(sn)) { if(slist_node_item(sn) == probe) { discard = 1; break; } } /* if the response contains an IP-ID, then we're good for this def */ if((reply->flags & SCAMPER_DEALIAS_REPLY_FLAG_IPID32) != 0) { pd->flags |= DEALIAS_PROBEDEF_FLAG_RX_IPID; return (discard == 0 && ptb == 0) ? 1 : 0; } /* should we send a packet too big for this packet? */ if(probe->def->mtu != 0 && probe->def->mtu < dl->dl_ip_size && (pd->flags & DEALIAS_PROBEDEF_FLAG_TX_PTB) == 0 && (pd->flags & DEALIAS_PROBEDEF_FLAG_RX_IPID) == 0) { /* all prior probes are going to be discarded, so put them in the list */ for(i=0; iprobec; i++) { if(slist_head_push(state->discard, dealias->probes[i]) == NULL) return -1; dealias->probes[i] = NULL; } dealias->probec = 0; state->round = 0; /* send a PTB */ pd->flags |= DEALIAS_PROBEDEF_FLAG_TX_PTB; if(dealias_ptb_add(state, dl, probe->def) != 0) return -1; dealias_queue(task); return 0; } /* if we're probing for real and the response is not useful, halt */ if(ptb == 0 && discard == 0) dealias_result(task, SCAMPER_DEALIAS_RESULT_NONE); return 0; } static void dealias_ally_handlereply(scamper_task_t *task, scamper_dealias_probe_t *probe, scamper_dealias_reply_t *reply, scamper_dl_rec_t *dl) { scamper_dealias_t *dealias = dealias_getdata(task); scamper_dealias_ally_t *ally = dealias->data; scamper_dealias_probe_t *probes[5]; uint32_t k; int rc, probec = 0; /* check to see if the response could be useful for alias resolution */ if(probe->replyc != 1 || !(SCAMPER_DEALIAS_REPLY_FROM_TARGET(probe, reply) || (SCAMPER_DEALIAS_REPLY_IS_ICMP_TTL_EXP(reply) && probe->def->ttl != 255))) { dealias_result(task, SCAMPER_DEALIAS_RESULT_NONE); return; } if(SCAMPER_ADDR_TYPE_IS_IPV6(reply->src)) { rc = dealias_ally_handlereply_v6(task, probe, reply, dl); if(rc == -1) goto err; if(rc == 0) return; } /* can't make any decision unless at least two probes have been sent */ if(dealias->probec < 2) return; /* find the probe in its place */ for(k=0; kprobec; k++) if(probe == dealias->probes[k]) break; if(k == dealias->probec) return; if(k >= 1 && dealias->probes[k-1]->replyc == 1) { if(k >= 2 && dealias->probes[k-2]->replyc == 1) probes[probec++] = dealias->probes[k-2]; probes[probec++] = dealias->probes[k-1]; } probes[probec++] = dealias->probes[k]; if(k+1 < dealias->probec && dealias->probes[k+1]->replyc == 1) { probes[probec++] = dealias->probes[k+1]; if(k+2 < dealias->probec && dealias->probes[k+2]->replyc == 1) probes[probec++] = dealias->probes[k+2]; } /* not enough adjacent responses to make a classification */ if(probec < 2) return; /* check if the replies are in sequence */ if(SCAMPER_DEALIAS_ALLY_IS_NOBS(dealias)) rc = scamper_dealias_ipid_inseq(probes, probec, ally->fudge, 0); else rc = scamper_dealias_ipid_inseq(probes, probec, ally->fudge, 2); if(rc == 0) dealias_result(task, SCAMPER_DEALIAS_RESULT_NOTALIASES); return; err: dealias_handleerror(task, errno); return; } static void dealias_ally_handletimeout(scamper_task_t *task) { scamper_dealias_t *dealias = dealias_getdata(task); scamper_dealias_ally_t *ally = dealias->data; uint32_t k; int rc; /* do a final classification */ if(dealias->probec == ally->attempts) { for(k=0; kprobec; k++) if(dealias->probes[k]->replyc != 1) break; if(k != dealias->probec) { dealias_result(task, SCAMPER_DEALIAS_RESULT_NONE); return; } if(SCAMPER_DEALIAS_ALLY_IS_NOBS(dealias)) rc = scamper_dealias_ipid_inseq(dealias->probes, k, ally->fudge, 0); else rc = scamper_dealias_ipid_inseq(dealias->probes, k, ally->fudge, 3); /* check if the replies are in sequence */ if(rc == 1) dealias_result(task, SCAMPER_DEALIAS_RESULT_ALIASES); else if(dealias_ally_allzero(dealias) != 0) dealias_result(task, SCAMPER_DEALIAS_RESULT_NONE); else dealias_result(task, SCAMPER_DEALIAS_RESULT_NOTALIASES); } return; } static dealias_probedef_t * dealias_radargun_def(scamper_dealias_t *dealias, dealias_state_t *state) { scamper_dealias_radargun_t *rg = dealias->data; dealias_radargun_t *rgstate = state->methodstate; if((rg->flags & SCAMPER_DEALIAS_RADARGUN_FLAG_SHUFFLE) == 0) return state->pds[state->probe]; return state->pds[rgstate->order[rgstate->i++]]; } static int dealias_radargun_postprobe(scamper_dealias_t *dealias, dealias_state_t *state) { scamper_dealias_radargun_t *rg = dealias->data; dealias_radargun_t *rgstate = state->methodstate; struct timeval *tv = &state->last_tx; if(state->probe == 0) timeval_add_ms(&rgstate->next_round, tv, rg->wait_round); state->probe++; if(state->probe < rg->probedefc) { timeval_add_ms(&state->next_tx, tv, rg->wait_probe); } else { state->probe = 0; state->round++; if(state->round < rg->attempts) { if(timeval_cmp(tv, &rgstate->next_round) >= 0 || timeval_diff_ms(&rgstate->next_round, tv) < rg->wait_probe) { timeval_add_ms(&state->next_tx, tv, rg->wait_probe); } else { timeval_cpy(&state->next_tx, &rgstate->next_round); } if((rg->flags & SCAMPER_DEALIAS_RADARGUN_FLAG_SHUFFLE) != 0) { if(shuffle32(rgstate->order, rg->probedefc) != 0) return -1; rgstate->i = 0; } } else { /* we're all finished */ timeval_add_s(&state->next_tx, tv, rg->wait_timeout); } } return 0; } static void dealias_radargun_handletimeout(scamper_task_t *task) { scamper_dealias_t *dealias = dealias_getdata(task); dealias_state_t *state = dealias_getstate(task); scamper_dealias_radargun_t *radargun = dealias->data; /* check to see if we are now finished */ if(state->round != radargun->attempts) dealias_queue(task); else dealias_result(task, SCAMPER_DEALIAS_RESULT_NONE); return; } static void dealias_radargun_handlereply(scamper_task_t *task, scamper_dealias_probe_t *probe, scamper_dealias_reply_t *reply, scamper_dl_rec_t *dl) { dealias_state_t *state = dealias_getstate(task); if(SCAMPER_ADDR_TYPE_IS_IPV6(probe->def->dst) && (reply->flags & SCAMPER_DEALIAS_REPLY_FLAG_IPID32) == 0 && probe->def->mtu != 0 && probe->def->mtu < dl->dl_ip_size) { if(dealias_ptb_add(state, dl, probe->def) != 0) dealias_handleerror(task, errno); else dealias_queue(task); } return; } static dealias_probedef_t * dealias_prefixscan_def(scamper_dealias_t *dealias, dealias_state_t *state) { return state->pds[state->probe]; } static int dealias_prefixscan_postprobe(scamper_dealias_t *dealias, dealias_state_t *state) { scamper_dealias_prefixscan_t *prefixscan = dealias->data; dealias_prefixscan_t *pfstate = state->methodstate; scamper_dealias_probedef_t *def = &state->probedefs[state->probe]; if(def->id == 0) pfstate->round0++; else pfstate->round++; pfstate->attempt++; pfstate->replyc = 0; timeval_add_ms(&state->next_tx, &state->last_tx, prefixscan->wait_probe); return 0; } static int dealias_prefixscan_next(scamper_task_t *task) { scamper_dealias_t *dealias = dealias_getdata(task); dealias_state_t *state = dealias_getstate(task); dealias_prefixscan_t *pfstate = state->methodstate; scamper_dealias_prefixscan_t *prefixscan = dealias->data; scamper_dealias_probedef_t *def = &pfstate->probedefs[state->probedefc-1]; uint32_t *defids = NULL, p; int q; /* * if the address we'd otherwise probe has been observed as an alias of * prefixscan->a, then we don't need to bother probing it. */ if(array_find((void **)pfstate->aaliases, pfstate->aaliasc, def->dst, (array_cmp_t)scamper_addr_cmp) != NULL) { prefixscan->ab = scamper_addr_use(def->dst); prefixscan->flags |= SCAMPER_DEALIAS_PREFIXSCAN_FLAG_CSA; dealias_result(task, SCAMPER_DEALIAS_RESULT_ALIASES); return 0; } /* remember the probedef used with each probe */ if((defids = malloc_zero(sizeof(uint32_t) * dealias->probec)) == NULL) { printerror(__func__, "could not malloc defids"); goto err; } for(p=0; pprobec; p++) defids[p] = dealias->probes[p]->def->id; /* add the probedef */ if(scamper_dealias_prefixscan_probedef_add(dealias, def) != 0) { printerror(__func__, "could not add probedef"); goto err; } /* re-set the pointers to the probedefs */ for(q=0; qpdc; q++) state->pds[q]->def = &prefixscan->probedefs[q]; for(p=0; pprobec; p++) dealias->probes[p]->def = &prefixscan->probedefs[defids[p]]; free(defids); defids = NULL; def = &prefixscan->probedefs[prefixscan->probedefc-1]; if(dealias_probedef_add(state, def) != 0) goto err; state->probedefs = prefixscan->probedefs; state->probedefc = prefixscan->probedefc; return 0; err: if(defids != NULL) free(defids); return -1; } static void dealias_prefixscan_handlereply(scamper_task_t *task, scamper_dealias_probe_t *probe, scamper_dealias_reply_t *reply, scamper_dl_rec_t *dl) { scamper_dealias_t *dealias = dealias_getdata(task); dealias_state_t *state = dealias_getstate(task); scamper_dealias_prefixscan_t *prefixscan = dealias->data; dealias_prefixscan_t *pfstate = state->methodstate; scamper_dealias_probe_t **probes = NULL; dealias_probedef_t *pd = state->pds[probe->def->id]; uint32_t defid; int p, s, seq; /* if the reply is not for the most recently sent probe */ if(probe != dealias->probes[dealias->probec-1]) return; /* if the reply is not the first reply for this probe */ if(probe->replyc != 1) return; if(probe->ipid == reply->ipid && ++pd->echo >= 2) { if(probe->def->id != 0) goto prefixscan_next; dealias_result(task, SCAMPER_DEALIAS_RESULT_IPIDECHO); return; } /* * if we are currently waiting for our turn to probe, then for now * ignore the late response. */ if(scamper_task_queue_isprobe(task)) return; /* check if we should count this reply as a valid response */ if(SCAMPER_DEALIAS_REPLY_FROM_TARGET(probe, reply)) pfstate->replyc++; else return; /* * if we sent a UDP probe, and got a port unreachable message back from a * different interface, then we might be able to use that for alias * resolution. */ if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP(probe->def) && SCAMPER_DEALIAS_REPLY_IS_ICMP_UNREACH_PORT(reply) && scamper_addr_cmp(probe->def->dst, reply->src) != 0) { if(probe->def->id == 0) { /* * if the reply is for prefixscan->a, then keep a record of the * address of the interface used in the response. */ if(array_find((void **)pfstate->aaliases, pfstate->aaliasc, reply->src, (array_cmp_t)scamper_addr_cmp) == NULL) { if(array_insert((void ***)&pfstate->aaliases, &pfstate->aaliasc, reply->src, (array_cmp_t)scamper_addr_cmp) != 0) { printerror(__func__, "could not add to aaliases"); goto err; } scamper_addr_use(reply->src); } } else { /* * if the address used to reply is probedef->a, or is one of the * aliases previously observed for a, then we infer aliases. */ if(scamper_addr_cmp(reply->src, prefixscan->a) == 0 || array_find((void **)pfstate->aaliases, pfstate->aaliasc, reply->src, (array_cmp_t)scamper_addr_cmp) != NULL) { prefixscan->ab = scamper_addr_use(probe->def->dst); prefixscan->flags |= SCAMPER_DEALIAS_PREFIXSCAN_FLAG_CSA; dealias_result(task, SCAMPER_DEALIAS_RESULT_ALIASES); return; } } } /* * another probe received in sequence. * we will probably send another probe, so reset attempts */ seq = ++pfstate->seq; pfstate->attempt = 0; assert(seq >= 1 && seq <= prefixscan->replyc); /* * if we don't have a reply from each IP address yet, then keep probing. * ideally, this could be optimised to use the previous observed IP-ID * for probedef zero if we have probed other probedefs in the interim and * have just obtained a reply. */ if(seq < 2) { if(state->probe != 0) { state->probe = 0; return; } if(state->probedefc == 1) { /* figure out what we're going to probe next */ if(dealias_prefixscan_next(task) != 0) goto err; /* if it turns out we don't need to probe, handle that */ if(dealias->result == SCAMPER_DEALIAS_RESULT_ALIASES) return; } state->probe = state->probedefc-1; dealias_queue(task); return; } if((probes = malloc_zero(sizeof(scamper_dealias_probe_t *) * seq)) == NULL) { printerror(__func__, "could not malloc probes"); goto err; } probes[seq-1] = probe; /* if the reply was not for the first probe, then skip over earlier probes */ p = dealias->probec-2; defid = probe->def->id; while(p >= 0 && dealias->probes[p]->def->id == defid) p--; for(s=seq-1; s>0; s--) { if(p < 0) goto err; if(probes[s]->def->id == 0) defid = state->probedefc - 1; else defid = 0; while(p >= 0) { assert(defid == dealias->probes[p]->def->id); /* skip over any unresponded to probes */ if(dealias->probes[p]->replyc == 0) { p--; continue; } /* record the probe for this defid */ probes[s-1] = dealias->probes[p]; /* skip over any probes that proceeded this one with same defid */ while(p >= 0 && dealias->probes[p]->def->id == defid) p--; break; } } /* * check to see if the sequence of replies indicates an alias. free * the probes array before we check the result, as it is easiest here. */ if(SCAMPER_DEALIAS_PREFIXSCAN_IS_NOBS(dealias)) p = scamper_dealias_ipid_inseq(probes, seq, prefixscan->fudge, 0); else p = scamper_dealias_ipid_inseq(probes, seq, prefixscan->fudge, seq < prefixscan->replyc ? 2 : 3); free(probes); probes = NULL; if(p == -1) goto err; if(p == 1) { if(seq == prefixscan->replyc) { p = state->probedefc-1; prefixscan->ab = scamper_addr_use(prefixscan->probedefs[p].dst); dealias_result(task, SCAMPER_DEALIAS_RESULT_ALIASES); return; } if(state->probe == 0) state->probe = state->probedefc - 1; else state->probe = 0; return; } prefixscan_next: /* if there are no other addresses to try, then finish */ if(state->probedefc-1 == pfstate->probedefc) { dealias_result(task, SCAMPER_DEALIAS_RESULT_NONE); return; } if(dealias_prefixscan_next(task) != 0) goto err; if(dealias->result == SCAMPER_DEALIAS_RESULT_ALIASES) return; pfstate->round = 0; pfstate->attempt = 0; state->probe = state->probedefc-1; if(dealias->probes[dealias->probec-1]->def->id == 0) pfstate->seq = 1; else pfstate->seq = 0; dealias_queue(task); return; err: if(probes != NULL) free(probes); dealias_handleerror(task, errno); return; } static void dealias_prefixscan_handletimeout(scamper_task_t *task) { scamper_dealias_t *dealias = dealias_getdata(task); dealias_state_t *state = dealias_getstate(task); dealias_prefixscan_t *pfstate = state->methodstate; scamper_dealias_prefixscan_t *prefixscan; scamper_dealias_probedef_t *def; scamper_dealias_probe_t *probe; prefixscan = dealias->data; probe = dealias->probes[dealias->probec-1]; def = probe->def; if(pfstate->replyc == 0) { /* if we're allowed to send another attempt, then do so */ if(pfstate->attempt < prefixscan->attempts) { goto done; } /* * if the probed address is unresponsive, and it is not prefixscan->a, * and there are other addresses to try, then probe one now */ if(def->id != 0 && state->probedefc-1 < (uint32_t)pfstate->probedefc) { if(dealias_prefixscan_next(task) != 0) goto err; /* if it turns out we don't need to probe, handle that */ if(dealias->result == SCAMPER_DEALIAS_RESULT_ALIASES) return; pfstate->round = 0; pfstate->seq = 0; pfstate->attempt = 0; state->probe = state->probedefc-1; goto done; } dealias_result(task, SCAMPER_DEALIAS_RESULT_NONE); return; } /* keep going! */ done: if(state->probe == 0) state->round = pfstate->round0; else state->round = pfstate->round; return; err: dealias_handleerror(task, errno); return; } static dealias_probedef_t * dealias_bump_def(scamper_dealias_t *dealias, dealias_state_t *state) { return state->pds[state->probe]; } static int dealias_bump_postprobe(scamper_dealias_t *dealias, dealias_state_t *state) { scamper_dealias_bump_t *bump = dealias->data; timeval_add_ms(&state->next_tx, &state->last_tx, bump->wait_probe); return 0; } static void dealias_bump_handletimeout(scamper_task_t *task) { scamper_dealias_t *dealias = dealias_getdata(task); dealias_state_t *state = dealias_getstate(task); dealias_bump_t *bs = state->methodstate; scamper_dealias_bump_t *bump = dealias->data; scamper_dealias_probe_t *probes[3]; uint32_t i, x, y; if(bs->step < 2) { bs->step++; } else if(bs->step == 2) { /* check if the last set of probes are in sequence */ for(i=0; i<3; i++) if(dealias->probes[dealias->probec-3+i]->replyc == 1) probes[i] = dealias->probes[dealias->probec-3+i]; else break; if(i != 3) goto none; if(scamper_dealias_ipid_inseq(probes, 3, 0, 0) != 1) { dealias_result(task, SCAMPER_DEALIAS_RESULT_NOTALIASES); return; } if(bs->attempt > bump->attempts) { dealias_result(task, SCAMPER_DEALIAS_RESULT_ALIASES); return; } x = probes[1]->replies[0]->ipid; y = probes[2]->replies[0]->ipid; if(x < y) i = y - x; else i = 0x10000 + y - x; if(i * 2 > 65535) goto none; bs->bump = i * 2; if(bs->bump == 2) bs->bump++; if(bs->bump > bump->bump_limit) goto none; bs->step++; } else if(bs->step == 3) { if(bs->bump != 0) { bs->bump--; return; } bs->attempt++; bs->step = 1; } if(state->probe == 1) state->probe = 0; else state->probe = 1; return; none: dealias_result(task, SCAMPER_DEALIAS_RESULT_NONE); return; } static void dealias_bump_handlereply(scamper_task_t *task, scamper_dealias_probe_t *probe, scamper_dealias_reply_t *reply, scamper_dl_rec_t *dl) { /* check to see if the response could be useful for alias resolution */ if(SCAMPER_DEALIAS_REPLY_FROM_TARGET(probe,reply) == 0 || probe->replyc != 1) { dealias_result(task, SCAMPER_DEALIAS_RESULT_NONE); return; } return; } static void do_dealias_handle_dl(scamper_task_t *task, scamper_dl_rec_t *dl) { static void (*const func[])(scamper_task_t *, scamper_dealias_probe_t *, scamper_dealias_reply_t *, scamper_dl_rec_t *) = { dealias_mercator_handlereply, dealias_ally_handlereply, dealias_radargun_handlereply, dealias_prefixscan_handlereply, dealias_bump_handlereply, }; scamper_dealias_probe_t *probe = NULL; scamper_dealias_reply_t *reply = NULL; scamper_dealias_t *dealias = dealias_getdata(task); dealias_state_t *state = dealias_getstate(task); dealias_target_t *tgt; scamper_addr_t a; int v4 = 0; /* if we haven't sent a probe yet, then we have nothing to match */ if(dealias->probec == 0) return; if(dl->dl_af == AF_INET) v4 = 1; else if(dl->dl_af != AF_INET6) return; if(v4 && SCAMPER_DL_IS_TCP(dl)) { if(scamper_dl_rec_src(dl, &a) != 0 || (tgt = dealias_target_find(state, &a)) == NULL) return; probe = dealias_probe_tcp_find2(state, tgt, dl->dl_tcp_dport, dl->dl_tcp_sport); scamper_dl_rec_tcp_print(dl); } else if(state->flags & DEALIAS_STATE_FLAG_DL && SCAMPER_DL_IS_ICMP(dl)) { /* if the ICMP type is not something that we care for, then drop it */ if(SCAMPER_DL_IS_ICMP_TTL_EXP(dl) || SCAMPER_DL_IS_ICMP_UNREACH(dl) || SCAMPER_DL_IS_ICMP_PACKET_TOO_BIG(dl)) { /* the IPID value used is expected to be of the form 0xabab */ if(v4 && (dl->dl_icmp_ip_id & 0xff) != (dl->dl_icmp_ip_id >> 8)) return; /* get the address to match with */ if(scamper_dl_rec_icmp_ip_dst(dl, &a) != 0 || (tgt = dealias_target_find(state, &a)) == NULL) return; if(dl->dl_icmp_ip_proto == IPPROTO_UDP) probe = dealias_probe_udp_find(state, tgt, dl->dl_icmp_ip_id, dl->dl_icmp_udp_sport, dl->dl_icmp_udp_dport); else if(dl->dl_icmp_ip_proto == IPPROTO_ICMP || dl->dl_icmp_ip_proto == IPPROTO_ICMPV6) probe = dealias_probe_icmp_find(state, tgt, dl->dl_icmp_ip_id, dl->dl_icmp_icmp_type, dl->dl_icmp_icmp_code, dl->dl_icmp_icmp_id, dl->dl_icmp_icmp_seq); else if(dl->dl_icmp_ip_proto == IPPROTO_TCP) probe = dealias_probe_tcp_find(state, tgt, dl->dl_icmp_ip_id, dl->dl_icmp_tcp_sport, dl->dl_icmp_tcp_dport); } else if(SCAMPER_DL_IS_ICMP_ECHO_REPLY(dl) != 0) { if(scamper_dl_rec_src(dl, &a) != 0 || (tgt = dealias_target_find(state, &a)) == NULL) return; probe = dealias_probe_echoreq_find(state, tgt, dl->dl_icmp_id, dl->dl_icmp_seq); } else return; scamper_dl_rec_icmp_print(dl); } if(probe == NULL || scamper_dl_rec_src(dl, &a) != 0) return; if((reply = scamper_dealias_reply_alloc()) == NULL) { scamper_debug(__func__, "could not alloc reply"); goto err; } if(scamper_addr_cmp(&a, probe->def->dst) == 0) { reply->src = scamper_addr_use(probe->def->dst); } else if((reply->src=scamper_addrcache_get(addrcache,a.type,a.addr)) == NULL) { scamper_debug(__func__, "could not get address from cache"); goto err; } timeval_cpy(&reply->rx, &dl->dl_tv); reply->ttl = dl->dl_ip_ttl; reply->proto = dl->dl_ip_proto; if(v4) { reply->ipid = dl->dl_ip_id; } else if(SCAMPER_DL_IS_IP_FRAG(dl)) { reply->flags |= SCAMPER_DEALIAS_REPLY_FLAG_IPID32; reply->ipid32 = dl->dl_ip6_id; } if(SCAMPER_DL_IS_TCP(dl)) { reply->tcp_flags = dl->dl_tcp_flags; } else { reply->icmp_type = dl->dl_icmp_type; reply->icmp_code = dl->dl_icmp_code; reply->icmp_q_ip_ttl = dl->dl_icmp_ip_ttl; } if(scamper_dealias_reply_add(probe, reply) != 0) { scamper_debug(__func__, "could not add reply to probe"); goto err; } if(func[dealias->method-1] != NULL) func[dealias->method-1](task, probe, reply, dl); return; err: if(reply != NULL) scamper_dealias_reply_free(reply); dealias_handleerror(task, errno); return; } static void do_dealias_handle_icmp(scamper_task_t *task,scamper_icmp_resp_t *ir) { static void (*const func[])(scamper_task_t *, scamper_dealias_probe_t *, scamper_dealias_reply_t *, scamper_dl_rec_t *) = { dealias_mercator_handlereply, dealias_ally_handlereply, NULL, /* radargun */ dealias_prefixscan_handlereply, dealias_bump_handlereply, }; scamper_dealias_probe_t *probe = NULL; scamper_dealias_reply_t *reply = NULL; scamper_dealias_t *dealias = dealias_getdata(task); dealias_state_t *state = dealias_getstate(task); dealias_target_t *tgt; scamper_addr_t a; /* if we haven't sent a probe yet, then we have nothing to match */ if(dealias->probec == 0) return; /* are we handling all responses using datalink sockets? */ if((state->flags & DEALIAS_STATE_FLAG_DL) != 0) return; /* if the ICMP type is not something that we care for, then drop it */ if(SCAMPER_ICMP_RESP_IS_TTL_EXP(ir) || SCAMPER_ICMP_RESP_IS_UNREACH(ir) || SCAMPER_ICMP_RESP_IS_PACKET_TOO_BIG(ir)) { if(SCAMPER_ICMP_RESP_INNER_IS_SET(ir) == 0 || ir->ir_inner_ip_off != 0) return; /* the IPID value used is expected to be of the form 0xabab */ if(ir->ir_af == AF_INET && (ir->ir_inner_ip_id & 0xff) != (ir->ir_inner_ip_id >> 8)) return; if(scamper_icmp_resp_inner_dst(ir, &a) != 0 || (tgt = dealias_target_find(state, &a)) == NULL) return; if(ir->ir_inner_ip_proto == IPPROTO_UDP) probe = dealias_probe_udp_find(state, tgt, ir->ir_inner_ip_id, ir->ir_inner_udp_sport, ir->ir_inner_udp_dport); else if(ir->ir_inner_ip_proto == IPPROTO_ICMP || ir->ir_inner_ip_proto == IPPROTO_ICMPV6) probe = dealias_probe_icmp_find(state, tgt, ir->ir_inner_ip_id, ir->ir_inner_icmp_type, ir->ir_inner_icmp_code, ir->ir_inner_icmp_id, ir->ir_inner_icmp_seq); else if(ir->ir_inner_ip_proto == IPPROTO_TCP) probe = dealias_probe_tcp_find(state, tgt, ir->ir_inner_ip_id, ir->ir_inner_tcp_sport, ir->ir_inner_tcp_dport); if(scamper_icmp_resp_src(ir, &a) != 0) return; } else if(SCAMPER_ICMP_RESP_IS_ECHO_REPLY(ir) != 0) { if(scamper_icmp_resp_src(ir, &a) != 0 || (tgt = dealias_target_find(state, &a)) == NULL) return; probe = dealias_probe_echoreq_find(state, tgt, ir->ir_icmp_id, ir->ir_icmp_seq); } if(probe == NULL) return; scamper_icmp_resp_print(ir); if((reply = scamper_dealias_reply_alloc()) == NULL) { scamper_debug(__func__, "could not alloc reply"); goto err; } if(scamper_addr_cmp(&a, probe->def->dst) == 0) { reply->src = scamper_addr_use(probe->def->dst); } else if((reply->src=scamper_addrcache_get(addrcache,a.type,a.addr)) == NULL) { scamper_debug(__func__, "could not get address from cache"); goto err; } timeval_cpy(&reply->rx, &ir->ir_rx); reply->ttl = (uint8_t)ir->ir_ip_ttl; reply->icmp_type = ir->ir_icmp_type; reply->icmp_code = ir->ir_icmp_code; reply->icmp_q_ip_ttl = ir->ir_inner_ip_ttl; if(ir->ir_af == AF_INET) { reply->ipid = ir->ir_ip_id; reply->proto = IPPROTO_ICMP; } else { reply->proto = IPPROTO_ICMPV6; } if(scamper_dealias_reply_add(probe, reply) != 0) { scamper_debug(__func__, "could not add reply to probe"); goto err; } if(func[dealias->method-1] != NULL) func[dealias->method-1](task, probe, reply, NULL); return; err: if(reply != NULL) scamper_dealias_reply_free(reply); dealias_handleerror(task, errno); return; } static void do_dealias_handle_timeout(scamper_task_t *task) { static void (*const func[])(scamper_task_t *) = { dealias_mercator_handletimeout, dealias_ally_handletimeout, dealias_radargun_handletimeout, dealias_prefixscan_handletimeout, dealias_bump_handletimeout, }; scamper_dealias_t *dealias = dealias_getdata(task); func[dealias->method-1](task); return; } /* * dealias_state_probe * * record the fact that a probe was sent */ static int dealias_state_probe(dealias_state_t *state, dealias_probedef_t *pdef, scamper_dealias_probe_t *probe, scamper_probe_t *pr) { dealias_probe_t *dp = NULL; /* allocate a structure to record this probe's details */ if((dp = malloc_zero(sizeof(dealias_probe_t))) == NULL) { printerror(__func__, "could not malloc dealias_probe_t"); goto err; } if(pdef->def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP_DPORT) dp->match_field = pr->pr_udp_dport; else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_ICMP(pdef->def)) dp->match_field = pr->pr_icmp_seq; else if(SCAMPER_DEALIAS_PROBEDEF_VARY_TCP_SPORT(pdef->def)) dp->match_field = pr->pr_tcp_sport; dp->probe = probe; dp->target = pdef->target; if((dp->target_node = dlist_head_push(dp->target->probes, dp)) == NULL || dlist_tail_push(state->recent_probes, dp) == NULL) { printerror(__func__, "could not push to lists"); goto err; } return 0; err: if(dp != NULL) free(dp); return -1; } static void dealias_prefixscan_free(void *data) { dealias_prefixscan_t *pfstate = data; int j; if(pfstate->probedefs != NULL) { for(j=0; jprobedefc; j++) { if(pfstate->probedefs[j].src != NULL) scamper_addr_free(pfstate->probedefs[j].src); if(pfstate->probedefs[j].dst != NULL) scamper_addr_free(pfstate->probedefs[j].dst); } free(pfstate->probedefs); } if(pfstate->aaliases != NULL) { for(j=0; jaaliasc; j++) if(pfstate->aaliases[j] != NULL) scamper_addr_free(pfstate->aaliases[j]); free(pfstate->aaliases); } free(pfstate); return; } static int dealias_prefixscan_alloc(scamper_dealias_t *dealias, dealias_state_t *state) { scamper_dealias_prefixscan_t *pfxscan = dealias->data; scamper_dealias_probedef_t pd; dealias_prefixscan_t *pfstate = NULL; scamper_addr_t **addrs = NULL; int i, addrc = 0; /* figure out the addresses that will be probed */ if(dealias_prefixscan_array(dealias, &addrs, &addrc) != 0) goto err; if((pfstate = malloc_zero(sizeof(dealias_prefixscan_t))) == NULL) { printerror(__func__, "could not malloc pfstate"); goto err; } state->methodstate = pfstate; pfstate->probedefs = malloc_zero(addrc * sizeof(scamper_dealias_probedef_t)); if(pfstate->probedefs == NULL) { printerror(__func__, "could not malloc probedefs"); goto err; } pfstate->probedefc = addrc; for(i=0; iprobedefs[0], sizeof(pd)); pd.dst = scamper_addr_use(addrs[i]); pd.src = scamper_getsrc(pd.dst, 0); memcpy(&pfstate->probedefs[i], &pd, sizeof(pd)); } dealias_prefixscan_array_free(addrs, addrc); return 0; err: if(addrs != NULL) dealias_prefixscan_array_free(addrs, addrc); return -1; } static void dealias_radargun_free(void *data) { dealias_radargun_t *rgstate = data; if(rgstate->order != NULL) free(rgstate->order); free(rgstate); return; } static int dealias_radargun_alloc(scamper_dealias_radargun_t *rg, dealias_state_t *state) { dealias_radargun_t *rgstate = NULL; uint32_t i; size_t size; if((rgstate = malloc_zero(sizeof(dealias_radargun_t))) == NULL) { printerror(__func__, "could not malloc rgstate"); return -1; } state->methodstate = rgstate; /* if the probe order is to be shuffled, then shuffle it */ if((rg->flags & SCAMPER_DEALIAS_RADARGUN_FLAG_SHUFFLE)) { size = sizeof(uint32_t) * rg->probedefc; if((rgstate->order = malloc_zero(size)) == NULL) { printerror(__func__, "could not malloc order"); return -1; } for(i=0; iprobedefc; i++) rgstate->order[i] = i; if(shuffle32(rgstate->order, rg->probedefc) != 0) return -1; } return 0; } static int dealias_bump_alloc(dealias_state_t *state) { dealias_bump_t *bstate = NULL; if((bstate = malloc_zero(sizeof(dealias_bump_t))) == NULL) { printerror(__func__, "could not malloc bstate"); return -1; } state->methodstate = bstate; return 0; } static void dealias_bump_free(void *data) { free(data); return; } static void dealias_state_free(scamper_dealias_t *dealias, dealias_state_t *state) { int j; if(state == NULL) return; if(state->recent_probes != NULL) dlist_free(state->recent_probes); if(state->methodstate != NULL) { if(SCAMPER_DEALIAS_METHOD_IS_PREFIXSCAN(dealias)) dealias_prefixscan_free(state->methodstate); else if(SCAMPER_DEALIAS_METHOD_IS_RADARGUN(dealias)) dealias_radargun_free(state->methodstate); else if(SCAMPER_DEALIAS_METHOD_IS_BUMP(dealias)) dealias_bump_free(state->methodstate); } if(state->targets != NULL) splaytree_free(state->targets, (splaytree_free_t)dealias_target_free); if(state->pds != NULL) { for(j=0; jpdc; j++) if(state->pds[j] != NULL) free(state->pds[j]); free(state->pds); } if(state->ptbq != NULL) slist_free_cb(state->ptbq, (slist_free_t)dealias_ptb_free); if(state->discard != NULL) slist_free_cb(state->discard, (slist_free_t)scamper_dealias_probe_free); free(state); return; } static void do_dealias_probe(scamper_task_t *task) { static int (*const postprobe_func[])(scamper_dealias_t *, dealias_state_t *) = { dealias_mercator_postprobe, dealias_ally_postprobe, dealias_radargun_postprobe, dealias_prefixscan_postprobe, dealias_bump_postprobe, }; static dealias_probedef_t *(*const def_func[])(scamper_dealias_t *, dealias_state_t *) = { dealias_mercator_def, dealias_ally_def, dealias_radargun_def, dealias_prefixscan_def, dealias_bump_def, }; scamper_dealias_t *dealias = dealias_getdata(task); dealias_state_t *state = dealias_getstate(task); dealias_probedef_t *pdef; scamper_dealias_probedef_t *def; scamper_dealias_probe_t *dp = NULL; scamper_probe_t probe; dealias_ptb_t *ptb = NULL; uint16_t u16; if(dealias->probec == 0) gettimeofday_wrap(&dealias->start); memset(&probe, 0, sizeof(probe)); if((state->flags & DEALIAS_STATE_FLAG_DL) != 0) probe.pr_flags |= SCAMPER_PROBE_FLAG_DL; if(slist_count(state->ptbq) > 0) { ptb = slist_head_pop(state->ptbq); def = ptb->def; probe.pr_ip_src = def->src; probe.pr_ip_dst = def->dst; probe.pr_ip_ttl = 255; SCAMPER_PROBE_ICMP_PTB(&probe, def->mtu); probe.pr_data = ptb->quote; probe.pr_len = ptb->quote_len; if(scamper_probe_task(&probe, task) != 0) { errno = probe.pr_errno; goto err; } timeval_cpy(&state->ptb_tx, &probe.pr_tx); dealias_ptb_free(ptb); dealias_queue(task); return; } if((pdef = def_func[dealias->method-1](dealias, state)) == NULL) goto err; def = pdef->def; if(pktbuf_len < state->pds[def->id]->pktbuf_len) { if(realloc_wrap((void **)&pktbuf, state->pds[def->id]->pktbuf_len) != 0) { printerror(__func__, "could not realloc pktbuf"); goto err; } pktbuf_len = state->pds[def->id]->pktbuf_len; } probe.pr_ip_src = def->src; probe.pr_ip_dst = def->dst; probe.pr_ip_ttl = def->ttl; probe.pr_ip_tos = def->tos; probe.pr_data = pktbuf; probe.pr_len = state->pds[def->id]->pktbuf_len; if(SCAMPER_ADDR_TYPE_IS_IPV4(def->dst)) { probe.pr_flags |= SCAMPER_PROBE_FLAG_IPID; probe.pr_ip_id = state->id << 8 | state->id; probe.pr_ip_off = IP_DF; } if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP(def)) { probe.pr_ip_proto = IPPROTO_UDP; probe.pr_udp_sport = def->un.udp.sport; if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP) probe.pr_udp_dport = def->un.udp.dport; else if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP_DPORT) probe.pr_udp_dport = def->un.udp.dport + pdef->target->udp_dport++; else goto err; /* hack to get the udp csum to be a particular value, and be valid */ u16 = htons(dealias->probec + 1); memcpy(probe.pr_data, &u16, 2); u16 = scamper_udp4_cksum(&probe); memcpy(probe.pr_data, &u16, 2); } else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_ICMP(def)) { SCAMPER_PROBE_ICMP_ECHO(&probe, def->un.icmp.id, state->icmpseq++); /* hack to get the icmp csum to be a particular value, and be valid */ u16 = htons(def->un.icmp.csum); memcpy(probe.pr_data, &u16, 2); u16 = scamper_icmp4_cksum(&probe); memcpy(probe.pr_data, &u16, 2); } else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP(def)) { probe.pr_ip_proto = IPPROTO_TCP; probe.pr_tcp_dport = def->un.tcp.dport; probe.pr_tcp_flags = def->un.tcp.flags; if(def->method == SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK) { probe.pr_tcp_sport = def->un.tcp.sport; probe.pr_tcp_seq = state->pds[def->id]->tcp_seq; probe.pr_tcp_ack = state->pds[def->id]->tcp_ack; } else if(SCAMPER_DEALIAS_PROBEDEF_VARY_TCP_SPORT(def)) { probe.pr_tcp_sport = def->un.tcp.sport + pdef->target->tcp_sport++; if(random_u32(&probe.pr_tcp_seq) != 0 || random_u32(&probe.pr_tcp_ack) != 0) goto err; } else goto err; } /* * allocate a probe record before we try and send the probe as there is no * point sending something into the wild that we can't record */ if((dp = scamper_dealias_probe_alloc()) == NULL) { printerror(__func__, "could not alloc probe"); goto err; } dp->def = def; dp->ipid = probe.pr_ip_id; dp->seq = state->round; if(dealias_state_probe(state, pdef, dp, &probe) != 0) goto err; /* send the probe */ if(scamper_probe_task(&probe, task) != 0) { errno = probe.pr_errno; goto err; } /* record details of the probe in the scamper_dealias_t data structures */ timeval_cpy(&dp->tx, &probe.pr_tx); if(scamper_dealias_probe_add(dealias, dp) != 0) { scamper_debug(__func__, "could not add probe to dealias data"); goto err; } /* figure out how long to wait until sending the next probe */ timeval_cpy(&state->last_tx, &probe.pr_tx); if(postprobe_func[dealias->method-1](dealias, state) != 0) goto err; assert(state->id != 0); if(--state->id == 0) state->id = 255; dealias_queue(task); return; err: if(ptb != NULL) dealias_ptb_free(ptb); dealias_handleerror(task, errno); return; } static void do_dealias_write(scamper_file_t *sf, scamper_task_t *task) { scamper_file_write_dealias(sf, dealias_getdata(task)); return; } static void do_dealias_halt(scamper_task_t *task) { dealias_result(task, SCAMPER_DEALIAS_RESULT_HALTED); return; } static void do_dealias_free(scamper_task_t *task) { scamper_dealias_t *dealias = dealias_getdata(task); dealias_state_t *state = dealias_getstate(task); if(state != NULL) dealias_state_free(dealias, state); if(dealias != NULL) scamper_dealias_free(dealias); return; } static int dealias_arg_param_validate(int optid, char *param, long *out) { long tmp; switch(optid) { case DEALIAS_OPT_OPTION: case DEALIAS_OPT_PROBEDEF: case DEALIAS_OPT_EXCLUDE: tmp = 0; break; case DEALIAS_OPT_DPORT: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 65535) return -1; break; case DEALIAS_OPT_FUDGE: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 65535) return -1; break; case DEALIAS_OPT_METHOD: if(strcasecmp(param, "mercator") == 0) tmp = SCAMPER_DEALIAS_METHOD_MERCATOR; else if(strcasecmp(param, "ally") == 0) tmp = SCAMPER_DEALIAS_METHOD_ALLY; else if(strcasecmp(param, "radargun") == 0) tmp = SCAMPER_DEALIAS_METHOD_RADARGUN; else if(strcasecmp(param, "prefixscan") == 0) tmp = SCAMPER_DEALIAS_METHOD_PREFIXSCAN; else if(strcasecmp(param, "bump") == 0) tmp = SCAMPER_DEALIAS_METHOD_BUMP; else return -1; break; case DEALIAS_OPT_ATTEMPTS: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 500) return -1; break; case DEALIAS_OPT_SPORT: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 65535) return -1; break; case DEALIAS_OPT_TTL: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 255) return -1; break; case DEALIAS_OPT_USERID: if(string_tolong(param, &tmp) != 0 || tmp < 0) return -1; break; case DEALIAS_OPT_WAIT_TIMEOUT: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 255) return -1; break; case DEALIAS_OPT_WAIT_PROBE: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 65535) return -1; break; case DEALIAS_OPT_WAIT_ROUND: if(string_tolong(param, &tmp) != 0 || tmp < 1 || tmp > 180000) return -1; break; case DEALIAS_OPT_REPLYC: if(string_tolong(param, &tmp) != 0 || tmp < 3 || tmp > 255) return -1; break; default: scamper_debug(__func__, "unhandled optid %d", optid); return -1; } if(out != NULL) *out = tmp; return 0; } static int dealias_probedef_args(scamper_dealias_probedef_t *def, char *str) { scamper_option_out_t *opts_out = NULL, *opt; uint16_t dport = 33435; uint16_t sport = scamper_sport_default(); uint16_t csum = 0; uint16_t opts = 0; uint8_t ttl = 255; uint8_t tos = 0; uint16_t size = 0; uint16_t mtu = 0; char *end; long tmp; /* try and parse the string passed in */ if(scamper_options_parse(str, probedef_opts, probedef_opts_cnt, &opts_out, &end) != 0) { scamper_debug(__func__, "could not parse options"); goto err; } for(opt = opts_out; opt != NULL; opt = opt->next) { /* check for an option being used multiple times */ if(opts & (1<<(opt->id-1))) { scamper_debug(__func__,"option %d specified multiple times",opt->id); goto err; } opts |= (1 << (opt->id-1)); switch(opt->id) { case DEALIAS_PROBEDEF_OPT_CSUM: if(string_tolong(opt->str, &tmp) != 0 || tmp < 0 || tmp > 65535) { scamper_debug(__func__, "invalid csum %s", opt->str); goto err; } csum = (uint16_t)tmp; break; case DEALIAS_PROBEDEF_OPT_DPORT: if(string_tolong(opt->str, &tmp) != 0 || tmp < 1 || tmp > 65535) { scamper_debug(__func__, "invalid dport %s", opt->str); goto err; } dport = (uint16_t)tmp; break; case DEALIAS_PROBEDEF_OPT_IP: def->dst = scamper_addrcache_resolve(addrcache, AF_UNSPEC, opt->str); if(def->dst == NULL) { scamper_debug(__func__, "invalid dst ip %s", opt->str); goto err; } break; case DEALIAS_PROBEDEF_OPT_MTU: if(string_tolong(opt->str, &tmp) != 0 || tmp < 100 || tmp > 65535) { scamper_debug(__func__, "invalid mtu size %s", opt->str); goto err; } mtu = (uint16_t)tmp; break; case DEALIAS_PROBEDEF_OPT_PROTO: if(strcasecmp(opt->str, "udp") == 0) def->method = SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP; else if(strcasecmp(opt->str, "tcp-ack") == 0) def->method = SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK; else if(strcasecmp(opt->str, "icmp-echo") == 0) def->method = SCAMPER_DEALIAS_PROBEDEF_METHOD_ICMP_ECHO; else if(strcasecmp(opt->str, "tcp-ack-sport") == 0) def->method = SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_ACK_SPORT; else if(strcasecmp(opt->str, "udp-dport") == 0) def->method = SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP_DPORT; else if(strcasecmp(opt->str, "tcp-syn-sport") == 0) def->method = SCAMPER_DEALIAS_PROBEDEF_METHOD_TCP_SYN_SPORT; else { scamper_debug(__func__, "invalid probe type %s", opt->str); goto err; } break; case DEALIAS_PROBEDEF_OPT_SIZE: if(string_tolong(opt->str, &tmp) != 0 || tmp < 100 || tmp > 65535) { scamper_debug(__func__, "invalid probe size %s", opt->str); goto err; } size = (uint16_t)tmp; break; case DEALIAS_PROBEDEF_OPT_SPORT: if(string_tolong(opt->str, &tmp) != 0 || tmp < 1 || tmp > 65535) { scamper_debug(__func__, "invalid sport %s", opt->str); goto err; } sport = (uint16_t)tmp; break; case DEALIAS_PROBEDEF_OPT_TTL: if(string_tolong(opt->str, &tmp) != 0 || tmp < 1 || tmp > 255) { scamper_debug(__func__, "invalid ttl %s", opt->str); goto err; } ttl = (uint8_t)tmp; break; default: scamper_debug(__func__, "unhandled optid %d", opt->id); goto err; } } scamper_options_free(opts_out); opts_out = NULL; /* * if there is something at the end of the option string, then this * probedef is not valid */ if(end != NULL) { scamper_debug(__func__, "invalid option string"); goto err; } /* record the ttl, tos, size */ def->ttl = ttl; def->tos = tos; def->size = size; def->mtu = mtu; /* if no protocol type is defined, choose UDP */ if((opts & (1<<(DEALIAS_PROBEDEF_OPT_PROTO-1))) == 0) def->method = SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP; if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP(def)) { /* don't provide the choice of the checksum value in a UDP probe */ if(opts & (1<<(DEALIAS_PROBEDEF_OPT_CSUM-1))) { scamper_debug(__func__, "csum option not permitted for udp"); goto err; } def->un.udp.dport = dport; def->un.udp.sport = sport; } else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_ICMP(def)) { /* ICMP probes don't have source or destination ports */ if(opts & (1<<(DEALIAS_PROBEDEF_OPT_SPORT-1))) { scamper_debug(__func__, "sport option not permitted for icmp"); goto err; } if(opts & (1<<(DEALIAS_PROBEDEF_OPT_DPORT-1))) { scamper_debug(__func__, "dport option not permitted for icmp"); goto err; } def->un.icmp.csum = csum; def->un.icmp.id = scamper_sport_default(); } else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP(def)) { /* don't provide the choice of the checksum value in a TCP probe */ if(opts & (1<<(DEALIAS_PROBEDEF_OPT_CSUM-1))) { scamper_debug(__func__, "csum option not permitted for tcp"); goto err; } def->un.tcp.dport = dport; def->un.tcp.sport = sport; if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP_ACK(def)) def->un.tcp.flags = TH_ACK; else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP_SYN(def)) def->un.tcp.flags = TH_SYN; else { scamper_debug(__func__,"unhandled flags for method %d",def->method); goto err; } } else { scamper_debug(__func__, "unhandled method %d", def->method); goto err; } return 0; err: if(opts_out != NULL) scamper_options_free(opts_out); if(def->dst != NULL) scamper_addr_free(def->dst); return -1; } static int dealias_alloc_mercator(scamper_dealias_t *d, dealias_options_t *o) { scamper_dealias_mercator_t *mercator; scamper_addr_t *dst = NULL; /* if there is no IP address after the options string, then stop now */ if(o->addr == NULL) { scamper_debug(__func__, "missing target address for mercator"); goto err; } if((dst = scamper_addrcache_resolve(addrcache, AF_UNSPEC, o->addr)) == NULL) { scamper_debug(__func__, "unable to resolve address for mercator"); goto err; } if(o->probedefs != NULL || o->xs != NULL || o->wait_probe != 0 || o->fudge != 0 || o->attempts > 3 || o->nobs != 0 || o->replyc != 0 || o->shuffle != 0 || o->inseq != 0) { scamper_debug(__func__, "invalid parameters for mercator"); goto err; } if(o->attempts == 0) o->attempts = 3; if(o->dport == 0) o->dport = 33435; if(o->sport == 0) o->sport = scamper_sport_default(); if(o->ttl == 0) o->ttl = 255; if(scamper_dealias_mercator_alloc(d) != 0) { scamper_debug(__func__, "could not alloc mercator structure"); goto err; } mercator = d->data; mercator->attempts = o->attempts; mercator->wait_timeout = o->wait_timeout; mercator->probedef.id = 0; mercator->probedef.dst = dst; dst = NULL; mercator->probedef.ttl = o->ttl; mercator->probedef.method = SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP; mercator->probedef.un.udp.sport = o->sport; mercator->probedef.un.udp.dport = o->dport; return 0; err: if(dst != NULL) scamper_addr_free(dst); return -1; } static int dealias_alloc_ally(scamper_dealias_t *d, dealias_options_t *o) { scamper_dealias_ally_t *ally = NULL; scamper_dealias_probedef_t pd[2]; int i, probedefc = 0; slist_node_t *sn; uint8_t flags = 0; char *addr2; memset(&pd, 0, sizeof(pd)); if(o->probedefs != NULL) probedefc = slist_count(o->probedefs); if(probedefc > 2 || o->xs != NULL || o->dport != 0 || o->sport != 0 || o->ttl != 0 || o->replyc != 0 || o->shuffle != 0 || (o->inseq != 0 && o->fudge != 0)) { scamper_debug(__func__, "invalid parameters for ally"); goto err; } if(o->wait_probe == 0) o->wait_probe = 150; if(o->attempts == 0) o->attempts = 5; if(o->fudge == 0 && o->inseq == 0) o->fudge = 200; if(probedefc > 0) { i = 0; for(sn=slist_head_node(o->probedefs); sn != NULL; sn=slist_node_next(sn)) { if(dealias_probedef_args(&pd[i], (char *)slist_node_item(sn)) != 0) { scamper_debug(__func__, "could not read ally probedef %d", i); goto err; } i++; } } if(probedefc == 0) { for(i=0; i<2; i++) { pd[i].ttl = 255; pd[i].method = SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP; pd[i].un.udp.sport = scamper_sport_default(); pd[i].un.udp.dport = 33435; } } else if(probedefc == 1) { if(pd[0].dst != NULL || o->addr == NULL) { scamper_debug(__func__, "dst IP specified incorrectly"); goto err; } memcpy(&pd[1], &pd[0], sizeof(scamper_dealias_probedef_t)); } if(o->addr == NULL) { if(pd[0].dst == NULL || pd[1].dst == NULL) { scamper_debug(__func__, "missing destination IP address"); goto err; } } else { if(pd[0].dst != NULL || pd[1].dst != NULL) { scamper_debug(__func__, "dst IP specified inconsistently"); goto err; } /* make sure there are two addresses specified */ if((addr2 = string_nextword(o->addr)) == NULL) { scamper_debug(__func__, "missing second address"); goto err; } /* resolve each address */ pd[0].dst = scamper_addrcache_resolve(addrcache, AF_UNSPEC, o->addr); if(pd[0].dst == NULL) { printerror(__func__, "could not resolve %s", o->addr); goto err; } pd[1].dst = scamper_addrcache_resolve(addrcache, AF_UNSPEC, addr2); if(pd[1].dst == NULL) { printerror(__func__, "could not resolve %s", addr2); goto err; } } if(pd[0].dst->type != pd[1].dst->type || SCAMPER_ADDR_TYPE_IS_IP(pd[0].dst) == 0 || SCAMPER_ADDR_TYPE_IS_IP(pd[1].dst) == 0) { scamper_debug(__func__, "dst IP specified incorrectly"); goto err; } if(o->nobs != 0 || SCAMPER_ADDR_TYPE_IS_IPV6(pd[0].dst)) flags |= SCAMPER_DEALIAS_ALLY_FLAG_NOBS; if(scamper_dealias_ally_alloc(d) != 0) { scamper_debug(__func__, "could not alloc ally structure"); goto err; } ally = d->data; ally->attempts = o->attempts; ally->wait_probe = o->wait_probe; ally->wait_timeout = o->wait_timeout; ally->fudge = o->fudge; ally->flags = flags; for(i=0; i<2; i++) pd[i].id = i; memcpy(ally->probedefs, pd, sizeof(ally->probedefs)); return 0; err: if(pd[0].dst != NULL) scamper_addr_free(pd[0].dst); if(pd[1].dst != NULL) scamper_addr_free(pd[1].dst); return -1; } static int dealias_alloc_radargun(scamper_dealias_t *d, dealias_options_t *o) { scamper_dealias_radargun_t *rg; scamper_dealias_probedef_t *pd = NULL, pd0; slist_t *pd_list = NULL; slist_node_t *sn; uint32_t i, probedefc; uint8_t flags = 0; char *a1, *a2; int j, pdc = 0; memset(&pd0, 0, sizeof(pd0)); if(o->xs != NULL || o->dport != 0 || o->sport != 0 || o->ttl != 0 || o->nobs != 0 || o->replyc != 0 || o->inseq != 0) { scamper_debug(__func__, "invalid parameters for radargun"); goto err; } if(o->probedefs != NULL) pdc = slist_count(o->probedefs); if(o->wait_probe == 0) o->wait_probe = 150; if(o->attempts == 0) o->attempts = 30; if(o->wait_round == 0) o->wait_round = pdc * o->wait_probe; if(o->shuffle != 0) flags |= SCAMPER_DEALIAS_RADARGUN_FLAG_SHUFFLE; if(pdc == 0) { pd0.ttl = 255; pd0.method = SCAMPER_DEALIAS_PROBEDEF_METHOD_UDP; pd0.un.udp.sport = scamper_sport_default(); pd0.un.udp.dport = 33435; } else if(pdc == 1) { if(dealias_probedef_args(&pd0, (char *)slist_head_item(o->probedefs))!=0) { scamper_debug(__func__, "could not parse radargun probedef 0"); goto err; } if(pd0.dst != NULL || o->addr == NULL) { scamper_debug(__func__, "dst addrs are specified after def"); goto err; } } if(pdc >= 2 && o->addr == NULL) { if((pd = malloc_zero(pdc * sizeof(scamper_dealias_probedef_t))) == NULL) { scamper_debug(__func__, "could not malloc radargun pd"); goto err; } i = 0; for(sn=slist_head_node(o->probedefs); sn != NULL; sn=slist_node_next(sn)) { if(dealias_probedef_args(&pd[i], (char *)slist_node_item(sn)) != 0 || pd[i].dst == NULL) { scamper_debug(__func__, "could not parse radargun def %d", i); goto err; } if(i != 0 && pd[0].dst->type != pd[i].dst->type) { scamper_debug(__func__, "mixed address families"); goto err; } pd[i].id = i; i++; } probedefc = i; } else if(pdc < 2 && o->addr != NULL) { if((pd_list = slist_alloc()) == NULL) { printerror(__func__, "could not alloc pd_list"); goto err; } a1 = o->addr; i = 0; for(;;) { a2 = string_nextword(a1); pd0.dst = scamper_addrcache_resolve(addrcache, AF_UNSPEC, a1); if(pd0.dst == NULL) goto err; pd0.id = i++; if((pd = memdup(&pd0, sizeof(pd0))) == NULL || slist_tail_push(pd_list, pd) == NULL) goto err; pd0.dst = NULL; if(a2 == NULL) break; a1 = a2; } probedefc = slist_count(pd_list); } else goto err; if(scamper_dealias_radargun_alloc(d) != 0) { scamper_debug(__func__, "could not alloc radargun structure"); goto err; } rg = d->data; if(scamper_dealias_radargun_probedefs_alloc(rg, probedefc) != 0) { scamper_debug(__func__, "could not alloc radargun probedefs"); goto err; } rg->attempts = o->attempts; rg->wait_probe = o->wait_probe; rg->wait_timeout = o->wait_timeout; rg->wait_round = o->wait_round; rg->probedefc = probedefc; rg->flags = flags; if(pd_list == NULL) { for(j=0; jprobedefs[j], &pd[j], sizeof(scamper_dealias_probedef_t)); } else { i=0; while((pd = slist_head_pop(pd_list)) != NULL) { memcpy(&rg->probedefs[i], pd, sizeof(scamper_dealias_probedef_t)); free(pd); i++; } slist_free(pd_list); pd_list = NULL; } return 0; err: if(pd != NULL) { for(j=0; jprobedefs) != 1 || o->addr == NULL || o->dport != 0 || o->sport != 0 || o->ttl != 0 || o->shuffle != 0 || (o->inseq != 0 && o->fudge != 0)) { scamper_debug(__func__, "invalid parameters for prefixscan"); goto err; } if(o->ttl == 0) o->ttl = 255; if(o->wait_probe == 0) o->wait_probe = 1000; if(o->attempts == 0) o->attempts = 2; if(o->replyc == 0) o->replyc = 5; if(o->nobs != 0) flags |= SCAMPER_DEALIAS_PREFIXSCAN_FLAG_NOBS; if(o->fudge == 0 && o->inseq == 0) o->fudge = 200; /* * we need `a' and `b' to traceroute. parse the `addr' string. * start by getting the second address. * * skip over the first address until we get to whitespace. */ if((addr2 = string_nextword(o->addr)) == NULL) { scamper_debug(__func__, "missing second address"); goto err; } string_nullterm_char(addr2, '/', &pfxstr); if(pfxstr == NULL) { scamper_debug(__func__, "missing prefix"); goto err; } if(string_tolong(pfxstr, &tmp) != 0 || tmp < 24 || tmp >= 32) { scamper_debug(__func__, "invalid prefix %s", pfxstr); goto err; } prefix = (uint8_t)tmp; /* check the sanity of the probedef */ memset(&pd0, 0, sizeof(pd0)); if(dealias_probedef_args(&pd0, (char *)slist_head_item(o->probedefs)) != 0) { scamper_debug(__func__, "could not parse prefixscan probedef"); goto err; } if(pd0.dst != NULL) { scamper_debug(__func__, "prefixscan ip address spec. in probedef"); scamper_addr_free(pd0.dst); pd0.dst = NULL; goto err; } if(scamper_dealias_prefixscan_alloc(d) != 0) { scamper_debug(__func__, "could not alloc prefixscan structure"); goto err; } prefixscan = d->data; prefixscan->attempts = o->attempts; prefixscan->fudge = o->fudge; prefixscan->wait_probe = o->wait_probe; prefixscan->wait_timeout = o->wait_timeout; prefixscan->replyc = o->replyc; prefixscan->prefix = prefix; prefixscan->flags = flags; /* resolve the two addresses now */ prefixscan->a = scamper_addrcache_resolve(addrcache, AF_UNSPEC, o->addr); if(prefixscan->a == NULL) { scamper_debug(__func__, "could not resolve %s", o->addr); goto err; } af = scamper_addr_af(prefixscan->a); prefixscan->b = scamper_addrcache_resolve(addrcache, af, addr2); if(prefixscan->b == NULL) { scamper_debug(__func__, "could not resolve %s", addr2); goto err; } /* add the first probedef */ if(scamper_dealias_prefixscan_probedefs_alloc(prefixscan, 1) != 0) { scamper_debug(__func__, "could not alloc prefixscan probedefs"); goto err; } memcpy(prefixscan->probedefs, &pd0, sizeof(pd0)); prefixscan->probedefs[0].dst = scamper_addr_use(prefixscan->a); prefixscan->probedefs[0].id = 0; prefixscan->probedefc = 1; /* resolve any addresses to exclude in the scan */ if(o->xs != NULL) { for(sn = slist_head_node(o->xs); sn != NULL; sn = slist_node_next(sn)) { xs = slist_node_item(sn); if((dst = scamper_addrcache_resolve(addrcache, af, xs)) == NULL) { scamper_debug(__func__, "could not resolve %s", xs); goto err; } if(scamper_dealias_prefixscan_xs_add(d, dst) != 0) { scamper_debug(__func__, "could not add %s to xs", xs); goto err; } scamper_addr_free(dst); dst = NULL; } } return 0; err: return -1; } static int dealias_alloc_bump(scamper_dealias_t *d, dealias_options_t *o) { scamper_dealias_bump_t *bump = NULL; scamper_dealias_probedef_t pd[2]; slist_node_t *sn; int i; memset(&pd, 0, sizeof(pd)); if(slist_count(o->probedefs) != 2 || o->xs != NULL || o->dport != 0 || o->sport != 0 || o->ttl != 0 || o->replyc != 0 || o->shuffle != 0 || o->addr != NULL || (o->inseq != 0 && o->fudge != 0)) { scamper_debug(__func__, "invalid parameters for bump"); goto err; } if(o->wait_probe == 0) o->wait_probe = 1000; if(o->attempts == 0) o->attempts = 3; if(o->fudge == 0) o->fudge = 30; /* bump limit */ i = 0; for(sn = slist_head_node(o->probedefs); sn != NULL; sn = slist_node_next(sn)) { if(dealias_probedef_args(&pd[i], (char *)slist_node_item(sn)) != 0) { scamper_debug(__func__, "could not read bump probedef %d", i); goto err; } if(pd[i].dst == NULL) { scamper_debug(__func__, "missing dst address in probedef %d", i); goto err; } if(pd[i].dst->type != SCAMPER_ADDR_TYPE_IPV4) { scamper_debug(__func__, "dst address not IPv4 in probedef %d", i); goto err; } pd[i].id = i; i++; } if(scamper_dealias_bump_alloc(d) != 0) { scamper_debug(__func__, "could not alloc bump structure"); goto err; } bump = d->data; bump->attempts = o->attempts; bump->wait_probe = o->wait_probe; bump->bump_limit = o->fudge; memcpy(bump->probedefs, pd, sizeof(bump->probedefs)); return 0; err: if(pd[0].dst != NULL) scamper_addr_free(pd[0].dst); if(pd[1].dst != NULL) scamper_addr_free(pd[1].dst); return -1; } /* * scamper_do_dealias_alloc * * given a string representing a dealias task, parse the parameters and * assemble a dealias. return the dealias structure so that it is all ready * to go. */ void *scamper_do_dealias_alloc(char *str) { static int (*const alloc_func[])(scamper_dealias_t *, dealias_options_t *) = { dealias_alloc_mercator, dealias_alloc_ally, dealias_alloc_radargun, dealias_alloc_prefixscan, dealias_alloc_bump, }; scamper_option_out_t *opts_out = NULL, *opt; scamper_dealias_t *dealias = NULL; dealias_options_t o; uint8_t method = SCAMPER_DEALIAS_METHOD_MERCATOR; uint32_t userid = 0; long tmp = 0; memset(&o, 0, sizeof(o)); /* try and parse the string passed in */ if(scamper_options_parse(str, opts, opts_cnt, &opts_out, &o.addr) != 0) { scamper_debug(__func__, "could not parse command"); goto err; } for(opt = opts_out; opt != NULL; opt = opt->next) { if(opt->type != SCAMPER_OPTION_TYPE_NULL && dealias_arg_param_validate(opt->id, opt->str, &tmp) != 0) { scamper_debug(__func__, "validation of optid %d failed", opt->id); goto err; } switch(opt->id) { case DEALIAS_OPT_METHOD: method = (uint8_t)tmp; break; case DEALIAS_OPT_USERID: userid = (uint32_t)tmp; break; case DEALIAS_OPT_OPTION: if(strcasecmp(opt->str, "nobs") == 0) o.nobs = 1; else if(strcasecmp(opt->str, "shuffle") == 0) o.shuffle = 1; else if(strcasecmp(opt->str, "inseq") == 0) o.inseq = 1; else { scamper_debug(__func__, "unknown option %s", opt->str); goto err; } break; case DEALIAS_OPT_ATTEMPTS: o.attempts = (uint8_t)tmp; break; case DEALIAS_OPT_DPORT: o.dport = (uint16_t)tmp; break; case DEALIAS_OPT_SPORT: o.sport = (uint16_t)tmp; break; case DEALIAS_OPT_FUDGE: o.fudge = (uint16_t)tmp; break; case DEALIAS_OPT_TTL: o.ttl = (uint8_t)tmp; break; case DEALIAS_OPT_PROBEDEF: if(o.probedefs == NULL && (o.probedefs = slist_alloc()) == NULL) { printerror(__func__, "could not alloc probedefs"); goto err; } if(slist_tail_push(o.probedefs, opt->str) == NULL) { printerror(__func__, "could not push probedef"); goto err; } break; case DEALIAS_OPT_WAIT_TIMEOUT: o.wait_timeout = (uint8_t)tmp; break; case DEALIAS_OPT_WAIT_PROBE: o.wait_probe = (uint16_t)tmp; break; case DEALIAS_OPT_WAIT_ROUND: o.wait_round = (uint32_t)tmp; break; case DEALIAS_OPT_EXCLUDE: if(o.xs == NULL && (o.xs = slist_alloc()) == NULL) { printerror(__func__, "could not alloc xs"); goto err; } if(slist_tail_push(o.xs, opt->str) == NULL) { printerror(__func__, "could not push xs"); goto err; } break; case DEALIAS_OPT_REPLYC: o.replyc = (uint8_t)tmp; break; default: scamper_debug(__func__, "unhandled option %d", opt->id); goto err; } } scamper_options_free(opts_out); opts_out = NULL; if(o.wait_timeout == 0) o.wait_timeout = 5; if((dealias = scamper_dealias_alloc()) == NULL) { scamper_debug(__func__, "could not alloc dealias structure"); goto err; } dealias->method = method; dealias->userid = userid; if(alloc_func[method-1](dealias, &o) != 0) goto err; if(o.probedefs != NULL) slist_free(o.probedefs); if(o.xs != NULL) slist_free(o.xs); return dealias; err: if(opts_out != NULL) scamper_options_free(opts_out); if(o.probedefs != NULL) free(o.probedefs); if(dealias != NULL) scamper_dealias_free(dealias); return NULL; } /* * scamper_do_dealias_arg_validate * * */ int scamper_do_dealias_arg_validate(int argc, char *argv[], int *stop) { return scamper_options_validate(opts, opts_cnt, argc, argv, stop, dealias_arg_param_validate); } void scamper_do_dealias_free(void *data) { scamper_dealias_free((scamper_dealias_t *)data); return; } static int probedef2sig(scamper_task_t *task, scamper_dealias_probedef_t *def) { scamper_task_sig_t *sig = NULL; char buf[32]; if(def->src == NULL && (def->src = scamper_getsrc(def->dst, 0)) == NULL) { printerror(__func__, "could not get src address for %s", scamper_addr_tostr(def->dst, buf, sizeof(buf))); goto err; } /* form a signature */ if((sig = scamper_task_sig_alloc(SCAMPER_TASK_SIG_TYPE_TX_IP)) == NULL) goto err; sig->sig_tx_ip_dst = scamper_addr_use(def->dst); sig->sig_tx_ip_src = scamper_addr_use(def->src); /* add it to the task */ if(scamper_task_sig_add(task, sig) != 0) goto err; return 0; err: if(sig != NULL) scamper_task_sig_free(sig); return -1; } scamper_task_t *scamper_do_dealias_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle) { scamper_dealias_t *dealias = (scamper_dealias_t *)data; dealias_state_t *state = NULL; scamper_task_t *task = NULL; scamper_dealias_probedef_t *def; scamper_dealias_prefixscan_t *pfxscan; scamper_dealias_mercator_t *mercator; scamper_dealias_radargun_t *radargun; scamper_dealias_ally_t *ally; scamper_dealias_bump_t *bump; dealias_prefixscan_t *pfstate; uint32_t p; int i; /* allocate a task structure and store the trace with it */ if((task = scamper_task_alloc(dealias, &funcs)) == NULL) goto err; if((state = malloc_zero(sizeof(dealias_state_t))) == NULL || (state->recent_probes = dlist_alloc()) == NULL || (state->ptbq = slist_alloc()) == NULL || (state->discard = slist_alloc()) == NULL || (state->targets = splaytree_alloc((splaytree_cmp_t)dealias_target_cmp)) == NULL) { printerror(__func__, "could not malloc state"); goto err; } state->id = 255; if(dealias->method == SCAMPER_DEALIAS_METHOD_MERCATOR) { mercator = dealias->data; if(probedef2sig(task, &mercator->probedef) != 0) goto err; state->probedefs = &mercator->probedef; state->probedefc = 1; } else if(dealias->method == SCAMPER_DEALIAS_METHOD_ALLY) { ally = dealias->data; for(i=0; i<2; i++) if(probedef2sig(task, &ally->probedefs[i]) != 0) goto err; state->probedefs = ally->probedefs; state->probedefc = 2; } else if(dealias->method == SCAMPER_DEALIAS_METHOD_RADARGUN) { radargun = dealias->data; for(p=0; pprobedefc; p++) if(probedef2sig(task, &radargun->probedefs[p]) != 0) goto err; state->probedefs = radargun->probedefs; state->probedefc = radargun->probedefc; if(dealias_radargun_alloc(radargun, state) != 0) goto err; } else if(dealias->method == SCAMPER_DEALIAS_METHOD_PREFIXSCAN) { if(dealias_prefixscan_alloc(dealias, state) != 0) goto err; pfxscan = dealias->data; if(probedef2sig(task, &pfxscan->probedefs[0]) != 0) goto err; state->probedefs = pfxscan->probedefs; state->probedefc = pfxscan->probedefc; pfstate = state->methodstate; for(i=0; iprobedefc; i++) { if(probedef2sig(task, &pfstate->probedefs[i]) != 0) goto err; } } else if(dealias->method == SCAMPER_DEALIAS_METHOD_BUMP) { bump = dealias->data; for(i=0; i<2; i++) if(probedef2sig(task, &bump->probedefs[i]) != 0) goto err; state->probedefs = bump->probedefs; state->probedefc = 2; if(dealias_bump_alloc(state) != 0) goto err; } else goto err; for(p=0; pprobedefc; p++) { def = &state->probedefs[p]; if(def->mtu != 0) state->flags |= DEALIAS_STATE_FLAG_DL; if(dealias_probedef_add(state, def) != 0) goto err; } /* associate the list and cycle with the trace */ dealias->list = scamper_list_use(list); dealias->cycle = scamper_cycle_use(cycle); scamper_task_setstate(task, state); state = NULL; return task; err: if(task != NULL) { scamper_task_setdatanull(task); scamper_task_free(task); } if(state != NULL) dealias_state_free(dealias, state); return NULL; } void scamper_do_dealias_cleanup(void) { if(pktbuf != NULL) { free(pktbuf); pktbuf = NULL; } return; } int scamper_do_dealias_init(void) { funcs.probe = do_dealias_probe; funcs.handle_icmp = do_dealias_handle_icmp; funcs.handle_timeout = do_dealias_handle_timeout; funcs.handle_dl = do_dealias_handle_dl; funcs.write = do_dealias_write; funcs.task_free = do_dealias_free; funcs.halt = do_dealias_halt; return 0; } scamper-cvs-20171204/scamper/dealias/scamper_dealias_do.h000644 001751 000000 00000002765 11737356726 023151 0ustar00mjlwheel000000 000000 /* * scamper_do_dealias.h * * $Id: scamper_dealias_do.h,v 1.4 2012/04/05 18:00:54 mjl Exp $ * * Copyright (C) 2008-2010 The University of Waikato * Author: Matthew Luckie * * This code implements alias resolution techniques published by others * which require the network to be probed; the author of each technique * is detailed with its data structures. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DO_DEALIAS_H #define __SCAMPER_DO_DEALIAS_H void *scamper_do_dealias_alloc(char *str); scamper_task_t *scamper_do_dealias_alloctask(void *data, scamper_list_t *list, scamper_cycle_t *cycle); int scamper_do_dealias_arg_validate(int argc, char *argv[], int *stop); void scamper_do_dealias_free(void *); const char *scamper_do_dealias_usage(void); void scamper_do_dealias_cleanup(void); int scamper_do_dealias_init(void); #endif /* __SCAMPER_DO_DEALIAS_H */ scamper-cvs-20171204/scamper/dealias/scamper_dealias_json.c000644 001751 000000 00000032455 13130372145 023470 0ustar00mjlwheel000000 000000 /* * scamper_dealias_json.c * * Copyright (c) 2013 Matthew Luckie * Copyright (c) 2013-2014 The Regents of the University of California * Author: Matthew Luckie * * $Id: scamper_dealias_json.c,v 1.13 2017/07/09 09:16:21 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_dealias_json.c,v 1.13 2017/07/09 09:16:21 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_dealias.h" #include "scamper_file.h" #include "scamper_file_json.h" #include "scamper_dealias_json.h" #include "utils.h" static char *dealias_flags_encode(char *buf, size_t len, uint8_t flags, const char **f2s, size_t f2sc) { size_t i, off = 0; int f = 0; uint8_t u8; string_concat(buf, len, &off, ", \"flags\":["); for(i=0; i<8; i++) { if((u8 = flags & (0x1 << i)) == 0) continue; if(f > 0) string_concat(buf, len, &off, ","); if(i < f2sc) string_concat(buf, len, &off, "\"%s\"", f2s[i]); else string_concat(buf, len, &off, "%u", u8); f++; } string_concat(buf, len, &off, "]"); return buf; } static char *dealias_header_tostr(const scamper_dealias_t *dealias) { static const char *pf_flags[] = {"nobs", "csa"}; static const char *rg_flags[] = {"nobs"}; static const char *ally_flags[] = {"nobs"}; scamper_dealias_mercator_t *mc; scamper_dealias_ally_t *ally; scamper_dealias_radargun_t *rg; scamper_dealias_prefixscan_t *pf; scamper_dealias_bump_t *bump; char buf[512], tmp[64]; size_t off = 0; uint16_t u16; string_concat(buf, sizeof(buf), &off, "{\"type\":\"dealias\",\"version\":\"0.2\",\"method\":\"%s\"", scamper_dealias_method_tostr(dealias, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"userid\":%u, \"result\":\"%s\"", dealias->userid, scamper_dealias_result_tostr(dealias, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"start\":{\"sec\":%u, \"usec\":%u}", dealias->start.tv_sec, dealias->start.tv_usec); if(SCAMPER_DEALIAS_METHOD_IS_MERCATOR(dealias)) { mc = dealias->data; string_concat(buf, sizeof(buf), &off, ", \"attempts\":%u, \"wait_timeout\":%u", mc->attempts, mc->wait_timeout); } else if(SCAMPER_DEALIAS_METHOD_IS_ALLY(dealias)) { ally = dealias->data; string_concat(buf, sizeof(buf), &off, ", \"wait_probe\":%u, \"wait_timeout\":%u", ally->wait_probe, ally->wait_timeout); string_concat(buf, sizeof(buf), &off, ", \"attempts\":%u, \"fudge\":%u", ally->attempts, ally->fudge); if(ally->flags != 0) { dealias_flags_encode(tmp, sizeof(tmp), ally->flags, ally_flags, sizeof(ally_flags)/sizeof(char *)); string_concat(buf, sizeof(buf), &off, "%s", tmp); } } else if(SCAMPER_DEALIAS_METHOD_IS_RADARGUN(dealias)) { rg = dealias->data; string_concat(buf, sizeof(buf), &off, ", \"attempts\":%u, \"wait_probe\":%u", rg->attempts, rg->wait_probe); string_concat(buf, sizeof(buf), &off, ", \"wait_round\":%u, \"wait_timeout\":%u", rg->wait_round, rg->wait_timeout); if(rg->flags != 0) string_concat(buf, sizeof(buf), &off, "%s", dealias_flags_encode(tmp,sizeof(tmp),rg->flags,rg_flags, sizeof(rg_flags)/sizeof(char *))); } else if(SCAMPER_DEALIAS_METHOD_IS_PREFIXSCAN(dealias)) { pf = dealias->data; string_concat(buf, sizeof(buf), &off, ", \"a\":\"%s\"", scamper_addr_tostr(pf->a, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"b\":\"%s/%u\"", scamper_addr_tostr(pf->b, tmp, sizeof(tmp)), pf->prefix); if(pf->ab != NULL) string_concat(buf, sizeof(buf), &off, ", \"ab\":\"%s/%u\"", scamper_addr_tostr(pf->ab, tmp, sizeof(tmp)), scamper_addr_prefixhosts(pf->b, pf->ab)); if(pf->xc > 0) { string_concat(buf, sizeof(buf), &off, ", \"xs\":[\"%s\"", scamper_addr_tostr(pf->xs[0], tmp, sizeof(tmp))); for(u16=1; u16 < pf->xc; u16++) string_concat(buf, sizeof(buf), &off, ", \"%s\"", scamper_addr_tostr(pf->xs[u16], tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, "]"); } string_concat(buf, sizeof(buf), &off, ", \"attempts\":%u, \"replyc\":%u, \"fudge\":%u", pf->attempts, pf->replyc, pf->fudge); string_concat(buf, sizeof(buf), &off, ", \"wait_probe\":%u, \"wait_timeout\":%u", pf->wait_probe, pf->wait_timeout); if(pf->flags != 0) string_concat(buf, sizeof(buf), &off, "%s", dealias_flags_encode(tmp,sizeof(tmp),pf->flags,pf_flags, sizeof(pf_flags)/sizeof(char *))); } else if(SCAMPER_DEALIAS_METHOD_IS_BUMP(dealias)) { bump = dealias->data; string_concat(buf, sizeof(buf), &off, ", \"wait_probe\":%u, \"bump_limit\":%u, \"attempts\":%u", bump->wait_probe, bump->bump_limit, bump->attempts); } return strdup(buf); } static char *dealias_probedef_tostr(const scamper_dealias_probedef_t *def) { char buf[256], tmp[64]; size_t off = 0; string_concat(buf, sizeof(buf), &off, "{\"id\":%u, \"src\":\"%s\"", def->id, scamper_addr_tostr(def->src, tmp, sizeof(tmp))); string_concat(buf, sizeof(buf), &off, ", \"dst\":\"%s\", \"ttl\":%u, \"size\":%u", scamper_addr_tostr(def->dst, tmp, sizeof(tmp)), def->ttl, def->size); string_concat(buf, sizeof(buf), &off, ", \"method\":\"%s\"", scamper_dealias_probedef_method_tostr(def, tmp, sizeof(tmp))); if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_ICMP(def)) string_concat(buf, sizeof(buf), &off, ", \"icmp_id\":%u, \"icmp_csum\":%u", def->un.icmp.id, def->un.icmp.csum); else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP(def)) string_concat(buf, sizeof(buf), &off, ", \"udp_sport\":%u, \"udp_dport\":%u", def->un.udp.sport, def->un.udp.dport); else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP(def)) string_concat(buf, sizeof(buf), &off, ", \"tcp_sport\":%u, \"tcp_dport\":%u, \"tcp_flags\":%u", def->un.tcp.sport, def->un.tcp.dport, def->un.tcp.flags); if(def->mtu > 0) string_concat(buf, sizeof(buf), &off, ", \"mtu\":%u", def->mtu); string_concat(buf, sizeof(buf), &off, "}"); return strdup(buf); } static int dealias_probedefs_get(const scamper_dealias_t *dealias, scamper_dealias_probedef_t **defs, int *defc) { scamper_dealias_mercator_t *mc; scamper_dealias_ally_t *ally; scamper_dealias_radargun_t *rg; scamper_dealias_prefixscan_t *pf; scamper_dealias_bump_t *bump; switch(dealias->method) { case SCAMPER_DEALIAS_METHOD_MERCATOR: mc = dealias->data; *defs = &mc->probedef; *defc = 1; break; case SCAMPER_DEALIAS_METHOD_ALLY: ally = dealias->data; *defs = ally->probedefs; *defc = 2; break; case SCAMPER_DEALIAS_METHOD_RADARGUN: rg = dealias->data; *defs = rg->probedefs; *defc = rg->probedefc; break; case SCAMPER_DEALIAS_METHOD_PREFIXSCAN: pf = dealias->data; *defs = pf->probedefs; *defc = pf->probedefc; break; case SCAMPER_DEALIAS_METHOD_BUMP: bump = dealias->data; *defs = bump->probedefs; *defc = 2; break; default: return -1; } return 0; } static char *dealias_reply_tostr(const scamper_dealias_reply_t *reply) { char buf[256], tmp[64]; size_t off = 0; string_concat(buf, sizeof(buf), &off, "{\"src\":\"%s\", \"rx\":{\"sec\":%u, \"usec\":%u}, \"ttl\":%u", scamper_addr_tostr(reply->src, tmp, sizeof(tmp)), reply->rx.tv_sec, reply->rx.tv_usec, reply->ttl); if(SCAMPER_ADDR_TYPE_IS_IPV4(reply->src)) string_concat(buf, sizeof(buf), &off, ", \"ipid\": %u", reply->ipid); else if(reply->flags & SCAMPER_DEALIAS_REPLY_FLAG_IPID32) string_concat(buf, sizeof(buf), &off, ", \"ipid\": %u", reply->ipid32); string_concat(buf, sizeof(buf), &off, ", \"proto\":%u", reply->proto); if(SCAMPER_DEALIAS_REPLY_IS_ICMP(reply)) { string_concat(buf, sizeof(buf), &off, ", \"icmp_type\":%u, \"icmp_code\":%u", reply->icmp_type, reply->icmp_code); if(SCAMPER_DEALIAS_REPLY_IS_ICMP_UNREACH(reply) || SCAMPER_DEALIAS_REPLY_IS_ICMP_TTL_EXP(reply)) string_concat(buf, sizeof(buf), &off, ", \"icmp_q_ttl\":%u",reply->icmp_q_ip_ttl); } else if(SCAMPER_DEALIAS_REPLY_IS_TCP(reply)) { string_concat(buf, sizeof(buf), &off, ", \"tcp_flags\":%u", reply->tcp_flags); } string_concat(buf, sizeof(buf), &off, "}"); return strdup(buf); } static char *dealias_probe_tostr(const scamper_dealias_probe_t *probe) { char header[256], **replies = NULL, *rc = NULL, *str = NULL; size_t len, wc = 0, header_len = 0, *reply_lens = NULL; int i; string_concat(header, sizeof(header), &header_len, "{\"probedef_id\":%u, \"seq\":%u, \"tx\":{\"sec\":%u, \"usec\":%u}", probe->def->id, probe->seq, probe->tx.tv_sec, probe->tx.tv_usec); if(SCAMPER_ADDR_TYPE_IS_IPV4(probe->def->dst)) string_concat(header, sizeof(header), &header_len, ", \"ipid\":%u", probe->ipid); string_concat(header, sizeof(header), &header_len, ", \"replies\":["); len = header_len; if(probe->replyc > 0) { if((replies = malloc_zero(sizeof(char *) * probe->replyc)) == NULL || (reply_lens = malloc_zero(sizeof(size_t) * probe->replyc)) == NULL) goto done; for(i=0; ireplyc; i++) { if(i > 0) len += 2; /* , */ if((replies[i] = dealias_reply_tostr(probe->replies[i])) == NULL) goto done; reply_lens[i] = strlen(replies[i]); len += reply_lens[i]; } } len += 3; /* ]}\0 */ if((str = malloc_zero(len)) == NULL) goto done; memcpy(str, header, header_len); wc += header_len; if(probe->replyc > 0) { for(i=0; ireplyc; i++) { if(i > 0) { memcpy(str+wc, ", ", 2); wc += 2; } memcpy(str+wc, replies[i], reply_lens[i]); wc += reply_lens[i]; } } memcpy(str+wc, "]}\0", 3); wc += 3; assert(wc == len); rc = str; done: if(rc == NULL && str != NULL) free(str); if(replies != NULL) { for(i=0; ireplyc; i++) if(replies[i] != NULL) free(replies[i]); free(replies); } if(reply_lens != NULL) free(reply_lens); return rc; } int scamper_file_json_dealias_write(const scamper_file_t *sf, const scamper_dealias_t *dealias) { char *str = NULL; size_t len = 0; size_t wc = 0; char *header = NULL; size_t header_len = 0; char **pds = NULL; size_t *pd_lens = NULL; char **prs = NULL; size_t *pr_lens = NULL; int i, rc = -1; uint32_t j; scamper_dealias_probedef_t *defs = NULL; int defc = 0; /* get the header string */ if((header = dealias_header_tostr(dealias)) == NULL) goto cleanup; len = (header_len = strlen(header)); len += 2; /* }\n" */ /* get the probedef strings */ if(dealias_probedefs_get(dealias, &defs, &defc) != 0 || (pds = malloc_zero(sizeof(char *) * defc)) == NULL || (pd_lens = malloc_zero(sizeof(size_t) * defc)) == NULL) goto cleanup; len += 16; /* , "probedefs":[] */ for(i=0; i 0) len += 2; /* , */ pds[i] = dealias_probedef_tostr(&defs[i]); pd_lens[i] = strlen(pds[i]); len += pd_lens[i]; } /* get the probe strings */ len += 13; /* , "probes":[] */ if(dealias->probec > 0) { if((prs = malloc_zero(sizeof(char *) * dealias->probec)) == NULL || (pr_lens = malloc_zero(sizeof(size_t) * dealias->probec)) == NULL) goto cleanup; for(j=0; jprobec; j++) { if(j > 0) len += 2; /* , */ if((prs[j] = dealias_probe_tostr(dealias->probes[j])) == NULL) goto cleanup; pr_lens[j] = strlen(prs[j]); len += pr_lens[j]; } } if((str = malloc_zero(len)) == NULL) goto cleanup; memcpy(str+wc, header, header_len); wc += header_len; memcpy(str+wc, ", \"probedefs\":[", 15); wc += 15; for(i=0; i 0) { memcpy(str+wc, ", ", 2); wc += 2; } memcpy(str+wc, pds[i], pd_lens[i]); wc += pd_lens[i]; } memcpy(str+wc, "]", 1); wc++; memcpy(str+wc, ", \"probes\":[", 12); wc += 12; if(dealias->probec > 0) { for(j=0; jprobec; j++) { if(j > 0 ) { memcpy(str+wc, ", ", 2); wc += 2; } memcpy(str+wc, prs[j], pr_lens[j]); wc += pr_lens[j]; } } memcpy(str+wc, "]", 1); wc++; memcpy(str+wc, "}\n", 2); wc += 2; assert(wc == len); rc = json_write(sf, str, len); cleanup: if(str != NULL) free(str); if(header != NULL) free(header); if(pd_lens != NULL) free(pd_lens); if(pr_lens != NULL) free(pr_lens); if(pds != NULL) { for(i=0; iprobec; j++) if(prs[j] != NULL) free(prs[j]); free(prs); } return rc; } scamper-cvs-20171204/scamper/dealias/scamper_dealias_json.h000644 001751 000000 00000001765 12176775563 023521 0ustar00mjlwheel000000 000000 /* * scamper_dealias_json.h * * $Id: scamper_dealias_json.h,v 1.1 2013/08/02 18:33:23 mjl Exp $ * * Copyright (c) 2013 The Regents of the University of California * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_DEALIAS_JSON_H #define __SCAMPER_DEALIAS_JSON_H int scamper_file_json_dealias_write(const scamper_file_t *sf, const struct scamper_dealias *dealias); #endif scamper-cvs-20171204/scamper/dealias/scamper_dealias_text.c000644 001751 000000 00000004136 12072121206 023470 0ustar00mjlwheel000000 000000 /* * scamper_dealias_text.c * * Copyright (C) 2008-2010 The University of Waikato * Copyright (C) 2013 Matthew Luckie * Author: Matthew Luckie * * $Id: scamper_dealias_text.c,v 1.3 2013/01/05 22:00:38 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_dealias_text.c,v 1.3 2013/01/05 22:00:38 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_file.h" #include "scamper_dealias.h" #include "scamper_dealias_text.h" #include "utils.h" int scamper_file_text_dealias_write(const scamper_file_t *sf, const scamper_dealias_t *dealias) { scamper_dealias_ally_t *ally; char buf[256], a[64], b[64], c[32]; int fd = scamper_file_getfd(sf); if(SCAMPER_DEALIAS_METHOD_IS_ALLY(dealias)) { ally = dealias->data; if(dealias->result == SCAMPER_DEALIAS_RESULT_ALIASES) snprintf(c, sizeof(c), "aliases"); else if(dealias->result == SCAMPER_DEALIAS_RESULT_NOTALIASES) snprintf(c, sizeof(c), "not aliases"); else if(dealias->result == SCAMPER_DEALIAS_RESULT_NONE) snprintf(c, sizeof(c), "none"); else snprintf(c, sizeof(c), "%d", dealias->result); snprintf(buf, sizeof(buf), "%s %s %s\n", scamper_addr_tostr(ally->probedefs[0].dst, a, sizeof(a)), scamper_addr_tostr(ally->probedefs[1].dst, b, sizeof(b)), c); write_wrap(fd, buf, NULL, strlen(buf)); } return 0; } scamper-cvs-20171204/scamper/dealias/scamper_dealias_text.h000644 001751 000000 00000002014 11452510530 023471 0ustar00mjlwheel000000 000000 /* * scamper_file_text_dealias.h * * Copyright (C) 2008-2010 The University of Waikato * Author: Matthew Luckie * * $Id: scamper_dealias_text.h,v 1.1 2010/10/05 02:45:44 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef __SCAMPER_FILE_TEXT_DEALIAS_H #define __SCAMPER_FILE_TEXT_DEALIAS_H int scamper_file_text_dealias_write(const scamper_file_t *sf, const scamper_dealias_t *dealias); #endif scamper-cvs-20171204/scamper/dealias/scamper_dealias_warts.c000644 001751 000000 00000150634 13022467213 023660 0ustar00mjlwheel000000 000000 /* * scamper_dealias_warts.c * * Copyright (C) 2008-2011 The University of Waikato * Copyright (C) 2012 Matthew Luckie * Copyright (C) 2012-2014 The Regents of the University of California * Copyright (C) 2015-2016 Matthew Luckie * Author: Matthew Luckie * * $Id: scamper_dealias_warts.c,v 1.16 2016/12/09 08:42:51 mjl Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You 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 * */ #ifndef lint static const char rcsid[] = "$Id: scamper_dealias_warts.c,v 1.16 2016/12/09 08:42:51 mjl Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "internal.h" #include "scamper_addr.h" #include "scamper_list.h" #include "scamper_icmpext.h" #include "scamper_dealias.h" #include "scamper_file.h" #include "scamper_file_warts.h" #include "scamper_dealias_warts.h" #include "mjl_splaytree.h" #include "utils.h" #define WARTS_DEALIAS_LIST_ID 1 #define WARTS_DEALIAS_CYCLE_ID 2 #define WARTS_DEALIAS_START 3 #define WARTS_DEALIAS_METHOD 4 #define WARTS_DEALIAS_RESULT 5 #define WARTS_DEALIAS_PROBEC 6 #define WARTS_DEALIAS_USERID 7 static const warts_var_t dealias_vars[] = { {WARTS_DEALIAS_LIST_ID, 4, -1}, {WARTS_DEALIAS_CYCLE_ID, 4, -1}, {WARTS_DEALIAS_START, 8, -1}, {WARTS_DEALIAS_METHOD, 1, -1}, {WARTS_DEALIAS_RESULT, 1, -1}, {WARTS_DEALIAS_PROBEC, 4, -1}, {WARTS_DEALIAS_USERID, 4, -1}, }; #define dealias_vars_mfb WARTS_VAR_MFB(dealias_vars) #define WARTS_DEALIAS_ALLY_WAIT_PROBE 1 #define WARTS_DEALIAS_ALLY_WAIT_TIMEOUT 2 #define WARTS_DEALIAS_ALLY_ATTEMPTS 3 #define WARTS_DEALIAS_ALLY_FUDGE 4 #define WARTS_DEALIAS_ALLY_FLAGS 5 static const warts_var_t dealias_ally_vars[] = { {WARTS_DEALIAS_ALLY_WAIT_PROBE, 2, -1}, {WARTS_DEALIAS_ALLY_WAIT_TIMEOUT, 1, -1}, {WARTS_DEALIAS_ALLY_ATTEMPTS, 1, -1}, {WARTS_DEALIAS_ALLY_FUDGE, 2, -1}, {WARTS_DEALIAS_ALLY_FLAGS, 1, -1}, }; #define dealias_ally_vars_mfb WARTS_VAR_MFB(dealias_ally_vars) #define WARTS_DEALIAS_MERCATOR_ATTEMPTS 1 #define WARTS_DEALIAS_MERCATOR_WAIT_TIMEOUT 2 static const warts_var_t dealias_mercator_vars[] = { {WARTS_DEALIAS_MERCATOR_ATTEMPTS, 1, -1}, {WARTS_DEALIAS_MERCATOR_WAIT_TIMEOUT, 1, -1}, }; #define dealias_mercator_vars_mfb WARTS_VAR_MFB(dealias_mercator_vars) #define WARTS_DEALIAS_RADARGUN_PROBEDEFC 1 #define WARTS_DEALIAS_RADARGUN_ATTEMPTS 2 #define WARTS_DEALIAS_RADARGUN_WAIT_PROBE 3 #define WARTS_DEALIAS_RADARGUN_WAIT_ROUND 4 #define WARTS_DEALIAS_RADARGUN_WAIT_TIMEOUT 5 #define WARTS_DEALIAS_RADARGUN_FLAGS 6 static const warts_var_t dealias_radargun_vars[] = { {WARTS_DEALIAS_RADARGUN_PROBEDEFC, 4, -1}, {WARTS_DEALIAS_RADARGUN_ATTEMPTS, 2, -1}, {WARTS_DEALIAS_RADARGUN_WAIT_PROBE, 2, -1}, {WARTS_DEALIAS_RADARGUN_WAIT_ROUND, 4, -1}, {WARTS_DEALIAS_RADARGUN_WAIT_TIMEOUT, 1, -1}, {WARTS_DEALIAS_RADARGUN_FLAGS, 1, -1}, }; #define dealias_radargun_vars_mfb WARTS_VAR_MFB(dealias_radargun_vars) #define WARTS_DEALIAS_PREFIXSCAN_A 1 #define WARTS_DEALIAS_PREFIXSCAN_B 2 #define WARTS_DEALIAS_PREFIXSCAN_AB 3 #define WARTS_DEALIAS_PREFIXSCAN_XS 4 #define WARTS_DEALIAS_PREFIXSCAN_PREFIX 5 #define WARTS_DEALIAS_PREFIXSCAN_ATTEMPTS 6 #define WARTS_DEALIAS_PREFIXSCAN_FUDGE 7 #define WARTS_DEALIAS_PREFIXSCAN_WAIT_PROBE 8 #define WARTS_DEALIAS_PREFIXSCAN_WAIT_TIMEOUT 9 #define WARTS_DEALIAS_PREFIXSCAN_PROBEDEFC 10 #define WARTS_DEALIAS_PREFIXSCAN_FLAGS 11 #define WARTS_DEALIAS_PREFIXSCAN_REPLYC 12 static const warts_var_t dealias_prefixscan_vars[] = { {WARTS_DEALIAS_PREFIXSCAN_A, -1, -1}, {WARTS_DEALIAS_PREFIXSCAN_B, -1, -1}, {WARTS_DEALIAS_PREFIXSCAN_AB, -1, -1}, {WARTS_DEALIAS_PREFIXSCAN_XS, -1, -1}, {WARTS_DEALIAS_PREFIXSCAN_PREFIX, 1, -1}, {WARTS_DEALIAS_PREFIXSCAN_ATTEMPTS, 1, -1}, {WARTS_DEALIAS_PREFIXSCAN_FUDGE, 2, -1}, {WARTS_DEALIAS_PREFIXSCAN_WAIT_PROBE, 2, -1}, {WARTS_DEALIAS_PREFIXSCAN_WAIT_TIMEOUT, 1, -1}, {WARTS_DEALIAS_PREFIXSCAN_PROBEDEFC, 2, -1}, {WARTS_DEALIAS_PREFIXSCAN_FLAGS, 1, -1}, {WARTS_DEALIAS_PREFIXSCAN_REPLYC, 1, -1}, }; #define dealias_prefixscan_vars_mfb WARTS_VAR_MFB(dealias_prefixscan_vars) #define WARTS_DEALIAS_BUMP_WAIT_PROBE 1 #define WARTS_DEALIAS_BUMP_BUMP_LIMIT 2 #define WARTS_DEALIAS_BUMP_ATTEMPTS 3 static const warts_var_t dealias_bump_vars[] = { {WARTS_DEALIAS_BUMP_WAIT_PROBE, 2, -1}, {WARTS_DEALIAS_BUMP_BUMP_LIMIT, 2, -1}, {WARTS_DEALIAS_BUMP_ATTEMPTS, 1, -1}, }; #define dealias_bump_vars_mfb WARTS_VAR_MFB(dealias_bump_vars) #define WARTS_DEALIAS_PROBEDEF_DST_GID 1 #define WARTS_DEALIAS_PROBEDEF_SRC_GID 2 #define WARTS_DEALIAS_PROBEDEF_ID 3 #define WARTS_DEALIAS_PROBEDEF_METHOD 4 #define WARTS_DEALIAS_PROBEDEF_TTL 5 #define WARTS_DEALIAS_PROBEDEF_TOS 6 #define WARTS_DEALIAS_PROBEDEF_4BYTES 7 #define WARTS_DEALIAS_PROBEDEF_TCP_FLAGS 8 #define WARTS_DEALIAS_PROBEDEF_ICMP_ID 9 #define WARTS_DEALIAS_PROBEDEF_DST 10 #define WARTS_DEALIAS_PROBEDEF_SRC 11 #define WARTS_DEALIAS_PROBEDEF_SIZE 12 #define WARTS_DEALIAS_PROBEDEF_MTU 13 #define WARTS_DEALIAS_PROBEDEF_ICMP_CSUM 14 static const warts_var_t dealias_probedef_vars[] = { {WARTS_DEALIAS_PROBEDEF_DST_GID, 4, -1}, {WARTS_DEALIAS_PROBEDEF_SRC_GID, 4, -1}, {WARTS_DEALIAS_PROBEDEF_ID, 4, -1}, {WARTS_DEALIAS_PROBEDEF_METHOD, 1, -1}, {WARTS_DEALIAS_PROBEDEF_TTL, 1, -1}, {WARTS_DEALIAS_PROBEDEF_TOS, 1, -1}, {WARTS_DEALIAS_PROBEDEF_4BYTES, 4, -1}, {WARTS_DEALIAS_PROBEDEF_TCP_FLAGS, 1, -1}, {WARTS_DEALIAS_PROBEDEF_ICMP_ID, 2, -1}, {WARTS_DEALIAS_PROBEDEF_DST, -1, -1}, {WARTS_DEALIAS_PROBEDEF_SRC, -1, -1}, {WARTS_DEALIAS_PROBEDEF_SIZE, 2, -1}, {WARTS_DEALIAS_PROBEDEF_MTU, 2, -1}, {WARTS_DEALIAS_PROBEDEF_ICMP_CSUM, 2, -1}, }; #define dealias_probedef_vars_mfb WARTS_VAR_MFB(dealias_probedef_vars) #define WARTS_DEALIAS_PROBE_DEF 1 #define WARTS_DEALIAS_PROBE_TX 2 #define WARTS_DEALIAS_PROBE_REPLYC 3 #define WARTS_DEALIAS_PROBE_IPID 4 #define WARTS_DEALIAS_PROBE_SEQ 5 static const warts_var_t dealias_probe_vars[] = { {WARTS_DEALIAS_PROBE_DEF, 4, -1}, {WARTS_DEALIAS_PROBE_TX, 8, -1}, {WARTS_DEALIAS_PROBE_REPLYC, 2, -1}, {WARTS_DEALIAS_PROBE_IPID, 2, -1}, {WARTS_DEALIAS_PROBE_SEQ, 4, -1}, }; #define dealias_probe_vars_mfb WARTS_VAR_MFB(dealias_probe_vars) #define WARTS_DEALIAS_REPLY_SRC_GID 1 #define WARTS_DEALIAS_REPLY_RX 2 #define WARTS_DEALIAS_REPLY_IPID 3 #define WARTS_DEALIAS_REPLY_TTL 4 #define WARTS_DEALIAS_REPLY_ICMP_TC 5 #define WARTS_DEALIAS_REPLY_ICMP_Q_TTL 6 #define WARTS_DEALIAS_REPLY_ICMP_EXT 7 #define WARTS_DEALIAS_REPLY_PROTO 8 #define WARTS_DEALIAS_REPLY_TCP_FLAGS 9 #define WARTS_DEALIAS_REPLY_SRC 10 #define WARTS_DEALIAS_REPLY_IPID32 11 #define WARTS_DEALIAS_REPLY_FLAG 12 static const warts_var_t dealias_reply_vars[] = { {WARTS_DEALIAS_REPLY_SRC_GID, 4, -1}, {WARTS_DEALIAS_REPLY_RX, 8, -1}, {WARTS_DEALIAS_REPLY_IPID, 2, -1}, {WARTS_DEALIAS_REPLY_TTL, 1, -1}, {WARTS_DEALIAS_REPLY_ICMP_TC, 2, -1}, {WARTS_DEALIAS_REPLY_ICMP_Q_TTL, 1, -1}, {WARTS_DEALIAS_REPLY_ICMP_EXT, -1, -1}, {WARTS_DEALIAS_REPLY_PROTO, 1, -1}, {WARTS_DEALIAS_REPLY_TCP_FLAGS, 1, -1}, {WARTS_DEALIAS_REPLY_SRC, -1, -1}, {WARTS_DEALIAS_REPLY_IPID32, 4, -1}, {WARTS_DEALIAS_REPLY_FLAG, 1, -1}, }; #define dealias_reply_vars_mfb WARTS_VAR_MFB(dealias_reply_vars) typedef struct warts_dealias_probedef { uint8_t flags[WARTS_VAR_MFB(dealias_probedef_vars)]; uint16_t flags_len; uint16_t params_len; } warts_dealias_probedef_t; typedef struct warts_dealias_data { warts_dealias_probedef_t *probedefs; uint32_t probedefc; uint8_t flags[2]; uint16_t flags_len; uint16_t params_len; } warts_dealias_data_t; typedef struct warts_dealias_reply { uint8_t flags[WARTS_VAR_MFB(dealias_reply_vars)]; uint16_t flags_len; uint16_t params_len; } warts_dealias_reply_t; typedef struct warts_dealias_probe { uint8_t flags[WARTS_VAR_MFB(dealias_probe_vars)]; uint16_t flags_len; uint16_t params_len; warts_dealias_reply_t *replies; } warts_dealias_probe_t; static void warts_dealias_params(const scamper_dealias_t *dealias, uint8_t *flags, uint16_t *flags_len, uint16_t *params_len) { const warts_var_t *var; int i, max_id = 0; memset(flags, 0, dealias_vars_mfb); *params_len = 0; for(i=0; iid == WARTS_DEALIAS_USERID && dealias->userid == 0) || (var->id == WARTS_DEALIAS_RESULT && dealias->result == 0) || (var->id == WARTS_DEALIAS_PROBEC && dealias->probec == 0)) continue; flag_set(flags, var->id, &max_id); assert(var->size != -1); *params_len += var->size; } *flags_len = fold_flags(flags, max_id); return; } static int warts_dealias_params_read(scamper_dealias_t *dealias, warts_state_t *state, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&dealias->list, (wpr_t)extract_list, state}, {&dealias->cycle, (wpr_t)extract_cycle, state}, {&dealias->start, (wpr_t)extract_timeval, NULL}, {&dealias->method, (wpr_t)extract_byte, NULL}, {&dealias->result, (wpr_t)extract_byte, NULL}, {&dealias->probec, (wpr_t)extract_uint32, NULL}, {&dealias->userid, (wpr_t)extract_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); return warts_params_read(buf, off, len, handlers, handler_cnt); } static int warts_dealias_params_write(const scamper_dealias_t *dealias, const scamper_file_t *sf, uint8_t *buf, uint32_t *off, const uint32_t len, const uint8_t *flags, const uint16_t flags_len, const uint16_t params_len) { uint32_t list_id, cycle_id; warts_param_writer_t handlers[] = { {&list_id, (wpw_t)insert_uint32, NULL}, {&cycle_id, (wpw_t)insert_uint32, NULL}, {&dealias->start, (wpw_t)insert_timeval, NULL}, {&dealias->method, (wpw_t)insert_byte, NULL}, {&dealias->result, (wpw_t)insert_byte, NULL}, {&dealias->probec, (wpw_t)insert_uint32, NULL}, {&dealias->userid, (wpw_t)insert_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); if(warts_list_getid(sf, dealias->list, &list_id) == -1) return -1; if(warts_cycle_getid(sf, dealias->cycle, &cycle_id) == -1) return -1; warts_params_write(buf, off, len, flags, flags_len, params_len, handlers, handler_cnt); return 0; } static int warts_dealias_probedef_params(const scamper_file_t *sf, const scamper_dealias_probedef_t *p, warts_dealias_probedef_t *state, warts_addrtable_t *table, uint32_t *len) { const warts_var_t *var; int i, max_id = 0; memset(state->flags, 0, dealias_probedef_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_DEALIAS_PROBEDEF_DST_GID || var->id == WARTS_DEALIAS_PROBEDEF_SRC_GID) continue; if((var->id == WARTS_DEALIAS_PROBEDEF_SIZE && p->size == 0) || (var->id == WARTS_DEALIAS_PROBEDEF_MTU && p->mtu == 0) || (var->id == WARTS_DEALIAS_PROBEDEF_TOS && p->tos == 0) || (var->id == WARTS_DEALIAS_PROBEDEF_ID && p->id == 0) || (var->id == WARTS_DEALIAS_PROBEDEF_4BYTES && SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP(p) == 0 && SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP(p) == 0) || (var->id == WARTS_DEALIAS_PROBEDEF_ICMP_ID && SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_ICMP(p) == 0) || (var->id == WARTS_DEALIAS_PROBEDEF_ICMP_CSUM && (SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_ICMP(p) == 0 || p->un.icmp.csum == 0)) || (var->id == WARTS_DEALIAS_PROBEDEF_TCP_FLAGS && SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP(p) == 0)) continue; flag_set(state->flags, var->id, &max_id); if(var->id == WARTS_DEALIAS_PROBEDEF_DST) { flag_set(state->flags, WARTS_DEALIAS_PROBEDEF_DST, &max_id); state->params_len += warts_addr_size(table, p->dst); } else if(var->id == WARTS_DEALIAS_PROBEDEF_SRC) { flag_set(state->flags, WARTS_DEALIAS_PROBEDEF_SRC, &max_id); state->params_len += warts_addr_size(table, p->src); } else { assert(var->size != -1); state->params_len += var->size; } } state->flags_len = fold_flags(state->flags, max_id); /* increase length for the probedef record */ *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_dealias_probedef_read(scamper_dealias_probedef_t *p, warts_state_t *state, warts_addrtable_t *table, uint8_t *buf,uint32_t *off,uint32_t len) { uint8_t bytes[4]; uint16_t bytes_len = 4; uint8_t tcp_flags = 0; uint16_t icmpid = 0, csum = 0; warts_param_reader_t handlers[] = { {&p->dst, (wpr_t)extract_addr_gid, state}, {&p->src, (wpr_t)extract_addr_gid, state}, {&p->id, (wpr_t)extract_uint32, NULL}, {&p->method, (wpr_t)extract_byte, NULL}, {&p->ttl, (wpr_t)extract_byte, NULL}, {&p->tos, (wpr_t)extract_byte, NULL}, {bytes, (wpr_t)extract_bytes, &bytes_len}, {&tcp_flags, (wpr_t)extract_byte, NULL}, {&icmpid, (wpr_t)extract_uint16, NULL}, {&p->dst, (wpr_t)extract_addr, table}, {&p->src, (wpr_t)extract_addr, table}, {&p->size, (wpr_t)extract_uint16, NULL}, {&p->mtu, (wpr_t)extract_uint16, NULL}, {&csum, (wpr_t)extract_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); uint32_t o = *off; if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; if(p->src == NULL || p->dst == NULL) return -1; if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_ICMP(p)) { if(flag_isset(&buf[o], WARTS_DEALIAS_PROBEDEF_4BYTES)) p->un.icmp.csum = bytes_ntohs(bytes+2); else p->un.icmp.csum = csum; p->un.icmp.id = icmpid; } else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP(p)) { p->un.tcp.sport = bytes_ntohs(bytes+0); p->un.tcp.dport = bytes_ntohs(bytes+2); p->un.tcp.flags = tcp_flags; } else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP(p)) { p->un.udp.sport = bytes_ntohs(bytes+0); p->un.udp.dport = bytes_ntohs(bytes+2); } else { return -1; } return 0; } static void warts_dealias_probedef_write(const scamper_dealias_probedef_t *p, warts_dealias_probedef_t *state, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len) { uint8_t bytes[4]; uint16_t bytes_len = 4; uint8_t tcp_flags; uint16_t icmpid, csum; uint16_t u16; warts_param_writer_t handlers[] = { {NULL, NULL, NULL}, {NULL, NULL, NULL}, {&p->id, (wpw_t)insert_uint32, NULL}, {&p->method, (wpw_t)insert_byte, NULL}, {&p->ttl, (wpw_t)insert_byte, NULL}, {&p->tos, (wpw_t)insert_byte, NULL}, {bytes, (wpw_t)insert_bytes_uint16, &bytes_len}, {&tcp_flags, (wpw_t)insert_byte, NULL}, {&icmpid, (wpw_t)insert_uint16, NULL}, {p->dst, (wpw_t)insert_addr, table}, {p->src, (wpw_t)insert_addr, table}, {&p->size, (wpw_t)insert_uint16, NULL}, {&p->mtu, (wpw_t)insert_uint16, NULL}, {&csum, (wpw_t)insert_uint16, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_ICMP(p)) { icmpid = p->un.icmp.id; csum = p->un.icmp.csum; } else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_UDP(p)) { u16 = htons(p->un.udp.sport); memcpy(bytes+0, &u16, 2); u16 = htons(p->un.udp.dport); memcpy(bytes+2, &u16, 2); } else if(SCAMPER_DEALIAS_PROBEDEF_PROTO_IS_TCP(p)) { u16 = htons(p->un.tcp.sport); memcpy(bytes+0, &u16, 2); u16 = htons(p->un.tcp.dport); memcpy(bytes+2, &u16, 2); tcp_flags = p->un.tcp.flags; } warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return; } static int extract_dealias_prefixscan_xs(const uint8_t *buf, uint32_t *off, const uint32_t len, scamper_dealias_prefixscan_t *pfs, void *param) { scamper_addr_t **xs; uint16_t xc, i; if(extract_uint16(buf, off, len, &xc, NULL) != 0) return -1; if(scamper_dealias_prefixscan_xs_alloc(pfs, xc) != 0) return -1; xs = pfs->xs; for(i=0; ixs = xs; pfs->xc = xc; return 0; } static void insert_dealias_prefixscan_xs(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_dealias_prefixscan_t *p, void *param) { uint16_t i; i = htons(p->xc); insert_uint16(buf, off, len, &i, NULL); for(i=0; ixc; i++) insert_addr(buf, off, len, p->xs[i], param); return; } static int warts_dealias_prefixscan_state(const scamper_file_t *sf, const void *data, warts_dealias_data_t *state, warts_addrtable_t *table, uint32_t *len) { const scamper_dealias_prefixscan_t *p = data; const warts_var_t *var; int max_id = 0; uint16_t i, j; size_t size; if(p->probedefc > 0) { size = p->probedefc * sizeof(warts_dealias_probedef_t); if((state->probedefs = malloc_zero(size)) == NULL) return -1; } memset(state->flags, 0, dealias_prefixscan_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_DEALIAS_PREFIXSCAN_A) { if(p->a != NULL) { flag_set(state->flags, var->id, &max_id); state->params_len += warts_addr_size(table, p->a); } continue; } else if(var->id == WARTS_DEALIAS_PREFIXSCAN_B) { if(p->b != NULL) { flag_set(state->flags, var->id, &max_id); state->params_len += warts_addr_size(table, p->b); } continue; } else if(var->id == WARTS_DEALIAS_PREFIXSCAN_AB) { if(p->ab != NULL) { flag_set(state->flags, var->id, &max_id); state->params_len += warts_addr_size(table, p->ab); } continue; } else if(var->id == WARTS_DEALIAS_PREFIXSCAN_XS) { if(p->xc > 0) { flag_set(state->flags, var->id, &max_id); state->params_len += 2; for(j=0; jxc; j++) state->params_len += warts_addr_size(table, p->xs[j]); } continue; } else if(var->id == WARTS_DEALIAS_PREFIXSCAN_PROBEDEFC) { if(p->probedefc == 0) continue; } else if(var->id == WARTS_DEALIAS_PREFIXSCAN_FLAGS) { if(p->flags == 0) continue; } else if(var->id == WARTS_DEALIAS_PREFIXSCAN_REPLYC) { if(p->replyc == 5) continue; } flag_set(state->flags, var->id, &max_id); assert(var->size >= 0); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); for(i=0; iprobedefc; i++) { if(warts_dealias_probedef_params(sf, &p->probedefs[i], &state->probedefs[i], table, len) != 0) { return -1; } } *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_dealias_prefixscan_read(scamper_dealias_t *dealias, warts_state_t *state, warts_addrtable_t *table, scamper_dealias_probedef_t **defs, uint32_t *defc, uint8_t *buf, uint32_t *off, uint32_t len) { scamper_dealias_prefixscan_t pfs, *p; warts_param_reader_t handlers[] = { {&pfs.a, (wpr_t)extract_addr, table}, {&pfs.b, (wpr_t)extract_addr, table}, {&pfs.ab, (wpr_t)extract_addr, table}, {&pfs, (wpr_t)extract_dealias_prefixscan_xs, table}, {&pfs.prefix, (wpr_t)extract_byte, NULL}, {&pfs.attempts, (wpr_t)extract_byte, NULL}, {&pfs.fudge, (wpr_t)extract_uint16, NULL}, {&pfs.wait_probe, (wpr_t)extract_uint16, NULL}, {&pfs.wait_timeout, (wpr_t)extract_byte, NULL}, {&pfs.probedefc, (wpr_t)extract_uint16, NULL}, {&pfs.flags, (wpr_t)extract_byte, NULL}, {&pfs.replyc, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); uint32_t o = *off; uint16_t i; memset(&pfs, 0, sizeof(pfs)); if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; if(pfs.a == NULL || pfs.b == NULL) return -1; if(scamper_dealias_prefixscan_alloc(dealias) != 0) return -1; p = dealias->data; memcpy(p, &pfs, sizeof(pfs)); /* by default we require five replies before inferring an alias */ if(flag_isset(&buf[o], WARTS_DEALIAS_PREFIXSCAN_REPLYC) == 0) p->replyc = 5; if(p->probedefc > 0) { if(scamper_dealias_prefixscan_probedefs_alloc(p, p->probedefc) != 0) return -1; for(i=0; iprobedefc; i++) { if(warts_dealias_probedef_read(&p->probedefs[i], state, table, buf, off, len) != 0) return -1; } } *defs = p->probedefs; *defc = p->probedefc; return 0; } static void warts_dealias_prefixscan_write(const void *data, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, warts_dealias_data_t *state) { const scamper_dealias_prefixscan_t *prefixscan = data; warts_param_writer_t handlers[] = { {prefixscan->a, (wpw_t)insert_addr, table}, {prefixscan->b, (wpw_t)insert_addr, table}, {prefixscan->ab, (wpw_t)insert_addr, table}, {prefixscan, (wpw_t)insert_dealias_prefixscan_xs, table}, {&prefixscan->prefix, (wpw_t)insert_byte, NULL}, {&prefixscan->attempts, (wpw_t)insert_byte, NULL}, {&prefixscan->fudge, (wpw_t)insert_uint16, NULL}, {&prefixscan->wait_probe, (wpw_t)insert_uint16, NULL}, {&prefixscan->wait_timeout, (wpw_t)insert_byte, NULL}, {&prefixscan->probedefc, (wpw_t)insert_uint16, NULL}, {&prefixscan->flags, (wpw_t)insert_byte, NULL}, {&prefixscan->replyc, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); uint32_t i; warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); for(i=0; iprobedefc; i++) { warts_dealias_probedef_write(&prefixscan->probedefs[i], &state->probedefs[i], sf, table, buf, off, len); } return; } static int warts_dealias_radargun_state(const scamper_file_t *sf, const void *data, warts_dealias_data_t *state, warts_addrtable_t *table, uint32_t *len) { const scamper_dealias_radargun_t *rg = data; const warts_var_t *var; int max_id = 0; size_t size; uint32_t i; if(rg->probedefc == 0) return -1; size = rg->probedefc * sizeof(warts_dealias_probedef_t); if((state->probedefs = malloc_zero(size)) == NULL) return -1; memset(state->flags, 0, dealias_radargun_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_DEALIAS_RADARGUN_FLAGS) { if(rg->flags == 0) continue; } flag_set(state->flags, var->id, &max_id); assert(var->size >= 0); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); for(i=0; iprobedefc; i++) { if(warts_dealias_probedef_params(sf, &rg->probedefs[i], &state->probedefs[i], table, len) != 0) { return -1; } } /* increase length required for the radargun record */ *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_dealias_radargun_read(scamper_dealias_t *dealias, warts_state_t *state, warts_addrtable_t *table, scamper_dealias_probedef_t **defs, uint32_t *defc, uint8_t *buf,uint32_t *off,uint32_t len) { scamper_dealias_radargun_t *rg; uint32_t probedefc = 0; uint16_t attempts = 0; uint16_t wait_probe = 0; uint32_t wait_round = 0; uint8_t wait_timeout = 0; uint8_t flags = 0; uint32_t i; warts_param_reader_t handlers[] = { {&probedefc, (wpr_t)extract_uint32, NULL}, {&attempts, (wpr_t)extract_uint16, NULL}, {&wait_probe, (wpr_t)extract_uint16, NULL}, {&wait_round, (wpr_t)extract_uint32, NULL}, {&wait_timeout, (wpr_t)extract_byte, NULL}, {&flags, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(scamper_dealias_radargun_alloc(dealias) != 0) return -1; if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; if(probedefc == 0) return -1; rg = dealias->data; if(scamper_dealias_radargun_probedefs_alloc(rg, probedefc) != 0) return -1; rg->probedefc = probedefc; rg->attempts = attempts; rg->wait_probe = wait_probe; rg->wait_round = wait_round; rg->wait_timeout = wait_timeout; rg->flags = flags; for(i=0; iprobedefs[i], state, table, buf, off, len) != 0) return -1; } *defs = rg->probedefs; *defc = rg->probedefc; return 0; } static void warts_dealias_radargun_write(const void *data, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, warts_dealias_data_t *state) { const scamper_dealias_radargun_t *rg = data; warts_param_writer_t handlers[] = { {&rg->probedefc, (wpw_t)insert_uint32, NULL}, {&rg->attempts, (wpw_t)insert_uint16, NULL}, {&rg->wait_probe, (wpw_t)insert_uint16, NULL}, {&rg->wait_round, (wpw_t)insert_uint32, NULL}, {&rg->wait_timeout, (wpw_t)insert_byte, NULL}, {&rg->flags, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); uint32_t i; warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); for(i=0; iprobedefc; i++) { warts_dealias_probedef_write(&rg->probedefs[i], &state->probedefs[i], sf, table, buf, off, len); } return; } static int warts_dealias_bump_state(const scamper_file_t *sf, const void *data, warts_dealias_data_t *state, warts_addrtable_t *table, uint32_t *len) { const scamper_dealias_bump_t *bump = data; const warts_var_t *var; int i, max_id = 0; size_t size = sizeof(warts_dealias_probedef_t) * 2; if((state->probedefs = malloc_zero(size)) == NULL) return -1; memset(state->flags, 0, dealias_bump_vars_mfb); state->params_len = 0; for(i=0; iflags, var->id, &max_id); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); if(warts_dealias_probedef_params(sf, &bump->probedefs[0], &state->probedefs[0], table, len) != 0 || warts_dealias_probedef_params(sf, &bump->probedefs[1], &state->probedefs[1], table, len) != 0) { return -1; } /* increase length required for the ally record */ *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_dealias_bump_read(scamper_dealias_t *dealias, warts_state_t *state, warts_addrtable_t *table, scamper_dealias_probedef_t **defs, uint32_t *defc, uint8_t *buf, uint32_t *off, uint32_t len) { scamper_dealias_bump_t *bump; uint16_t wait_probe = 0; uint16_t bump_limit = 0; uint8_t attempts = 0; warts_param_reader_t handlers[] = { {&wait_probe, (wpr_t)extract_uint16, NULL}, {&bump_limit, (wpr_t)extract_uint16, NULL}, {&attempts, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(scamper_dealias_bump_alloc(dealias) != 0) return -1; if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; bump = dealias->data; bump->wait_probe = wait_probe; bump->bump_limit = bump_limit; bump->attempts = attempts; if(warts_dealias_probedef_read(&bump->probedefs[0], state, table, buf, off, len) != 0 || warts_dealias_probedef_read(&bump->probedefs[1], state, table, buf, off, len) != 0) { return -1; } *defs = bump->probedefs; *defc = 2; return 0; } static void warts_dealias_bump_write(const void *data, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, warts_dealias_data_t *state) { const scamper_dealias_bump_t *bump = data; warts_param_writer_t handlers[] = { {&bump->wait_probe, (wpw_t)insert_uint16, NULL}, {&bump->bump_limit, (wpw_t)insert_uint16, NULL}, {&bump->attempts, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); warts_dealias_probedef_write(&bump->probedefs[0], &state->probedefs[0], sf, table, buf, off, len); warts_dealias_probedef_write(&bump->probedefs[1], &state->probedefs[1], sf, table, buf, off, len); return; } static int warts_dealias_ally_state(const scamper_file_t *sf, const void *data, warts_dealias_data_t *state, warts_addrtable_t *table, uint32_t *len) { const scamper_dealias_ally_t *ally = data; const warts_var_t *var; int i, max_id = 0; size_t size = sizeof(warts_dealias_probedef_t) * 2; if((state->probedefs = malloc_zero(size)) == NULL) return -1; memset(state->flags, 0, dealias_ally_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_DEALIAS_ALLY_FUDGE && ally->fudge == 0) || (var->id == WARTS_DEALIAS_ALLY_FLAGS && ally->flags == 0)) continue; flag_set(state->flags, var->id, &max_id); assert(var->size != -1); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); if(warts_dealias_probedef_params(sf, &ally->probedefs[0], &state->probedefs[0], table, len) != 0 || warts_dealias_probedef_params(sf, &ally->probedefs[1], &state->probedefs[1], table, len) != 0) { return -1; } /* increase length required for the ally record */ *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_dealias_ally_read(scamper_dealias_t *dealias, warts_state_t *state, warts_addrtable_t *table, scamper_dealias_probedef_t **defs, uint32_t *defc, uint8_t *buf, uint32_t *off, uint32_t len) { scamper_dealias_ally_t *ally; uint16_t wait_probe = 0; uint8_t wait_timeout = 0; uint8_t attempts = 0; uint16_t fudge = 0; uint8_t flags = 0; warts_param_reader_t handlers[] = { {&wait_probe, (wpr_t)extract_uint16, NULL}, {&wait_timeout, (wpr_t)extract_byte, NULL}, {&attempts, (wpr_t)extract_byte, NULL}, {&fudge, (wpr_t)extract_uint16, NULL}, {&flags, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(scamper_dealias_ally_alloc(dealias) != 0) return -1; if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; ally = dealias->data; ally->wait_probe = wait_probe; ally->wait_timeout = wait_timeout; ally->attempts = attempts; ally->fudge = fudge; ally->flags = flags; if(warts_dealias_probedef_read(&ally->probedefs[0], state, table, buf, off, len) != 0 || warts_dealias_probedef_read(&ally->probedefs[1], state, table, buf, off, len) != 0) { return -1; } *defs = ally->probedefs; *defc = 2; return 0; } static void warts_dealias_ally_write(const void *data, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, warts_dealias_data_t *state) { const scamper_dealias_ally_t *ally = data; warts_param_writer_t handlers[] = { {&ally->wait_probe, (wpw_t)insert_uint16, NULL}, {&ally->wait_timeout, (wpw_t)insert_byte, NULL}, {&ally->attempts, (wpw_t)insert_byte, NULL}, {&ally->fudge, (wpw_t)insert_uint16, NULL}, {&ally->flags, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); warts_dealias_probedef_write(&ally->probedefs[0], &state->probedefs[0], sf, table, buf, off, len); warts_dealias_probedef_write(&ally->probedefs[1], &state->probedefs[1], sf, table, buf, off, len); return; } static int warts_dealias_mercator_state(const scamper_file_t *sf, const void *data, warts_dealias_data_t *state, warts_addrtable_t *table,uint32_t *len) { const scamper_dealias_mercator_t *m = data; const warts_var_t *var; int i, max_id = 0; size_t size = sizeof(warts_dealias_probedef_t); if((state->probedefs = malloc_zero(size)) == NULL) return -1; assert(sizeof(state->flags) >= dealias_mercator_vars_mfb); memset(state->flags, 0, dealias_mercator_vars_mfb); state->params_len = 0; for(i=0; iflags, var->id, &max_id); assert(var->size != -1); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); if(warts_dealias_probedef_params(sf, &m->probedef, &state->probedefs[0], table, len) != 0) { return -1; } /* increase length required for the mercator record */ *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_dealias_mercator_read(scamper_dealias_t *dealias, warts_state_t *state, warts_addrtable_t *table, scamper_dealias_probedef_t **def, uint32_t *defc, uint8_t *buf, uint32_t *off, uint32_t len) { scamper_dealias_mercator_t *mercator; uint8_t attempts = 0; uint8_t wait_timeout = 0; warts_param_reader_t handlers[] = { {&attempts, (wpr_t)extract_byte, NULL}, {&wait_timeout, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); if(scamper_dealias_mercator_alloc(dealias) != 0) return -1; if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) return -1; mercator = dealias->data; mercator->attempts = attempts; mercator->wait_timeout = wait_timeout; if(warts_dealias_probedef_read(&mercator->probedef, state, table, buf, off, len) != 0) { return -1; } *def = &mercator->probedef; *defc = 1; return 0; } static void warts_dealias_mercator_write(const void *data, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, warts_dealias_data_t *state) { const scamper_dealias_mercator_t *m = data; warts_param_writer_t handlers[] = { {&m->attempts, (wpw_t)insert_byte, NULL}, {&m->wait_timeout, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); warts_dealias_probedef_write(&m->probedef, &state->probedefs[0], sf, table, buf, off, len); return; } static int extract_dealias_reply_icmptc(const uint8_t *buf, uint32_t *off, uint32_t len, scamper_dealias_reply_t *reply, void *param) { if(len - *off < 2) { return -1; } reply->icmp_type = buf[(*off)++]; reply->icmp_code = buf[(*off)++]; return 0; } static void insert_dealias_reply_icmptc(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_dealias_reply_t *reply, void *param) { assert(len - *off >= 2); buf[(*off)++] = reply->icmp_type; buf[(*off)++] = reply->icmp_code; return; } static int extract_dealias_reply_icmpext(const uint8_t *buf, uint32_t *off, uint32_t len, scamper_dealias_reply_t *reply, void *param) { return warts_icmpext_read(buf, off, len, &reply->icmp_ext); } static void insert_dealias_reply_icmpext(uint8_t *buf, uint32_t *off, const uint32_t len, const scamper_dealias_reply_t *reply, void *param) { warts_icmpext_write(buf, off, len, reply->icmp_ext); return; } static int warts_dealias_reply_state(const scamper_dealias_reply_t *reply, warts_dealias_reply_t *state, const scamper_file_t *sf, warts_addrtable_t *table, uint32_t *len) { const warts_var_t *var; scamper_icmpext_t *ie; int i, max_id = 0; memset(state->flags, 0, dealias_reply_vars_mfb); state->params_len = 0; /* encode any icmp extensions included */ if(SCAMPER_DEALIAS_REPLY_IS_ICMP(reply) && reply->icmp_ext != NULL) { flag_set(state->flags, WARTS_DEALIAS_REPLY_ICMP_EXT, &max_id); state->params_len += 2; for(ie = reply->icmp_ext; ie != NULL; ie = ie->ie_next) { state->params_len += (2 + 1 + 1 + ie->ie_dl); } } for(i=0; iid == WARTS_DEALIAS_REPLY_SRC_GID) { continue; } else if(var->id == WARTS_DEALIAS_REPLY_ICMP_TC) { if(SCAMPER_DEALIAS_REPLY_IS_ICMP(reply) == 0) continue; } else if(var->id == WARTS_DEALIAS_REPLY_ICMP_Q_TTL) { if(SCAMPER_DEALIAS_REPLY_IS_ICMP(reply) == 0) continue; } else if(var->id == WARTS_DEALIAS_REPLY_ICMP_EXT) { continue; } else if(var->id == WARTS_DEALIAS_REPLY_PROTO) { if(SCAMPER_DEALIAS_REPLY_IS_ICMP(reply)) continue; } else if(var->id == WARTS_DEALIAS_REPLY_TCP_FLAGS) { if(SCAMPER_DEALIAS_REPLY_IS_TCP(reply) == 0) continue; } else if(var->id == WARTS_DEALIAS_REPLY_IPID) { if(!SCAMPER_ADDR_TYPE_IS_IPV4(reply->src) || reply->ipid == 0) continue; } else if(var->id == WARTS_DEALIAS_REPLY_IPID32) { if(!SCAMPER_ADDR_TYPE_IS_IPV6(reply->src) || reply->ipid32 == 0) continue; } else if(var->id == WARTS_DEALIAS_REPLY_FLAG) { if(reply->flags == 0) continue; } flag_set(state->flags, var->id, &max_id); if(var->id == WARTS_DEALIAS_REPLY_SRC) { state->params_len += warts_addr_size(table, reply->src); continue; } assert(var->size >= 0); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); /* increase length required for the dealias reply record */ *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_dealias_reply_read(scamper_dealias_reply_t *reply, warts_state_t *state, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { warts_param_reader_t handlers[] = { {&reply->src, (wpr_t)extract_addr_gid, state}, {&reply->rx, (wpr_t)extract_timeval, NULL}, {&reply->ipid, (wpr_t)extract_uint16, NULL}, {&reply->ttl, (wpr_t)extract_byte, NULL}, {reply, (wpr_t)extract_dealias_reply_icmptc, NULL}, {&reply->icmp_q_ip_ttl, (wpr_t)extract_byte, NULL}, {reply, (wpr_t)extract_dealias_reply_icmpext, NULL}, {&reply->proto, (wpr_t)extract_byte, NULL}, {&reply->tcp_flags, (wpr_t)extract_byte, NULL}, {&reply->src, (wpr_t)extract_addr, table}, {&reply->ipid32, (wpr_t)extract_uint32, NULL}, {&reply->flags, (wpr_t)extract_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); uint32_t o = *off; int i; if((i = warts_params_read(buf, off, len, handlers, handler_cnt)) != 0) return i; if(flag_isset(&buf[o], WARTS_DEALIAS_REPLY_PROTO) == 0) { if(reply->src->type == SCAMPER_ADDR_TYPE_IPV4) reply->proto = IPPROTO_ICMP; else reply->proto = IPPROTO_ICMPV6; } return i; } static int warts_dealias_reply_write(const scamper_dealias_reply_t *r, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, warts_dealias_reply_t *state) { warts_param_writer_t handlers[] = { {NULL, NULL, NULL}, {&r->rx, (wpw_t)insert_timeval, NULL}, {&r->ipid, (wpw_t)insert_uint16, NULL}, {&r->ttl, (wpw_t)insert_byte, NULL}, {r, (wpw_t)insert_dealias_reply_icmptc, NULL}, {&r->icmp_q_ip_ttl, (wpw_t)insert_byte, NULL}, {r, (wpw_t)insert_dealias_reply_icmpext, NULL}, {&r->proto, (wpw_t)insert_byte, NULL}, {&r->tcp_flags, (wpw_t)insert_byte, NULL}, {r->src, (wpw_t)insert_addr, table}, {&r->ipid32, (wpw_t)insert_uint32, NULL}, {&r->flags, (wpw_t)insert_byte, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); return 0; } static int warts_dealias_probe_state(const scamper_file_t *sf, const scamper_dealias_probe_t *probe, warts_dealias_probe_t *state, warts_addrtable_t *table, uint32_t *len) { const warts_var_t *var; int i, max_id = 0; size_t size; memset(state->flags, 0, dealias_probe_vars_mfb); state->params_len = 0; for(i=0; iid == WARTS_DEALIAS_PROBE_DEF && probe->def->id == 0) || (var->id == WARTS_DEALIAS_PROBE_REPLYC && probe->replyc == 0) || (var->id == WARTS_DEALIAS_PROBE_SEQ && probe->seq == 0) || (var->id == WARTS_DEALIAS_PROBE_IPID && SCAMPER_ADDR_TYPE_IS_IPV4(probe->def->dst) == 0)) continue; flag_set(state->flags, var->id, &max_id); assert(var->size != -1); state->params_len += var->size; } state->flags_len = fold_flags(state->flags, max_id); state->replies = NULL; if(probe->replyc > 0) { size = sizeof(warts_dealias_reply_t) * probe->replyc; if((state->replies = malloc_zero(size)) == NULL) return -1; for(i=0; ireplyc; i++) { if(warts_dealias_reply_state(probe->replies[i], &state->replies[i], sf, table, len) != 0) { free(state->replies); state->replies = NULL; return -1; } } } /* increase length required for the probe record */ *len += state->flags_len + state->params_len; if(state->params_len != 0) *len += 2; return 0; } static int warts_dealias_probe_read(scamper_dealias_probe_t *probe, warts_state_t *state, scamper_dealias_probedef_t *defs, uint32_t defc, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, uint32_t len) { uint32_t probedef_id = 0; warts_param_reader_t handlers[] = { {&probedef_id, (wpr_t)extract_uint32, NULL}, {&probe->tx, (wpr_t)extract_timeval, NULL}, {&probe->replyc, (wpr_t)extract_uint16, NULL}, {&probe->ipid, (wpr_t)extract_uint16, NULL}, {&probe->seq, (wpr_t)extract_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_reader_t); scamper_dealias_reply_t *reply; int i; if(warts_params_read(buf, off, len, handlers, handler_cnt) != 0) { return -1; } if(probedef_id >= defc) return -1; probe->def = defs + probedef_id; if(probe->replyc == 0) return 0; if(scamper_dealias_replies_alloc(probe, probe->replyc) != 0) { return -1; } for(i=0; ireplyc; i++) { if((reply = scamper_dealias_reply_alloc()) == NULL) { return -1; } probe->replies[i] = reply; if(warts_dealias_reply_read(reply, state, table, buf, off, len) != 0) { return -1; } } return 0; } static void warts_dealias_probe_write(const scamper_dealias_probe_t *probe, const scamper_file_t *sf, warts_addrtable_t *table, uint8_t *buf, uint32_t *off, const uint32_t len, warts_dealias_probe_t *state) { int i; warts_param_writer_t handlers[] = { {&probe->def->id, (wpw_t)insert_uint32, NULL}, {&probe->tx, (wpw_t)insert_timeval, NULL}, {&probe->replyc, (wpw_t)insert_uint16, NULL}, {&probe->ipid, (wpw_t)insert_uint16, NULL}, {&probe->seq, (wpw_t)insert_uint32, NULL}, }; const int handler_cnt = sizeof(handlers)/sizeof(warts_param_writer_t); warts_params_write(buf, off, len, state->flags, state->flags_len, state->params_len, handlers, handler_cnt); for(i=0; ireplyc; i++) { warts_dealias_reply_write(probe->replies[i], sf, table, buf, off, len, &state->replies[i]); } return; } int scamper_file_warts_dealias_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_dealias_t **dealias_out) { static int (*const read[])(scamper_dealias_t *,warts_state_t *, warts_addrtable_t *,scamper_dealias_probedef_t **, uint32_t *, uint8_t *, uint32_t *, uint32_t) = { warts_dealias_mercator_read, warts_dealias_ally_read, warts_dealias_radargun_read, warts_dealias_prefixscan_read, warts_dealias_bump_read, }; scamper_dealias_t *dealias = NULL; scamper_dealias_probedef_t *defs; scamper_dealias_probe_t *probe; warts_addrtable_t *table = NULL; warts_state_t *state = scamper_file_getstate(sf); uint8_t *buf = NULL; uint32_t defc = 0; uint32_t off = 0; uint32_t i; if(warts_read(sf, &buf, hdr->len) != 0) { goto err; } if(buf == NULL) { *dealias_out = NULL; return 0; } if((dealias = scamper_dealias_alloc()) == NULL) { goto err; } if(warts_dealias_params_read(dealias, state, buf, &off, hdr->len) != 0) goto err; if(dealias->method == 0) goto err; /* bounds check the type, can only read types we know about */ if(dealias->method > 5) { scamper_dealias_free(dealias); *dealias_out = NULL; return 0; } if((table = warts_addrtable_alloc_byid()) == NULL) goto err; if(read[dealias->method-1](dealias, state, table, &defs, &defc, buf, &off, hdr->len) != 0) goto err; if(dealias->probec == 0) goto done; if(scamper_dealias_probes_alloc(dealias, dealias->probec) != 0) { goto err; } for(i=0; iprobec; i++) { if((probe = scamper_dealias_probe_alloc()) == NULL) { goto err; } dealias->probes[i] = probe; if(warts_dealias_probe_read(probe, state, defs, defc, table, buf, &off, hdr->len) != 0) { goto err; } } done: warts_addrtable_free(table); *dealias_out = dealias; free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(buf != NULL) free(buf); if(dealias != NULL) scamper_dealias_free(dealias); return -1; } static void warts_dealias_probes_free(warts_dealias_probe_t *probes, uint32_t cnt) { uint32_t i; if(probes != NULL) { for(i=0; imethod-1](sf, dealias->data, &data, table, &len) != 0) { goto err; } /* * figure out the state that we have to allocate to store the * probes sent (and their responses) */ if(dealias->probec > 0) { size = dealias->probec * sizeof(warts_dealias_probe_t); if((probes = (warts_dealias_probe_t *)malloc_zero(size)) == NULL) { goto err; } for(i=0; iprobec; i++) { probe = dealias->probes[i]; len2 = len; if(warts_dealias_probe_state(sf,probe,&probes[i],table,&len2) != 0) goto err; if(len2 < len) goto err; len = len2; } } if((buf = malloc_zero(len)) == NULL) goto err; insert_wartshdr(buf, &off, len, SCAMPER_FILE_OBJ_DEALIAS); if(warts_dealias_params_write(dealias, sf, buf, &off, len, flags, flags_len, params_len) != 0) { goto err; } write[dealias->method-1](dealias->data, sf, table, buf, &off, len, &data); if(data.probedefs != NULL) free(data.probedefs); data.probedefs = NULL; if(dealias->probec > 0) { for(i=0; iprobec; i++) { probe = dealias->probes[i]; warts_dealias_probe_write(probe,sf,table,buf,&off, len, &probes[i]); } } warts_dealias_probes_free(probes, dealias->probec); probes = NULL; assert(off == len); if(warts_write(sf, buf, len) == -1) { goto err; } warts_addrtable_free(table); free(buf); return 0; err: if(table != NULL) warts_addrtable_free(table); if(probes != NULL) warts_dealias_probes_free(probes, dealias->probec); if(data.probedefs != NULL) free(data.probedefs); if(buf != NULL) free(buf); return -1; } scamper-cvs-20171204/scamper/dealias/scamper_dealias_warts.h000644 001751 000000 00000000542 11452510530 023651 0ustar00mjlwheel000000 000000 #ifndef __SCAMPER_FILE_WARTS_DEALIAS_H #define __SCAMPER_FILE_WARTS_DEALIAS_H int scamper_file_warts_dealias_read(scamper_file_t *sf, const warts_hdr_t *hdr, scamper_dealias_t **dealias_out); int scamper_file_warts_dealias_write(const scamper_file_t *sf, const scamper_dealias_t *dealias); #endif /* __SCAMPER_FILE_WARTS_DEALIAS_H */